summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStreusel <advance_me@hotmail.de>2013-04-23 00:26:00 -0700
committerStreusel <advance_me@hotmail.de>2013-04-23 00:26:00 -0700
commit8c3c4577bde31ccee677ea75649b89cfa5822240 (patch)
tree6f1c3cf85deea0932b974d5a8943184966bff46a
parent3a6517e14649805db47b332934f4cad972d00e95 (diff)
parent038174e232c03519474f86e5738cecac34bbdee3 (diff)
downloadhercules-8c3c4577bde31ccee677ea75649b89cfa5822240.tar.gz
hercules-8c3c4577bde31ccee677ea75649b89cfa5822240.tar.bz2
hercules-8c3c4577bde31ccee677ea75649b89cfa5822240.tar.xz
hercules-8c3c4577bde31ccee677ea75649b89cfa5822240.zip
Merge branch 'master' of github.com:HerculesWS/Hercules
-rw-r--r--conf/atcommand.conf7
-rw-r--r--conf/battle/status.conf8
-rw-r--r--conf/channels.conf22
-rw-r--r--conf/char-server.conf8
-rw-r--r--conf/map-server.conf9
-rw-r--r--conf/messages.conf37
-rw-r--r--db/cashshop_db.conf55
-rw-r--r--db/cashshop_db.txt45
-rw-r--r--db/const.txt2
-rw-r--r--db/packet_db.txt1842
-rw-r--r--db/pre-re/item_combo_db.txt14
-rw-r--r--db/pre-re/item_db.txt10
-rw-r--r--db/pre-re/item_trade.txt4
-rw-r--r--db/pre-re/map_zone_db.conf34
-rw-r--r--db/pre-re/skill_db.txt1
-rw-r--r--db/quest_db.txt131
-rw-r--r--db/re/item_combo_db.txt14
-rw-r--r--db/re/item_db.txt43
-rw-r--r--db/re/item_trade.txt4
-rw-r--r--db/re/map_zone_db.conf34
-rw-r--r--db/re/mob_db.txt745
-rw-r--r--db/re/mob_skill_db.txt7
-rw-r--r--db/re/skill_db.txt1
-rw-r--r--doc/script_commands.txtbin592766 -> 289408 bytes
-rw-r--r--npc/custom/breeder.txt2
-rw-r--r--npc/custom/healer.txt2
-rw-r--r--npc/merchants/buying_shops.txt2
-rw-r--r--npc/merchants/coin_exchange.txt2
-rw-r--r--npc/other/fortune.txt906
-rw-r--r--npc/other/gympass.txt4
-rw-r--r--npc/re/cities/dicastes.txt3
-rw-r--r--npc/re/cities/malangdo.txt184
-rw-r--r--npc/re/jobs/3-1/warlock.txt13
-rw-r--r--npc/re/merchants/card_separation.txt279
-rw-r--r--npc/re/merchants/coin_exchange.txt2
-rw-r--r--npc/re/merchants/enchan_mal.txt29
-rw-r--r--npc/re/quests/quests_dicastes.txt6
-rw-r--r--npc/re/quests/quests_malangdo.txt4723
-rw-r--r--sql-files/item_db.sql6
-rw-r--r--sql-files/item_db_re.sql277
-rw-r--r--sql-files/main.sql5
-rw-r--r--sql-files/upgrades/2013-03-06--00-00.sql2
-rw-r--r--sql-files/upgrades/2013-04-16--01-24.sql3
-rw-r--r--sql-files/upgrades/2013-04-16--02-15.sql4
-rw-r--r--sql-files/upgrades/index.txt3
-rw-r--r--src/char/char.c119
-rw-r--r--src/char/inter.c7
-rw-r--r--src/common/malloc.c92
-rw-r--r--src/common/mmo.h11
-rw-r--r--src/config/const.h14
-rw-r--r--src/config/core.h16
-rw-r--r--src/config/secure.h24
-rw-r--r--src/login/login.c4
-rw-r--r--src/map/Makefile.in4
-rw-r--r--src/map/atcommand.c5191
-rw-r--r--src/map/atcommand.h98
-rw-r--r--src/map/battle.c134
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/buyingstore.c31
-rw-r--r--src/map/buyingstore.h31
-rw-r--r--src/map/chat.c7
-rw-r--r--src/map/clif.c1428
-rw-r--r--src/map/clif.h45
-rw-r--r--src/map/duel.c10
-rw-r--r--src/map/guild.c28
-rw-r--r--src/map/intif.c2
-rw-r--r--src/map/irc-bot.c272
-rw-r--r--src/map/irc-bot.h58
-rw-r--r--src/map/itemdb.c33
-rw-r--r--src/map/itemdb.h3
-rw-r--r--src/map/log.c608
-rw-r--r--src/map/log.h84
-rw-r--r--src/map/mail.c2
-rw-r--r--src/map/map.c495
-rw-r--r--src/map/map.h51
-rw-r--r--src/map/mob.c71
-rw-r--r--src/map/npc.c62
-rw-r--r--src/map/npc.h7
-rw-r--r--src/map/packets.h5
-rw-r--r--src/map/packets_struct.h376
-rw-r--r--src/map/party.c17
-rw-r--r--src/map/pc.c215
-rw-r--r--src/map/pc.h27
-rw-r--r--src/map/pc_groups.c40
-rw-r--r--src/map/pc_groups.h5
-rw-r--r--src/map/pet.c12
-rw-r--r--src/map/script.c6959
-rw-r--r--src/map/script.h4
-rw-r--r--src/map/searchstore.c201
-rw-r--r--src/map/searchstore.h42
-rw-r--r--src/map/skill.c59
-rw-r--r--src/map/skill.h1
-rw-r--r--src/map/sql/CMakeLists.txt5
-rw-r--r--src/map/status.c232
-rw-r--r--src/map/status.h1
-rw-r--r--src/map/trade.c7
-rw-r--r--src/map/unit.c79
-rw-r--r--src/map/vending.c183
-rw-r--r--src/map/vending.h31
-rw-r--r--vcproj-10/map-server.vcxproj3
-rw-r--r--vcproj-10/map-server.vcxproj.filters9
-rw-r--r--vcproj-12/map-server.vcxproj3
-rw-r--r--vcproj-12/map-server.vcxproj.filters9
-rw-r--r--vcproj-9/map-server.vcproj14
104 files changed, 16351 insertions, 10766 deletions
diff --git a/conf/atcommand.conf b/conf/atcommand.conf
index 67af3b91f..6e35d5327 100644
--- a/conf/atcommand.conf
+++ b/conf/atcommand.conf
@@ -59,6 +59,13 @@ aliases: {
channel: ["main"]
}
+/* list of commands that should not be logged at all */
+/* add as many commands as you like */
+nolog: {
+ iteminfo: 1
+ mobinfo: 1
+}
+
/* Commands help file */
help: {
@include "conf/help.txt"
diff --git a/conf/battle/status.conf b/conf/battle/status.conf
index 6efe973b7..5341b606b 100644
--- a/conf/battle/status.conf
+++ b/conf/battle/status.conf
@@ -27,14 +27,6 @@ debuff_on_logout: 3
pc_status_def_rate: 100
mob_status_def_rate: 100
-// Required luk to gain inmunity to status changes.
-// Luk increases resistance by closing the gap between natural resist and max
-// linearly. This setting indicates required luk to gain complete immunity.
-// Eg: 40 vit -> 40% resist. 150 luk -> +50% of the missing gap.
-// So 40% + (50% of 60%) = 70%
-pc_luk_status_def: 300
-mob_luk_status_def: 300
-
// Maximum resistance to status changes. (100 = 100%)
// NOTE: Cards and equipment can go over this limit, so it only applies to natural resist.
pc_max_status_def: 100
diff --git a/conf/channels.conf b/conf/channels.conf
index b12d2da8b..3584fc2ea 100644
--- a/conf/channels.conf
+++ b/conf/channels.conf
@@ -1,3 +1,14 @@
+//====================================================
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
+//= | | | | __/ | | (__| |_| | | __/\__ \
+//= \_| |_/\___|_| \___|\__,_|_|\___||___/
+//=
+//= http://hercules.ws/board/
+//====================================================
+//= http://hercules.ws/board/topic/316-introducing-hercules-channel-system/
chsys: (
{
/* default channels (available on boot) */
@@ -18,6 +29,7 @@ chsys: (
Cyan: "0x00b89d"
Yellow: "0xffff90"
Green: "0x28bf00"
+ Light_Green: "0x3dff98"
Normal: "0x00ff00"
/* as many colors as you like */
}
@@ -33,7 +45,15 @@ chsys: (
ally_channel_enabled: true
ally_channel_name: "ally" /* available as #ally */
ally_channel_color: "Green"
- ally_channel_autojoin: true
+ ally_channel_autojoin: true /* will members autojoin to their respective #ally chats when they log-in? */
+ /* "irc_channel" is a special channel connected to a specific chat room in any irc network */
+ irc_channel_enabled: false
+ irc_channel_name: "irc" /* available as #irc */
+ irc_channel_color: "Light_Green"
+ irc_channel_network: "irc.rizon.net:6665" /* network to connect to (:and port) */
+ irc_channel_channel: "#Hercules" /* channel in the network above to join */
+ irc_channel_nick: "Hercules_chSysBot" /* nick the bot will use */
+ irc_channel_nick_pw: "" /* password to this nick (if any) to identify to nick server on the irc network */
}
)
diff --git a/conf/char-server.conf b/conf/char-server.conf
index da0b8d45b..b2120471c 100644
--- a/conf/char-server.conf
+++ b/conf/char-server.conf
@@ -94,11 +94,9 @@ save_log: yes
// Start point, Map name followed by coordinates (x,y)
start_point: new_1-1,53,111
-// Starting weapon for new characters
-start_weapon: 1201
-
-// Starting armor for new characters
-start_armor: 2301
+// Starting items for new characters
+// Format is: id1,qt1,idn,qtn
+start_items: 1201,1,2301,1
// Starting zeny for new characters
start_zeny: 0
diff --git a/conf/map-server.conf b/conf/map-server.conf
index b251e69ec..cac5421e6 100644
--- a/conf/map-server.conf
+++ b/conf/map-server.conf
@@ -89,18 +89,19 @@ minsave_time: 100
// Apart from the autosave_time, players will also get saved when involved
// in the following (add as needed):
-// 1: after every successful trade
-// 2: after every vending transaction
-// 4: after closing storage/guild storage.
+// 1: After every successful trade
+// 2: After every vending transaction
+// 4: After closing storage/guild storage.
// 8: After hatching/returning to egg a pet.
// 16: After successfully sending a mail with attachment
// 32: After successfully submitting an item for auction
// 64: After successfully get/delete/complete a quest
+// 128: After every buying store transaction
// NOTE: These settings decrease the chance of dupes/lost items when there's a
// server crash at the expense of increasing the map/char server lag. If your
// server rarely crashes, but experiences interserver lag, you may want to set
// these off.
-save_settings: 127
+save_settings: 255
// Message of the day file, when a character logs on, this message is displayed.
motd_txt: conf/motd.txt
diff --git a/conf/messages.conf b/conf/messages.conf
index e21c41176..823a6eb65 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -443,6 +443,9 @@
// Homunculus messages
450: You already have a homunculus
+// Return pet to egg message
+451: You can't return your pet because your inventory is full.
+
// Messages of others (not for GM commands)
// ----------------------------------------
@@ -1452,6 +1455,40 @@
1431: Your global chat is now binded to the '%s' channel
1432: Your global chat is not binded to any channel
1433: Your global chat is now unbinded from the '#%s' channel
+1434: Player '%s' was not found
+1437: Player '%s' has now been banned from '%s' channel
+1438: You cannot join the '%s' channel because you've been banned from it
+1439: Channel '%s' has no banned players
+1440: Player '%s' is not banned from this channel
+1441: Player '%s' has now been unbanned from the '%s' channel
+1442: Removed all bans from '%s' channel
+1443: -- '%s' ban list
+1444: - %s
+1445: - %s (%d)
+1446: You need to input a option
+1447: '%s' is not a known channel option
+1448: -- Available options
+1449: option '%s' is already enabled, if you'd like to disable it type '@channel opt %s 0'
+1450: option '%s' is now enabled for channel '%s'
+1451: value '%d' for option '%s' is out of range (limit is 0-10)
+1452: option '%s' is now enabled for channel '%s' with %d seconds
+1453: option '%s' is now disabled for channel '%s'
+1454: option '%s' is not enabled on channel '%s'
+1455: You're talking too fast!
+1456: -- %s ban <channel name> <character name>
+1457: - bans <character name> from <channel name> channel
+1458: -- %s banlist <channel name>
+1459: - lists all banned characters from <channel name> channel
+1460: -- %s unban <channel name> <character name>
+1461: - unbans <character name> from <channel name> channel
+1462: -- %s setopt <channel name> <option name> <option value>
+1463: - adds or removes <option name> with <option value> to <channel name> channel
+1464: Ban failed, not possible to ban this user.
+1465: Player '%s' is already banned from this channel
+1466: For '%s' you need the amount of seconds (from 0 to 10)
+1467: -- %s unbanall <channel name>
+1468: - unbans everyone from <channel name>
+
//Custom translations
import: conf/import/msg_conf.txt
diff --git a/db/cashshop_db.conf b/db/cashshop_db.conf
new file mode 100644
index 000000000..381d898e0
--- /dev/null
+++ b/db/cashshop_db.conf
@@ -0,0 +1,55 @@
+//====================================================
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
+//= | | | | __/ | | (__| |_| | | __/\__ \
+//= \_| |_/\___|_| \___|\__,_|_|\___||___/
+//=
+//= http://hercules.ws/board/
+//====================================================
+//= http://hercules.ws/board/topic/367-introducing-cash-shop-support/
+
+cash_shop: (
+{
+ cat_0: { //New
+ Apple:100
+ ID531:250
+ }
+
+ cat_1: { //Popular
+ ID513:100
+ Banana_Juice:250
+ }
+
+ cat_2: { //Limited
+ Grape:100
+ ID533:250
+ }
+
+ cat_3: { //Rental
+ ID515:100
+ Carrot_Juice:250
+ }
+
+ cat_4: { //Permanent
+ Green_Herb:100
+ ID510:250
+ }
+
+ cat_5: { //Scroll
+ ID501:100
+ ID502:250
+ }
+
+ cat_6: { //Usable
+ White_Potion:150
+ Blue_Potion:500
+ }
+
+ cat_7: { //Other
+ ID909:400
+ ID907:500
+ }
+}
+) \ No newline at end of file
diff --git a/db/cashshop_db.txt b/db/cashshop_db.txt
deleted file mode 100644
index fc6a803c7..000000000
--- a/db/cashshop_db.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-// Hercules Cash Shop Database
-// Format:
-// Tab ID or Tab Name, ItemID or Item Name, Price
-//
-// Tabs:
-// 0 = New
-// 1 = Popular
-// 2 = Limited
-// 3 = Rental
-// 4 = Permanent
-// 5 = Scroll
-// 6 = Usable
-// 7 = Other
-
-//New
-New,Apple,100
-0,531,250
-
-//Popular
-1,513,100
-Popular,Banana_Juice,250
-
-//Limited
-2,Grape,100
-Limited,533,250
-
-//Rental
-Rental,515,100
-3,Carrot_Juice,250
-
-//Permanent
-4,Green_Herb,100
-Permanent,510,250
-
-//Scroll
-5,501,100
-5,502,250
-
-//Usable
-usable,White_Potion,150
-usable,Blue_Potion,500
-
-//Other
-7,909,400
-7,907,500 \ No newline at end of file
diff --git a/db/const.txt b/db/const.txt
index d3d5991ab..ec051c4b0 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -333,8 +333,6 @@ mf_snow 16
mf_fog 17
mf_sakura 18
mf_leaves 19
-mf_rain 20
-mf_nogo 22
mf_clouds 23
mf_clouds2 24
mf_fireworks 25
diff --git a/db/packet_db.txt b/db/packet_db.txt
deleted file mode 100644
index 7c9492442..000000000
--- a/db/packet_db.txt
+++ /dev/null
@@ -1,1842 +0,0 @@
-// Client<->Map Packet Database
-//
-// Structure of Database:
-// PacketType,PacketLength[,Name,FieldIndex1:FieldIndex2:FieldIndex3:...]
-//
-// 01. PacketType ID of the packet.
-// 02. PacketLength Length of the packet. If 0, packet is disabled in current packet version. If -1, packet has variable size.
-// 03. Name Name of the packet parser function (optional, for incoming packets only).
-// 04. FieldIndex Specifies the offset of a packet field in bytes from the begin of the packet (only specified when Name is given).
-// Can be 0, when the layout is not known.
-// ...
-//
-// NOTE: Up to MAX_PACKET_POS (typically 20) field indexes may be used.
-//
-// The packet database allows you to add support for new clients,
-// because packets change every release.
-//
-// Note: Every packet version needs a wanttoconnection specification, since
-// that is the packet used to identify a client's version.
-// If multiple versions have the same connection packet, the higher version
-// will be used (unless the lower one is specified as the default)
-//
-// Incoming packets have their parser function and layout specified, which enables
-// them for the current and all higher versions, unless explicitely disabled.
-//
-// Outgoing packets must be specified in order to enable them for the current
-// and all higher versions, unless explicitely disabled. Packets that are not
-// enabled for a packet version are silently discarded when sent as multicast.
-//
-// Every packet version inherits packet definitions from the previous (lower)
-// packet version.
-//
-// Main packet version of the DB to use (default = max available version)
-// Client detection is faster when all clients use this version.
-// Version 23 is the latest Sakexe (above versions are for Renewal clients)
-//packet_db_ver: 25
-packet_db_ver: 30
-
-packet_ver: 5
-0x0064,55
-0x0065,17
-0x0066,6
-0x0067,37
-0x0068,46
-0x0069,-1
-0x006a,23
-0x006b,-1
-0x006c,3
-0x006d,108
-0x006e,3
-0x006f,2
-0x0070,6
-0x0071,28
-0x0072,19,wanttoconnection,2:6:10:14:18
-0x0073,11
-0x0074,3
-0x0075,-1
-0x0076,9
-0x0077,5
-0x0078,54
-0x0079,53
-0x007a,58
-0x007b,60
-0x007c,41
-0x007d,2,loadendack,0
-0x007e,6,ticksend,2
-0x007f,6
-0x0080,7
-0x0081,3
-0x0082,2
-0x0083,2
-0x0084,2
-0x0085,5,walktoxy,2
-0x0086,16
-0x0087,12
-0x0088,10
-0x0089,7,actionrequest,2:6
-0x008a,29
-0x008b,2
-0x008c,-1,globalmessage,2:4
-0x008d,-1
-0x008e,-1
-//0x008f,-1
-0x0090,7,npcclicked,2
-0x0091,22
-0x0092,28
-0x0093,2
-0x0094,6,getcharnamerequest,2
-0x0095,30
-0x0096,-1,wis,2:4:28
-0x0097,-1
-0x0098,3
-0x0099,-1,broadcast,2:4
-0x009a,-1
-0x009b,5,changedir,2:4
-0x009c,9
-0x009d,17
-0x009e,17
-0x009f,6,takeitem,2
-0x00a0,23
-0x00a1,6
-0x00a2,6,dropitem,2:4
-0x00a3,-1
-0x00a4,-1
-0x00a5,-1
-0x00a6,-1
-0x00a7,8,useitem,2:4
-0x00a8,7
-0x00a9,6,equipitem,2:4
-0x00aa,7
-0x00ab,4,unequipitem,2
-0x00ac,7
-//0x00ad,-1
-0x00ae,-1
-0x00af,6
-0x00b0,8
-0x00b1,8
-0x00b2,3,restart,2
-0x00b3,3
-0x00b4,-1
-0x00b5,6
-0x00b6,6
-0x00b7,-1
-0x00b8,7,npcselectmenu,2:6
-0x00b9,6,npcnextclicked,2
-0x00ba,2
-0x00bb,5,statusup,2:4
-0x00bc,6
-0x00bd,44
-0x00be,5
-0x00bf,3,emotion,2
-0x00c0,7
-0x00c1,2,howmanyconnections,0
-0x00c2,6
-0x00c3,8
-0x00c4,6
-0x00c5,7,npcbuysellselected,2:6
-0x00c6,-1
-0x00c7,-1
-0x00c8,-1,npcbuylistsend,2:4
-0x00c9,-1,npcselllistsend,2:4
-0x00ca,3
-0x00cb,3
-0x00cc,6,gmkick,2
-0x00cd,3
-0x00ce,2,killall,0
-0x00cf,27,wisexin,2:26
-0x00d0,3,wisall,2
-0x00d1,4
-0x00d2,4
-0x00d3,2,wisexlist,0
-0x00d4,-1
-0x00d5,-1,createchatroom,2:4:6:7:15
-0x00d6,3
-0x00d7,-1
-0x00d8,6
-0x00d9,14,chataddmember,2:6
-0x00da,3
-0x00db,-1
-0x00dc,28
-0x00dd,29
-0x00de,-1,chatroomstatuschange,2:4:6:7:15
-0x00df,-1
-0x00e0,30,changechatowner,2:6
-0x00e1,30
-0x00e2,26,kickfromchat,2
-0x00e3,2,chatleave,0
-0x00e4,6,traderequest,2
-0x00e5,26
-0x00e6,3,tradeack,2
-0x00e7,3
-0x00e8,8,tradeadditem,2:4
-0x00e9,19
-0x00ea,5
-0x00eb,2,tradeok,0
-0x00ec,3
-0x00ed,2,tradecancel,0
-0x00ee,2
-0x00ef,2,tradecommit,0
-0x00f0,3
-0x00f1,2
-0x00f2,6
-0x00f3,8,movetokafra,2:4
-0x00f4,21
-0x00f5,8,movefromkafra,2:4
-0x00f6,8
-0x00f7,2,closekafra,0
-0x00f8,2
-0x00f9,26,createparty,2
-0x00fa,3
-0x00fb,-1
-0x00fc,6,partyinvite,2
-0x00fd,27
-0x00fe,30
-0x00ff,10,replypartyinvite,2:6
-0x0100,2,leaveparty,0
-0x0101,6
-0x0102,6,partychangeoption,2
-0x0103,30,removepartymember,2:6
-0x0104,79
-0x0105,31
-0x0106,10
-0x0107,10
-0x0108,-1,partymessage,2:4
-0x0109,-1
-0x010a,4
-0x010b,6
-0x010c,6
-0x010d,2
-0x010e,11
-0x010f,-1
-0x0110,10
-0x0111,39
-0x0112,4,skillup,2
-0x0113,10,useskilltoid,2:4:6
-0x0114,31
-0x0115,35
-0x0116,10,useskilltopos,2:4:6:8
-0x0117,18
-0x0118,2,stopattack,0
-0x0119,13
-0x011a,15
-0x011b,20,useskillmap,2:4
-0x011c,68
-0x011d,2,requestmemo,0
-0x011e,3
-0x011f,16
-0x0120,6
-0x0121,14
-0x0122,-1
-0x0123,-1
-0x0124,21
-0x0125,8
-0x0126,8,putitemtocart,2:4
-0x0127,8,getitemfromcart,2:4
-0x0128,8,movefromkafratocart,2:4
-0x0129,8,movetokafrafromcart,2:4
-0x012a,2,removeoption,0
-0x012b,2
-0x012c,3
-0x012d,4
-0x012e,2,closevending,0
-0x012f,-1
-0x0130,6,vendinglistreq,2
-0x0131,86
-0x0132,6
-0x0133,-1
-0x0134,-1,purchasereq,2:4:8
-0x0135,7
-0x0136,-1
-0x0137,6
-0x0138,3
-0x0139,16
-0x013a,4
-0x013b,4
-0x013c,4
-0x013d,6
-0x013e,24
-0x013f,26,itemmonster,2
-0x0140,22,mapmove,2:18:20
-0x0141,14
-0x0142,6
-0x0143,10,npcamountinput,2:6
-0x0144,23
-0x0145,19
-0x0146,6,npccloseclicked,2
-0x0147,39
-0x0148,8
-0x0149,9,gmreqnochat,2:6:7
-0x014a,6
-0x014b,27
-0x014c,-1
-0x014d,2,guildcheckmaster,0
-0x014e,6
-0x014f,6,guildrequestinfo,2
-0x0150,110
-0x0151,6,guildrequestemblem,2
-0x0152,-1
-0x0153,-1,guildchangeemblem,2:4
-0x0154,-1
-0x0155,-1,guildchangememberposition,2
-0x0156,-1
-0x0157,6
-0x0158,-1
-0x0159,54,guildleave,2:6:10:14
-0x015a,66
-0x015b,54,guildexpulsion,2:6:10:14
-0x015c,90
-0x015d,42,guildbreak,2
-0x015e,6
-0x015f,42
-0x0160,-1
-0x0161,-1,guildchangepositioninfo,2
-0x0162,-1
-0x0163,-1
-0x0164,-1
-0x0165,30,createguild,6
-0x0166,-1
-0x0167,3
-0x0168,14,guildinvite,2
-0x0169,3
-0x016a,30
-0x016b,10,guildreplyinvite,2:6
-0x016c,43
-0x016d,14
-0x016e,186,guildchangenotice,2:6:66
-0x016f,182
-0x0170,14,guildrequestalliance,2
-0x0171,30
-0x0172,10,guildreplyalliance,2:6
-0x0173,3
-0x0174,-1
-0x0175,6
-0x0176,106
-0x0177,-1
-0x0178,4,itemidentify,2
-0x0179,5
-0x017a,4,usecard,2
-0x017b,-1
-0x017c,6,insertcard,2:4
-0x017d,7
-0x017e,-1,guildmessage,2:4
-0x017f,-1
-0x0180,6,guildopposition,2
-0x0181,3
-0x0182,106
-0x0183,10,guilddelalliance,2:6
-0x0184,10
-0x0185,34
-//0x0186,-1
-0x0187,6
-0x0188,8
-0x0189,4
-0x018a,4,quitgame,0
-0x018b,4
-0x018c,29
-0x018d,-1
-0x018e,10,producemix,2:4:6:8
-0x018f,6
-0x0190,90,useskilltoposinfo,2:4:6:8:10
-0x0191,86
-0x0192,24
-0x0193,6,solvecharname,2
-0x0194,30
-0x0195,102
-0x0196,9
-0x0197,4,resetchar,2
-0x0198,8,changemaptype,2:4:6
-0x0199,4
-0x019a,14
-0x019b,10
-0x019c,-1,localbroadcast,2:4
-0x019d,6,gmhide,0
-0x019e,2
-0x019f,6,catchpet,2
-0x01a0,3
-0x01a1,3,petmenu,2
-0x01a2,35
-0x01a3,5
-0x01a4,11
-0x01a5,26,changepetname,2
-0x01a6,-1
-0x01a7,4,selectegg,2
-0x01a8,4
-0x01a9,6,sendemotion,2
-0x01aa,10
-0x01ab,12
-0x01ac,6
-0x01ad,-1
-0x01ae,4,selectarrow,2
-0x01af,4,changecart,2
-0x01b0,11
-0x01b1,7
-0x01b2,-1,openvending,2:4:84:85
-0x01b3,67
-0x01b4,12
-0x01b5,18
-0x01b6,114
-0x01b7,6
-0x01b8,3
-0x01b9,6
-0x01ba,26,remove,2
-0x01bb,26,shift,2
-0x01bc,26,recall,2
-0x01bd,26,summon,2
-0x01be,2
-0x01bf,3
-0x01c0,2
-0x01c1,14
-0x01c2,10
-0x01c3,-1
-0x01c4,22
-0x01c5,22
-0x01c6,4
-0x01c7,2
-0x01c8,13
-0x01c9,97
-//0x01ca,-1
-0x01cb,9
-0x01cc,9
-0x01cd,30
-0x01ce,6,autospell,2
-0x01cf,28
-0x01d0,8
-0x01d1,14
-0x01d2,10
-0x01d3,35
-0x01d4,6
-0x01d5,-1,npcstringinput,2:4:8
-0x01d6,4
-0x01d7,11
-0x01d8,54
-0x01d9,53
-0x01da,60
-0x01db,2
-0x01dc,-1
-0x01dd,47
-0x01de,33
-0x01df,6,gmreqaccname,2
-0x01e0,30
-0x01e1,8
-0x01e2,34
-0x01e3,14
-0x01e4,2
-0x01e5,6
-0x01e6,26
-0x01e7,2,sndoridori,0
-0x01e8,28,createparty2,2
-0x01e9,81
-0x01ea,6
-0x01eb,10
-0x01ec,26
-0x01ed,2,snexplosionspirits,0
-0x01ee,-1
-0x01ef,-1
-0x01f0,-1
-0x01f1,-1
-0x01f2,20
-0x01f3,10
-0x01f4,32
-0x01f5,9
-0x01f6,34
-0x01f7,14,adoptreply,0
-0x01f8,2
-0x01f9,6,adoptrequest,0
-0x01fa,48
-0x01fb,56
-0x01fc,-1
-0x01fd,4,repairitem,2
-0x01fe,5
-0x01ff,10
-0x0200,26
-0x0201,-1
-0x0202,26,friendslistadd,2
-0x0203,10,friendslistremove,2:6
-0x0204,18
-0x0205,26
-0x0206,11
-0x0207,34
-0x0208,11,friendslistreply,2:6:10
-0x0209,36
-0x020a,10
-//0x020b,-1
-//0x020c,-1
-0x020d,-1
-
-//2004-07-05aSakexe
-packet_ver: 6
-0x0072,22,wanttoconnection,5:9:13:17:21
-0x0085,8,walktoxy,5
-0x00a7,13,useitem,5:9
-0x0113,15,useskilltoid,4:9:11
-0x0116,15,useskilltopos,4:9:11:13
-0x0190,95,useskilltoposinfo,4:9:11:13:15
-0x0208,14,friendslistreply,2:6:10
-0x020e,24
-
-//2004-07-13aSakexe
-packet_ver: 7
-0x0072,39,wanttoconnection,12:22:30:34:38
-0x0085,9,walktoxy,6
-0x009b,13,changedir,5:12
-0x009f,10,takeitem,6
-0x00a7,17,useitem,6:13
-0x0113,19,useskilltoid,7:9:15
-0x0116,19,useskilltopos,7:9:15:17
-0x0190,99,useskilltoposinfo,7:9:15:17:19
-
-//2004-07-26aSakexe
-packet_ver: 8
-0x0072,14,dropitem,5:12
-0x007e,33,wanttoconnection,12:18:24:28:32
-0x0085,20,useskilltoid,7:12:16
-0x0089,15,getcharnamerequest,11
-0x008c,23,useskilltopos,3:6:17:21
-0x0094,10,takeitem,6
-0x009b,6,walktoxy,3
-0x009f,13,changedir,5:12
-0x00a2,103,useskilltoposinfo,3:6:17:21:23
-0x00a7,12,solvecharname,8
-0x00f3,-1,globalmessage,2:4
-0x00f5,17,useitem,6:12
-0x00f7,10,ticksend,6
-0x0113,16,movetokafra,5:12
-0x0116,2,closekafra,0
-0x0190,26,movefromkafra,10:22
-0x0193,9,actionrequest,3:8
-
-//2004-08-09aSakexe
-packet_ver: 9
-0x0072,17,dropitem,8:15
-0x007e,37,wanttoconnection,9:21:28:32:36
-0x0085,26,useskilltoid,11:18:22
-0x0089,12,getcharnamerequest,8
-0x008c,40,useskilltopos,5:15:29:38
-0x0094,13,takeitem,9
-0x009b,15,walktoxy,12
-0x009f,12,changedir,7:11
-0x00a2,120,useskilltoposinfo,5:15:29:38:40
-0x00a7,11,solvecharname,7
-0x00f5,24,useitem,9:20
-0x00f7,13,ticksend,9
-0x0113,23,movetokafra,5:19
-0x0190,26,movefromkafra,11:22
-0x0193,18,actionrequest,7:17
-
-//2004-08-16aSakexe
-0x0212,26,rc,2
-0x0213,26,check,2
-0x0214,42
-
-//2004-08-17aSakexe
-0x020f,10,pvpinfo,2:6
-0x0210,22
-
-//2004-09-06aSakexe
-packet_ver: 10
-0x0072,20,useitem,9:20
-0x007e,19,movetokafra,3:15
-0x0085,23,actionrequest,9:22
-0x0089,9,walktoxy,6
-0x008c,105,useskilltoposinfo,10:14:18:23:25
-0x0094,17,dropitem,6:15
-0x009b,14,getcharnamerequest,10
-0x009f,-1,globalmessage,2:4
-0x00a2,14,solvecharname,10
-0x00a7,25,useskilltopos,10:14:18:23
-0x00f3,10,changedir,4:9
-0x00f5,34,wanttoconnection,7:15:25:29:33
-0x00f7,2,closekafra,0
-0x0113,11,takeitem,7
-0x0116,11,ticksend,7
-0x0190,22,useskilltoid,9:15:18
-0x0193,17,movefromkafra,3:13
-
-//2004-09-20aSakexe
-packet_ver: 11
-0x0072,18,useitem,10:14
-0x007e,25,movetokafra,6:21
-0x0085,9,actionrequest,3:8
-0x0089,14,walktoxy,11
-0x008c,109,useskilltoposinfo,16:20:23:27:29
-0x0094,19,dropitem,12:17
-0x009b,10,getcharnamerequest,6
-0x00a2,10,solvecharname,6
-0x00a7,29,useskilltopos,6:20:23:27
-0x00f3,18,changedir,8:17
-0x00f5,32,wanttoconnection,10:17:23:27:31
-0x0113,14,takeitem,10
-0x0116,14,ticksend,10
-0x0190,14,useskilltoid,4:7:10
-0x0193,12,movefromkafra,4:8
-
-//2004-10-05aSakexe
-packet_ver: 12
-0x0072,17,useitem,6:13
-0x007e,16,movetokafra,5:12
-0x0089,6,walktoxy,3
-0x008c,103,useskilltoposinfo,2:6:17:21:23
-0x0094,14,dropitem,5:12
-0x009b,15,getcharnamerequest,11
-0x00a2,12,solvecharname,8
-0x00a7,23,useskilltopos,3:6:17:21
-0x00f3,13,changedir,5:12
-0x00f5,33,wanttoconnection,12:18:24:28:32
-0x0113,10,takeitem,6
-0x0116,10,ticksend,6
-0x0190,20,useskilltoid,7:12:16
-0x0193,26,movefromkafra,10:22
-
-//2004-10-25aSakexe
-packet_ver: 13
-0x0072,13,useitem,5:9
-0x007e,13,movetokafra,6:9
-0x0085,15,actionrequest,4:14
-0x008c,108,useskilltoposinfo,6:9:23:26:28
-0x0094,12,dropitem,6:10
-0x009b,10,getcharnamerequest,6
-0x00a2,16,solvecharname,12
-0x00a7,28,useskilltopos,6:9:23:26
-0x00f3,15,changedir,6:14
-0x00f5,29,wanttoconnection,5:14:20:24:28
-0x0113,9,takeitem,5
-0x0116,9,ticksend,5
-0x0190,26,useskilltoid,4:10:22
-0x0193,22,movefromkafra,12:18
-
-//2004-11-01aSakexe
-0x0084,-1
-0x0215,6
-
-//2004-11-08aSakexe
-0x0084,2
-0x0216,6
-0x0217,2,blacksmith,0
-0x0218,2,alchemist,0
-0x0219,282
-0x021a,282
-0x021b,10
-0x021c,10
-
-//2004-11-15aSakexe
-0x021d,6,lesseffect,2
-
-//2004-11-29aSakexe
-packet_ver: 14
-0x0072,22,useskilltoid,8:12:18
-0x007e,30,useskilltopos,4:9:22:28
-0x0085,-1,globalmessage,2:4
-0x0089,7,ticksend,3
-0x008c,13,getcharnamerequest,9
-0x0094,14,movetokafra,4:10
-0x009b,2,closekafra,0
-0x009f,18,actionrequest,6:17
-0x00a2,7,takeitem,3
-0x00a7,7,walktoxy,4
-0x00f3,8,changedir,3:7
-0x00f5,29,wanttoconnection,3:10:20:24:28
-0x00f7,14,solvecharname,10
-0x0113,110,useskilltoposinfo,4:9:22:28:30
-0x0116,12,dropitem,4:10
-0x0190,15,useitem,3:11
-0x0193,21,movefromkafra,4:17
-0x0221,-1
-0x0222,6,weaponrefine,2
-0x0223,8
-
-//2004-12-13aSakexe
-//skipped: many packets being set to -1
-0x0066,3
-0x0070,3
-0x01ca,3
-0x021e,6
-0x021f,66
-0x0220,10
-
-//2005-01-10bSakexe
-packet_ver: 15
-0x0072,26,useskilltoid,8:16:22
-0x007e,114,useskilltoposinfo,10:18:22:32:34
-0x0085,23,changedir,12:22
-0x0089,9,ticksend,5
-0x008c,8,getcharnamerequest,4
-0x0094,20,movetokafra,10:16
-0x009b,32,wanttoconnection,3:12:23:27:31
-0x009f,17,useitem,5:13
-0x00a2,11,solvecharname,7
-0x00a7,13,walktoxy,10
-0x00f3,-1,globalmessage,2:4
-0x00f5,9,takeitem,5
-0x00f7,21,movefromkafra,11:17
-0x0113,34,useskilltopos,10:18:22:32
-0x0116,20,dropitem,15:18
-0x0190,20,actionrequest,9:19
-0x0193,2,closekafra,0
-
-//2005-03-28aSakexe
-0x0224,10
-0x0225,2,taekwon,0
-0x0226,282
-
-//2005-04-04aSakexe
-0x0227,18
-0x0228,18
-
-//2005-04-11aSakexe
-0x0229,15
-0x022a,58
-0x022b,57
-0x022c,64
-
-//2005-04-25aSakexe
-0x022d,5,hommenu,2:4
-0x0232,9,hommoveto,2:6
-0x0233,11,homattack,2:6:10
-0x0234,6,hommovetomaster,2
-
-//2005-05-09aSakexe
-packet_ver: 16
-0x0072,25,useskilltoid,6:10:21
-0x007e,102,useskilltoposinfo,5:9:12:20:22
-0x0085,11,changedir,7:10
-0x0089,8,ticksend,4
-0x008c,11,getcharnamerequest,7
-0x0094,14,movetokafra,7:10
-0x009b,26,wanttoconnection,4:9:17:21:25
-0x009f,14,useitem,4:10
-0x00a2,15,solvecharname,11
-0x00a7,8,walktoxy,5
-0x00f5,8,takeitem,4
-0x00f7,22,movefromkafra,14:18
-0x0113,22,useskilltopos,5:9:12:20
-0x0116,10,dropitem,5:8
-0x0190,19,actionrequest,5:18
-
-//2005-05-23aSakexe
-0x022e,69
-0x0230,12
-
-//2005-05-30aSakexe
-0x022e,71
-0x0235,-1
-0x0236,10
-0x0237,2,rankingpk,0
-0x0238,282
-
-//2005-05-31aSakexe
-0x0216,2
-0x0239,11
-
-//2005-06-08aSakexe
-0x0216,6
-0x0217,2,blacksmith,0
-0x022f,5
-0x0231,26,changehomunculusname,0
-0x023a,4
-0x023b,36,storagepassword,2:4:20
-0x023c,6
-
-//2005-06-22aSakexe
-0x022e,71
-
-//2005-06-28aSakexe
-packet_ver: 17
-0x0072,34,useskilltoid,6:17:30
-0x007e,113,useskilltoposinfo,12:15:18:31:33
-0x0085,17,changedir,8:16
-0x0089,13,ticksend,9
-0x008c,8,getcharnamerequest,4
-0x0094,31,movetokafra,16:27
-0x009b,32,wanttoconnection,9:15:23:27:31
-0x009f,19,useitem,9:15
-0x00a2,9,solvecharname,5
-0x00a7,11,walktoxy,8
-0x00f5,13,takeitem,9
-0x00f7,18,movefromkafra,11:14
-0x0113,33,useskilltopos,12:15:18:31
-0x0116,12,dropitem,3:10
-0x0190,24,actionrequest,11:23
-0x0216,-1
-0x023d,-1
-0x023e,4
-
-//2005-07-18aSakexe
-packet_ver: 18
-0x0072,19,useskilltoid,5:11:15
-0x007e,110,useskilltoposinfo,9:15:23:28:30
-0x0085,11,changedir,6:10
-0x0089,7,ticksend,3
-0x008c,11,getcharnamerequest,7
-0x0094,21,movetokafra,12:17
-0x009b,31,wanttoconnection,3:13:22:26:30
-0x009f,12,useitem,3:8
-0x00a2,18,solvecharname,14
-0x00a7,15,walktoxy,12
-0x00f5,7,takeitem,3
-0x00f7,13,movefromkafra,5:9
-0x0113,30,useskilltopos,9:15:23:28
-0x0116,12,dropitem,6:10
-0x0190,21,actionrequest,5:20
-0x0216,6
-0x023f,2,mailrefresh,0
-0x0240,8
-0x0241,6,mailread,2
-0x0242,-1
-0x0243,6,maildelete,2
-0x0244,6,mailgetattach,2
-0x0245,7
-0x0246,4,mailwinopen,2
-0x0247,8,mailsetattach,2:4
-0x0248,68
-0x0249,3
-0x024a,70
-0x024b,4,auctioncancelreg,0
-0x024c,8,auctionsetitem,0
-0x024d,14
-0x024e,6,auctioncancel,0
-0x024f,10,auctionbid,0
-0x0250,3
-0x0251,2
-0x0252,-1
-
-//2005-07-19bSakexe
-packet_ver: 19
-0x0072,34,useskilltoid,6:17:30
-0x007e,113,useskilltoposinfo,12:15:18:31:33
-0x0085,17,changedir,8:16
-0x0089,13,ticksend,9
-0x008c,8,getcharnamerequest,4
-0x0094,31,movetokafra,16:27
-0x009b,32,wanttoconnection,9:15:23:27:31
-0x009f,19,useitem,9:15
-0x00a2,9,solvecharname,5
-0x00a7,11,walktoxy,8
-0x00f5,13,takeitem,9
-0x00f7,18,movefromkafra,11:14
-0x0113,33,useskilltopos,12:15:18:31
-0x0116,12,dropitem,3:10
-0x0190,24,actionrequest,11:23
-
-//2005-08-01aSakexe
-0x0245,3
-0x0251,4
-
-//2005-08-08aSakexe
-0x024d,12,auctionregister,0
-0x024e,4
-
-//2005-08-17aSakexe
-0x0253,3
-0x0254,3,feelsaveok,0
-
-//2005-08-29aSakexe
-0x0240,-1
-0x0248,-1,mailsend,2:4:28:68
-0x0255,5
-0x0256,-1
-0x0257,8
-
-//2005-09-12bSakexe
-0x0256,5
-0x0258,2
-0x0259,3
-
-//2005-10-10aSakexe
-0x020e,32
-0x025a,-1
-0x025b,6,cooking,0
-
-//2005-10-13aSakexe
-0x007a,6
-0x0251,32
-0x025c,4,auctionbuysell,0
-
-//2005-10-17aSakexe
-0x007a,58
-0x025d,6,auctionclose,0
-0x025e,4
-
-//2005-10-24aSakexe
-0x025f,6
-0x0260,6
-
-//2005-11-07aSakexe
-0x024e,6,auctioncancel,0
-0x0251,34,auctionsearch,0
-
-//2006-01-09aSakexe
-0x0261,11
-0x0262,11
-0x0263,11
-0x0264,20
-0x0265,20
-0x0266,30
-0x0267,4
-0x0268,4
-0x0269,4
-0x026a,4
-0x026b,4
-0x026c,4
-0x026d,4
-0x026f,2
-0x0270,2
-0x0271,38
-0x0272,44
-
-//2006-01-26aSakexe
-0x0271,40
-
-//2006-03-06aSakexe
-0x0273,6
-0x0274,8
-
-//2006-03-13aSakexe
-0x0273,30,mailreturn,2:6
-
-//2006-03-27aSakexe
-packet_ver: 20
-0x0072,26,useskilltoid,11:18:22
-0x007e,120,useskilltoposinfo,5:15:29:38:40
-0x0085,12,changedir,7:11
-//0x0089,13,ticksend,9
-0x008c,12,getcharnamerequest,8
-0x0094,23,movetokafra,5:19
-0x009b,37,wanttoconnection,9:21:28:32:36
-0x009f,24,useitem,9:20
-0x00a2,11,solvecharname,7
-0x00a7,15,walktoxy,12
-0x00f5,13,takeitem,9
-0x00f7,26,movefromkafra,11:22
-0x0113,40,useskilltopos,5:15:29:38
-0x0116,17,dropitem,8:15
-0x0190,18,actionrequest,7:17
-
-//2006-10-23aSakexe
-0x006d,110
-
-//2006-04-24aSakexe to 2007-01-02aSakexe
-0x023e,8
-0x0277,84
-0x0278,2
-0x0279,2
-0x027a,-1
-0x027b,14
-0x027c,60
-0x027d,62
-0x027e,-1
-0x027f,8
-0x0280,12
-0x0281,4
-0x0282,284
-0x0283,6
-0x0284,14
-0x0285,6
-0x0286,4
-0x0287,-1
-0x0288,6
-0x0289,8
-0x028a,18
-0x028b,-1
-0x028c,46
-0x028d,34
-0x028e,4
-0x028f,6
-0x0290,4
-0x0291,4
-0x0292,2,autorevive,0
-0x0293,70
-0x0294,10
-0x0295,-1
-0x0296,-1
-0x0297,-1
-0x0298,8
-0x0299,6
-0x029a,27
-0x029c,66
-0x029d,-1
-0x029e,11
-0x029f,3,mermenu,0
-0x02a0,-1
-0x02a1,-1
-0x02a2,8
-
-//2007-01-08aSakexe
-packet_ver: 21
-0x0072,30,useskilltoid,10:14:26
-0x007e,120,useskilltoposinfo,10:19:23:38:40
-0x0085,14,changedir,10:13
-0x0089,11,ticksend,7
-0x008c,17,getcharnamerequest,13
-0x0094,17,movetokafra,4:13
-0x009b,35,wanttoconnection,7:21:26:30:34
-0x009f,21,useitem,7:17
-0x00a2,10,solvecharname,6
-0x00a7,8,walktoxy,5
-0x00f5,11,takeitem,7
-0x00f7,15,movefromkafra,3:11
-0x0113,40,useskilltopos,10:19:23:38
-0x0116,19,dropitem,11:17
-0x0190,10,actionrequest,4:9
-
-//2007-01-22aSakexe
-0x02a3,18
-0x02a4,2
-
-//2007-01-29aSakexe
-0x029b,72
-0x02a3,-1
-0x02a4,-1
-0x02a5,8
-
-// 2007-02-05aSakexe
-0x02aa,4
-0x02ab,36
-0x02ac,6
-
-//2007-02-12aSakexe
-packet_ver: 22
-0x0072,25,useskilltoid,6:10:21
-0x007e,102,useskilltoposinfo,5:9:12:20:22
-0x0085,11,changedir,7:10
-0x0089,8,ticksend,4
-0x008c,11,getcharnamerequest,7
-0x0094,14,movetokafra,7:10
-0x009b,26,wanttoconnection,4:9:17:21:25
-0x009f,14,useitem,4:10
-0x00a2,15,solvecharname,11
-//0x00a7,8,walktoxy,5
-0x00f5,8,takeitem,4
-0x00f7,22,movefromkafra,14:18
-0x0113,22,useskilltopos,5:9:12:20
-0x0116,10,dropitem,5:8
-0x0190,19,actionrequest,5:18
-
-//2007-05-07aSakexe
-0x01fd,15,repairitem,2
-
-//2007-02-27aSakexe to 2007-10-02aSakexe
-0x0288,10,cashshopbuy,2:4:6
-0x0289,12
-0x02a6,22
-0x02a7,22
-0x02a8,162
-0x02a9,58
-0x02ad,8
-0x02b0,85
-0x02b1,-1
-0x02b2,-1
-0x02b3,107
-0x02b4,6
-0x02b5,-1
-0x02b6,7,queststate,2:6
-0x02b7,7
-0x02b8,22
-0x02b9,191
-0x02ba,11,hotkey,2:4:5:9
-0x02bb,8
-0x02bc,6
-0x02bf,10
-0x02c0,2
-0x02c1,-1
-0x02c2,-1
-0x02c4,26,partyinvite2,2
-0x02c5,30
-0x02c6,30
-0x02c7,7,replypartyinvite2,2:6
-0x02c8,3
-0x02c9,3
-0x02ca,3
-0x02cb,20
-0x02cc,4
-0x02cd,26
-0x02ce,10
-0x02cf,6
-0x02d0,-1
-0x02d1,-1
-0x02d2,-1
-0x02d3,4
-0x02d4,29
-0x02d5,2
-0x02d6,6,viewplayerequip,2
-0x02d7,-1
-0x02d8,10,equiptickbox,6
-0x02d9,10
-0x02da,3
-0x02db,-1,battlechat,2:4
-0x02dc,-1
-0x02dd,32
-0x02de,6
-0x02df,36
-0x02e0,34
-
-//2007-10-23aSakexe
-0x02cb,65
-0x02cd,71
-
-//2007-11-06aSakexe
-0x0078,55
-0x007c,42
-0x022c,65
-0x029b,80
-
-//2007-11-13aSakexe
-0x02e1,33
-
-//2007-11-20aSakexe
-//0x01df,10 <- ???
-0x02e2,14
-0x02e3,25
-0x02e4,8
-0x02e5,8
-0x02e6,6
-
-//2007-11-27aSakexe
-0x02e7,-1
-
-//2008-01-02aSakexe
-0x01df,6,gmreqaccname,2
-0x02e8,-1
-0x02e9,-1
-0x02ea,-1
-0x02eb,13
-0x02ec,67
-0x02ed,59
-0x02ee,60
-0x02ef,8
-
-//2008-03-18aSakexe
-0x02bf,-1
-0x02c0,-1
-0x02f0,10
-0x02f1,2,progressbar,0
-0x02f2,2
-
-//2008-03-25bSakexe
-0x02f3,-1
-0x02f4,-1
-0x02f5,-1
-0x02f6,-1
-0x02f7,-1
-0x02f8,-1
-0x02f9,-1
-0x02fa,-1
-0x02fb,-1
-0x02fc,-1
-0x02fd,-1
-0x02fe,-1
-0x02ff,-1
-0x0300,-1
-
-//2008-04-01aSakexe
-0x0301,-1
-0x0302,-1
-0x0303,-1
-0x0304,-1
-0x0305,-1
-0x0306,-1
-0x0307,-1
-0x0308,-1
-0x0309,-1
-0x030a,-1
-0x030b,-1
-0x030c,-1
-0x030d,-1
-0x030e,-1
-0x030f,-1
-0x0310,-1
-0x0311,-1
-0x0312,-1
-0x0313,-1
-0x0314,-1
-0x0315,-1
-0x0316,-1
-0x0317,-1
-0x0318,-1
-0x0319,-1
-0x031a,-1
-0x031b,-1
-0x031c,-1
-0x031d,-1
-0x031e,-1
-0x031f,-1
-0x0320,-1
-0x0321,-1
-0x0322,-1
-0x0323,-1
-0x0324,-1
-0x0325,-1
-0x0326,-1
-0x0327,-1
-0x0328,-1
-0x0329,-1
-0x032a,-1
-0x032b,-1
-0x032c,-1
-0x032d,-1
-0x032e,-1
-0x032f,-1
-0x0330,-1
-0x0331,-1
-0x0332,-1
-0x0333,-1
-0x0334,-1
-0x0335,-1
-0x0336,-1
-0x0337,-1
-0x0338,-1
-0x0339,-1
-0x033a,-1
-0x033b,-1
-0x033c,-1
-0x033d,-1
-0x033e,-1
-0x033f,-1
-0x0340,-1
-0x0341,-1
-0x0342,-1
-0x0343,-1
-0x0344,-1
-0x0345,-1
-0x0346,-1
-0x0347,-1
-0x0348,-1
-0x0349,-1
-0x034a,-1
-0x034b,-1
-0x034c,-1
-0x034d,-1
-0x034e,-1
-0x034f,-1
-0x0350,-1
-0x0351,-1
-0x0352,-1
-0x0353,-1
-0x0354,-1
-0x0355,-1
-0x0356,-1
-0x0357,-1
-0x0358,-1
-0x0359,-1
-0x035a,-1
-
-//2008-05-27aSakexe
-0x035b,-1
-0x035c,2
-0x035d,-1
-0x035e,2
-0x035f,-1
-0x0389,-1
-
-//2008-08-20aSakexe
-0x040c,-1
-0x040d,-1
-0x040e,-1
-0x040f,-1
-0x0410,-1
-0x0411,-1
-0x0412,-1
-0x0413,-1
-0x0414,-1
-0x0415,-1
-0x0416,-1
-0x0417,-1
-0x0418,-1
-0x0419,-1
-0x041a,-1
-0x041b,-1
-0x041c,-1
-0x041d,-1
-0x041e,-1
-0x041f,-1
-0x0420,-1
-0x0421,-1
-0x0422,-1
-0x0423,-1
-0x0424,-1
-0x0425,-1
-0x0426,-1
-0x0427,-1
-0x0428,-1
-0x0429,-1
-0x042a,-1
-0x042b,-1
-0x042c,-1
-0x042d,-1
-0x042e,-1
-0x042f,-1
-0x0430,-1
-0x0431,-1
-0x0432,-1
-0x0433,-1
-0x0434,-1
-0x0435,-1
-
-//2008-09-10aSakexe
-packet_ver: 23
-0x0436,19,wanttoconnection,2:6:10:14:18
-0x0437,7,actionrequest,2:6
-0x0438,10,useskilltoid,2:4:6
-0x0439,8,useitem,2:4
-
-//2008-11-13aSakexe
-0x043d,8
-0x043e,-1
-0x043f,8
-
-//2008-11-26aSakexe
-0x01a2,37
-0x0440,10
-0x0441,4
-
-//2008-12-10aSakexe
-0x0442,-1
-0x0443,8,skillselectmenu,2:6
-
-//2009-01-14aSakexe
-0x043f,25
-0x0444,-1
-0x0445,10
-
-//2009-02-18aSakexe
-0x0446,14
-
-//2009-02-25aSakexe
-0x0448,-1
-
-//2009-03-30aSakexe
-0x0449,4
-
-//2009-04-08aSakexe
-0x02a6,-1
-0x02a7,-1
-0x044a,6
-
-//Renewal Clients
-//2008-08-27aRagexeRE
-packet_ver: 24
-0x0072,22,useskilltoid,9:15:18
-0x007c,44
-0x007e,105,useskilltoposinfo,10:14:18:23:25
-0x0085,10,changedir,4:9
-0x0089,11,ticksend,7
-0x008c,14,getcharnamerequest,10
-0x0094,19,movetokafra,3:15
-0x009b,34,wanttoconnection,7:15:25:29:33
-0x009f,20,useitem,7:20
-0x00a2,14,solvecharname,10
-0x00a7,9,walktoxy,6
-0x00f5,11,takeitem,7
-0x00f7,17,movefromkafra,3:13
-0x0113,25,useskilltopos,10:14:18:23
-0x0116,17,dropitem,6:15
-0x0190,23,actionrequest,9:22
-0x02e2,20
-0x02e3,22
-0x02e4,11
-0x02e5,9
-
-//2008-09-10aRagexeRE
-packet_ver: 25
-0x0436,19,wanttoconnection,2:6:10:14:18
-0x0437,7,actionrequest,2:6
-0x0438,10,useskilltoid,2:4:6
-0x0439,8,useitem,2:4
-
-//2008-11-12aRagexeRE
-0x043d,8
-//0x043e,-1
-0x043f,8
-
-//2008-12-17aRagexeRE
-0x01a2,37
-//0x0440,10
-//0x0441,4
-//0x0442,8
-//0x0443,8
-
-//2008-12-17bRagexeRE
-0x006d,114
-
-//2009-01-21aRagexeRE
-0x043f,25
-//0x0444,-1
-//0x0445,10
-
-//2009-02-18aRagexeRE
-//0x0446,14
-
-//2009-02-26cRagexeRE
-//0x0448,-1
-
-//2009-04-01aRagexeRE
-//0x0449,4
-
-//2009-05-14aRagexeRE
-//0x044b,2
-
-//2009-05-20aRagexeRE
-//0x07d0,6
-//0x07d1,2
-//0x07d2,-1
-//0x07d3,4
-//0x07d4,4
-//0x07d5,4
-//0x07d6,4
-//0x0447,2
-
-//2009-06-03aRagexeRE
-0x07d7,8,partychangeoption,2:6:7
-0x07d8,8
-0x07d9,254
-0x07da,6,partychangeleader,2
-
-//2009-06-10aRagexeRE
-//0x07db,8
-
-//2009-06-17aRagexeRE
-0x07d9,268
-//0x07dc,6
-//0x07dd,54
-//0x07de,30
-//0x07df,54
-
-//2009-07-01aRagexeRE
-//0x0275,37
-//0x0276,-1
-
-//2009-07-08aRagexeRE
-//0x07e0,58
-
-//2009-07-15aRagexeRE
-0x07e1,15
-
-//2009-08-05aRagexeRE
-0x07e2,8
-
-//2009-08-18aRagexeRE
-0x07e3,6
-0x07e4,-1,itemlistwindowselected,2:4:8
-0x07e6,8
-
-//2009-08-25aRagexeRE
-//0x07e6,28
-0x07e7,5
-
-//2009-09-22aRagexeRE
-0x07e5,8
-0x07e6,8
-0x07e7,32
-0x07e8,-1
-0x07e9,5
-
-//2009-09-29aRagexeRE
-//0x07ea,2
-//0x07eb,-1
-//0x07ec,6
-//0x07ed,8
-//0x07ee,6
-//0x07ef,8
-//0x07f0,4
-//0x07f2,4
-//0x07f3,3
-
-//2009-10-06aRagexeRE
-//0x07ec,8
-//0x07ed,10
-//0x07f0,8
-//0x07f1,15
-//0x07f2,6
-//0x07f3,4
-//0x07f4,3
-
-//2009-10-27aRagexeRE
-0x07f5,6,gmreqaccname,2
-0x07f6,14
-
-//2009-11-03aRagexeRE
-0x07f7,-1
-0x07f8,-1
-0x07f9,-1
-
-//2009-11-17aRagexeRE
-0x07fa,8
-
-//2009-11-24aRagexeRE
-0x07fb,25
-
-//2009-12-01aRagexeRE
-//0x07fc,10
-//0x07fd,-1
-0x07fe,26
-//0x07ff,-1
-
-//2009-12-15aRagexeRE
-0x0800,-1
-//0x0801,-1
-
-//2009-12-22aRagexeRE
-0x0802,18,bookingregreq,2:4:6 // Booking System
-0x0803,4
-0x0804,8 // Booking System
-0x0805,-1
-0x0806,4,bookingdelreq,2 // Booking System
-//0x0807,2
-0x0808,4 // Booking System
-//0x0809,14
-//0x080A,50
-//0x080B,18
-//0x080C,6
-
-//2009-12-29aRagexeRE
-0x0804,14,bookingsearchreq,2:4:6:8:12 // Booking System
-0x0806,2,bookingdelreq,0 // Booking System
-0x0807,4
-0x0808,14,bookingupdatereq,2 // Booking System
-0x0809,50
-0x080A,18
-0x080B,6 // Booking System
-
-//2010-01-05aRagexeRE
-0x0801,-1,purchasereq2,2:4:8:12
-
-//2010-01-26aRagexeRE
-//0x080C,2
-//0x080D,3
-0x080E,14
-
-//2010-02-09aRagexeRE
-//0x07F0,6
-
-//2010-02-23aRagexeRE
-0x080F,20
-
-//2010-03-03aRagexeRE
-0x0810,3
-0x0811,-1,reqopenbuyingstore,2:4:8:9:89
-//0x0812,86
-//0x0813,6
-//0x0814,6
-//0x0815,-1
-//0x0817,-1
-//0x0818,6
-//0x0819,4
-
-//2010-03-09aRagexeRE
-0x0813,-1
-//0x0814,2
-//0x0815,6
-0x0816,6
-0x0818,-1
-//0x0819,10
-//0x081A,4
-//0x081B,4
-//0x081C,6
-0x081d,22
-0x081e,8
-
-//2010-03-23aRagexeRE
-//0x081F,-1
-
-//2010-04-06aRagexeRE
-//0x081A,6
-
-//2010-04-13aRagexeRE
-//0x081A,10
-0x0820,11
-//0x0821,2
-//0x0822,9
-//0x0823,-1
-
-//2010-04-14dRagexeRE
-//0x081B,8
-
-//2010-04-20aRagexeRE
-0x0812,8
-0x0814,86
-0x0815,2,reqclosebuyingstore,0
-0x0817,6,reqclickbuyingstore,2
-0x0819,-1,reqtradebuyingstore,2:4:8:12
-0x081a,4
-0x081b,10
-0x081c,10
-0x0824,6
-
-//2010-06-01aRagexeRE
-//0x0825,-1
-//0x0826,4
-0x0835,-1,searchstoreinfo,2:4:5:9:13:14:15
-0x0836,-1
-0x0837,3
-//0x0838,3
-
-//2010-06-08aRagexeRE
-0x0838,2,searchstoreinfonextpage,0
-0x083A,4 // Search Stalls Feature
-0x083B,2,closesearchstoreinfo,0
-0x083C,12,searchstoreinfolistitemclick,2:6:10
-0x083D,6
-
-//2010-06-15aRagexeRE
-//0x083E,26
-
-//2010-06-22aRagexeRE
-//0x083F,22
-
-//2010-06-29aRagexeRE
-0x00AA,9
-//0x07F1,18
-//0x07F2,8
-//0x07F3,6
-
-//2010-07-01aRagexeRE
-0x083A,5 // Search Stalls Feature
-
-//2010-07-13aRagexeRE
-//0x0827,6
-//0x0828,14
-//0x0829,6
-//0x082A,10
-//0x082B,6
-//0x082C,14
-//0x0840,-1
-//0x0841,19
-
-//2010-07-14aRagexeRE
-//0x841,4
-
-//2010-08-03aRagexeRE
-0x0839,66
-0x0842,6,recall2,2
-0x0843,6,remove2,2
-
-//2010-11-24aRagexeRE
-packet_ver: 26
-0x0288,-1,cashshopbuy,4:8
-0x0436,19,wanttoconnection,2:6:10:14:18
-0x035f,5,walktoxy,2
-0x0360,6,ticksend,2
-0x0361,5,changedir,2:4
-0x0362,6,takeitem,2
-0x0363,6,dropitem,2:4
-0x0364,8,movetokafra,2:4
-0x0365,8,movefromkafra,2:4
-0x0366,10,useskilltopos,2:4:6:8
-0x0367,90,useskilltoposinfo,2:4:6:8:10
-0x0368,6,getcharnamerequest,2
-0x0369,6,solvecharname,2
-0x0856,-1
-0x0857,-1
-0x0858,-1
-0x0859,-1
-
-//2011-10-05aRagexeRE
-packet_ver: 27
-0x0364,5,walktoxy,2
-0x0817,6,ticksend,2
-0x0366,5,changedir,2:4
-0x0815,6,takeitem,2
-0x0885,6,dropitem,2:4
-0x0893,8,movetokafra,2:4
-0x0897,8,movefromkafra,2:4
-0x0369,10,useskilltopos,2:4:6:8
-0x08ad,90,useskilltoposinfo,2:4:6:8:10
-0x088a,6,getcharnamerequest,2
-0x0838,6,solvecharname,2
-0x0439,8,useitem,2:4
-0x08d2,10
-
-// 2011-11-02aRagexe
-packet_ver: 28
-0x0436,26,friendslistadd,2
-0x0898,5,hommenu,4
-0x0281,36,storagepassword,0
-0x088d,26,partyinvite2,2
-0x083c,19,wanttoconnection,2:6:10:14:18
-0x08aa,7,actionrequest,2:6
-0x02c4,10,useskilltoid,2:4:6
-0x0811,-1,itemlistwindowselected,2:4:8
-0x890,8
-0x08a5,18,bookingregreq,2:4:6
-0x0835,-1,reqopenbuyingstore,2:4:8:9:89
-0x089b,2,reqclosebuyingstore,0
-0x08a1,6,reqclickbuyingstore,2
-0x089e,-1,reqtradebuyingstore,2:4:8:12
-0x08ab,-1,searchstoreinfo,2:4:5:9:13:14:15
-0x088b,2,searchstoreinfonextpage,0
-0x08a2,12,searchstoreinfolistitemclick,2:6:10
-
-//2012-03-07fRagexeRE
-packet_ver:29
-0x086A,19,wanttoconnection,2:6:10:14:18
-0x0437,5,walktoxy,2
-0x0887,6,ticksend,2
-0x0890,5,changedir,2:4
-0x0865,6,takeitem,2
-0x02C4,6,dropitem,2:4
-0x093B,8,movetokafra,2:4
-0x0963,8,movefromkafra,2:4
-0x0438,10,useskilltopos,2:4:6:8
-0x0366,90,useskilltoposinfo,2:4:6:8:10
-0x096A,6,getcharnamerequest,2
-0x0368,6,solvecharname,2
-0x0369,26,friendslistadd,2
-0x0863,5,hommenu,4
-0x0861,36,storagepassword,0
-0x0929,26,partyinvite2,2
-0x0885,7,actionrequest,2:6
-0x0889,10,useskilltoid,2:4:6
-0x0870,-1,itemlistwindowselected,2:4:8
-0x0926,18,bookingregreq,2:4:6
-0x0815,-1,reqopenbuyingstore,2:4:8:9:89
-0x0817,2,reqclosebuyingstore,0
-0x0360,6,reqclickbuyingstore,2
-0x0811,-1,reqtradebuyingstore,2:4:8:12
-0x0884,-1,searchstoreinfo,2:4:5:9:13:14:15
-0x0835,2,searchstoreinfonextpage,0
-0x0838,12,searchstoreinfolistitemclick,2:6:10
-0x0439,8,useitem,2:4
-
-//2012-04-10aRagexeRE
-packet_ver: 30
-0x01FD,15,repairitem,2
-0x089C,26,friendslistadd,2
-0x0885,5,hommenu,2:4
-0x0961,36,storagepassword,0
-0x0288,-1,cashshopbuy,4:8
-0x091C,26,partyinvite2,2
-0x094B,19,wanttoconnection,2:6:10:14:18
-0x0369,7,actionrequest,2:6
-0x083C,10,useskilltoid,2:4:6
-0x0439,8,useitem,2:4
-0x0945,-1,itemlistwindowselected,2:4:8
-0x0815,-1,reqopenbuyingstore,2:4:8:9:89
-0x0817,2,reqclosebuyingstore,0
-0x0360,6,reqclickbuyingstore,2
-0x0811,-1,reqtradebuyingstore,2:4:8:12
-0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15
-0x0835,2,searchstoreinfonextpage,0
-0x0838,12,searchstoreinfolistitemclick,2:6:10
-0x0437,5,walktoxy,2
-0x0886,6,ticksend,2
-0x0871,5,changedir,2:4
-0x0938,6,takeitem,2
-0x0891,6,dropitem,2:4
-0x086C,8,movetokafra,2:4
-0x08A6,8,movefromkafra,2:4
-0x0438,10,useskilltopos,2:4:6:8
-0x0366,90,useskilltoposinfo,2:4:6:8:10
-0x0889,6,getcharnamerequest,2
-0x0884,6,solvecharname,2
-0x08E5,41,bookingregreq,2:4 //Added to prevent disconnections
-0x08E6,4
-0x08E7,10,bookingsearchreq,2
-0x08E8,-1
-0x08E9,2,bookingdelreq,2
-0x08EA,4
-0x08EB,39,bookingupdatereq,2
-0x08EC,73
-0x08ED,43
-0x08EE,6
-0x08EF,6,bookingignorereq,2
-0x08F0,6
-0x08F1,6,bookingjoinpartyreq,2
-0x08F2,36
-0x08F3,-1
-0x08F4,6
-0x08F5,-1,bookingsummonmember,2:4
-0x08F6,22
-0x08F7,3
-0x08F8,7
-0x08F9,6
-0x08FA,6
-0x08FB,6,bookingcanceljoinparty,2
-0x0907,5,moveitem,2:4
-0x0908,5
-0x08D7,28,battlegroundreg,2:4 //Added to prevent disconnections
-0x08CF,10 //Amulet spirits
-0x0977,14 //Monster HP Bar
-
-//2012-04-18aRagexeRE [Special Thanks to Judas!]
-packet_ver: 31
-0x023B,26,friendslistadd,2
-0x0361,5,hommenu,2:4
-0x08A8,36,storagepassword,0
-0x0802,26,partyinvite2,2
-0x022D,19,wanttoconnection,2:6:10:14:18
-0x0281,-1,itemlistwindowselected,2:4:8
-0x035F,6,ticksend,2
-0x0202,5,changedir,2:4
-0x07E4,6,takeitem,2
-0x0362,6,dropitem,2:4
-0x07EC,8,movetokafra,2:4
-0x0364,8,movefromkafra,2:4
-0x096A,6,getcharnamerequest,2
-0x0368,6,solvecharname,2
-0x08E5,41,bookingregreq,2:4 //Added to prevent disconnections
-0x08d2,10
-
-//2012-06-18
-packet_ver: 32
-0x0983,29
-
-// ========== WARNING =============
-// - 2012-07-02 is NOT STABLE.
-// - The packets are kept here for reference, DONT USE THEM.
-//2012-07-02aRagexeRE
-packet_ver: 33
-0x0363,19,wanttoconnection,2:6:10:14:18
-0x0364,6,ticksend,2
-0x085a,7,actionrequest,2:6
-0x0861,8,movefromkafra,2:4
-0x0862,10,useskilltoid,2:4:6
-0x0863,10,useskilltopos,2:4:6:8
-0x0886,6,solvecharname,2
-0x0889,90,useskilltoposinfo,2:4:6:8:10
-0x089e,6,dropitem,2:4
-0x089f,6,takeitem,2
-0x08a0,8,movetokafra,2:4
-0x094a,6,getcharnamerequest,2
-0x0953,5,walktoxy,2
-0x0960,5,changedir,2:4
-
-//2013-03-20Ragexe (Judas)
-packet_ver: 34
-0x01FD,15,repairitem,2
-0x086D,26,friendslistadd,2
-0x0897,5,hommenu,2:4
-0x0947,36,storagepassword,0
-//0x0288,-1,cashshopbuy,4:8
-0x086F,26,partyinvite2,2
-0x0888,19,wanttoconnection,2:6:10:14:18
-0x08c9,4
-0x088E,7,actionrequest,2:6
-0x089B,10,useskilltoid,2:4:6
-0x0881,5,walktoxy,2
-0x0363,6,ticksend,2
-0x093F,5,changedir,2:4
-0x0933,6,takeitem,2
-0x0438,6,dropitem,2:4
-0x08AC,8,movetokafra,2:4
-0x0874,8,movefromkafra,2:4
-0x0959,10,useskilltopos,2:4:6:8
-0x085A,90,useskilltoposinfo,2:4:6:8:10
-0x0898,6,getcharnamerequest,2
-0x094C,6,solvecharname,2
-0x0907,5,moveitem,2:4
-0x0908,5
-0x08CF,10 //Amulet spirits
-0x08d2,10
-0x0977,14 //Monster HP Bar
-0x0998,8,equipitem,2:4
-//0x0281,-1,itemlistwindowselected,2:4:8
-0x0938,-1,reqopenbuyingstore,2:4:8:9:89
-//0x0817,2,reqclosebuyingstore,0
-//0x0360,6,reqclickbuyingstore,2
-0x0922,-1,reqtradebuyingstore,2:4:8:12
-0x094E,-1,searchstoreinfo,2:4:5:9:13:14:15
-//0x0835,2,searchstoreinfonextpage,0
-//0x0838,12,searchstoreinfolistitemclick,2:6:10
-
-//Add new packets here
-//packet_ver: 35
diff --git a/db/pre-re/item_combo_db.txt b/db/pre-re/item_combo_db.txt
index c1eb3c039..f745d25b7 100644
--- a/db/pre-re/item_combo_db.txt
+++ b/db/pre-re/item_combo_db.txt
@@ -9,10 +9,10 @@
1421:2133,{ bonus2 bAddRace,RC_NonBoss,4; bonus2 bAddRace,RC_Boss,4; bonus bDef,2; }
1422:2133,{ bonus2 bAddRace,RC_NonBoss,4; bonus2 bAddRace,RC_Boss,4; bonus bDef,2; }
1428:2115,{ bonus3 bAutoSpellWhenHit,"HP_ASSUMPTIO",2,5; }
-1472:2677,{ bonus bMatkRate,6; bonus bDex,2; bonus bCastrate,-getrefine(); }
-1472:2711,{ bonus bMatkRate,6; bonus bDex,2; bonus bCastrate,-getrefine(); }
-1473:2677,{ bonus bMatkRate,6; bonus bDex,2; bonus bCastrate,-getrefine(); }
-1473:2711,{ bonus bMatkRate,6; bonus bDex,2; bonus bCastrate,-getrefine(); }
+1472:2677,{ bonus bMatkRate,6; bonus bDex,2; bonus bCastrate,-getequiprefinerycnt(EQI_HAND_R); }
+1472:2711,{ bonus bMatkRate,6; bonus bDex,2; bonus bCastrate,-getequiprefinerycnt(EQI_HAND_R); }
+1473:2677,{ bonus bMatkRate,6; bonus bDex,2; bonus bCastrate,-getequiprefinerycnt(EQI_HAND_R); }
+1473:2711,{ bonus bMatkRate,6; bonus bDex,2; bonus bCastrate,-getequiprefinerycnt(EQI_HAND_R); }
1474:2527,{ bonus2 bAddRace,RC_Dragon,5; }
1477:2700,{ bonus2 bResEff,Eff_Confusion,9500; }
1479:2700,{ bonus2 bResEff,Eff_Confusion,9500; }
@@ -23,11 +23,11 @@
1573:2716:2717,{ bonus bInt,5; bonus bMaxHP,700; bonus bAspdRate,5; }
1615:18539,{ bonus bMatk,10*getequiprefinerycnt(EQI_HAND_R); bonus bCastRate,-10; }
1616:2515,{ bonus bSpeedRate,25; }
-1618:2509,{ bonus bMaxHP,300; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R)-5; bonus2 bSubEle,Ele_Neutral,getrefine()*3; }
+1618:2509,{ bonus bMaxHP,300; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R)-5; bonus2 bSubEle,Ele_Neutral,getequiprefinerycnt(EQI_HAND_R)*3; }
1618:2535,{ bonus bMatkRate,5; bonus2 bSubEle,Ele_Neutral,25; }
-1620:2509,{ bonus bMaxHP,300; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R)-5; bonus2 bSubEle,Ele_Neutral,getrefine()*3; }
+1620:2509,{ bonus bMaxHP,300; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R)-5; bonus2 bSubEle,Ele_Neutral,getequiprefinerycnt(EQI_HAND_R)*3; }
1620:2535,{ bonus bMatkRate,5; bonus2 bSubEle,Ele_Neutral,25; }
-1629:5045,{ bonus bDex,2; bonus bInt,2; bonus bSPrecovRate,5; bonus bMatkRate,getrefine(); }
+1629:5045,{ bonus bDex,2; bonus bInt,2; bonus bSPrecovRate,5; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R); }
1631:2129,{ bonus2 bSkillAtk,"PR_MAGNUS",20; bonus3 bAutoSpellWhenHit,"PR_TURNUNDEAD",1,20; }
1636:18539,{ bonus bMatk,10*getequiprefinerycnt(EQI_HAND_R); bonus bCastRate,-10; }
1723:2718,{ bonus bDex,1; bonus bMaxSP,50; bonus bSPrecovRate,10; }
diff --git a/db/pre-re/item_db.txt b/db/pre-re/item_db.txt
index 633222feb..f996dcf1d 100644
--- a/db/pre-re/item_db.txt
+++ b/db/pre-re/item_db.txt
@@ -616,7 +616,7 @@
1271,Blood_Tears,Blood Tears,4,20,,1700,120,,1,2,0x00001000,2,2,34,4,55,1,16,{ if(getrefine()>=9){ bonus3 bAutoSpell,"NPC_WIDEBLEEDING",2,30; } else bonus3 bAutoSpell,"NPC_WIDEBLEEDING",1,30; },{},{}
1272,Scratcher,Scratcher,4,20,,0,120,,1,0,0x00001000,7,2,34,1,0,0,16,{ bonus2 bAddRace,RC_Boss,50; bonus2 bAddRace,RC_NonBoss,50; },{},{}
1273,Bloody_Roar_C,Refined Bloody Roar,4,1,,0,148,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bIgnoreDefRace,RC_DemiHuman; bonus bFlee,-160; bonus bFlee2,-160; },{},{}
-1274,Unholy_Touch_C,Refined Unholy Touch,4,1,,0,179,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Curse,500; bonus bCritical,-1; bonus bUnbreakableWeapon,0; },{},{}
+1274,Unholy_Touch_C,Refined Unholy Touch,4,1,,0,179,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Curse,5000; bonus bCritical,-1; bonus bUnbreakableWeapon,0; },{},{}
1275,Katar_Of_Cold_Icicle_,Katar of Frozen Icicle,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Water; bonus2 bAddEff,Eff_Freeze,500; },{},{}
1276,Katar_Of_Thornbush_,Katar of Quaking,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Earth; bonus2 bAddEff,Eff_Blind,500; },{},{}
1277,Katar_Of_Raging_Blaze_,Katar of Raging Blaze,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Fire; bonus2 bAddEff,Eff_Silence,500; },{},{}
@@ -673,7 +673,7 @@
1375,Berdysz,Berdysz,4,20,,2500,200,,1,2,0x000444A2,2,2,34,3,70,1,7,{ bonus2 bSubSize,Size_Medium,13; bonus2 bSubSize,Size_Large,15; },{},{}
1376,Heart_Breaker,Heart Breaker,4,20,,2000,175,,1,1,0x000444A2,2,2,34,4,70,1,7,{ bonus bCritical,20+getrefine(); bonus bAspdRate,5; if((Class==Job_Whitesmith)||(Class==Job_Creator)) bonus3 bAutoSpell,"BS_HAMMERFALL",3,30; },{},{}
1377,Hurricane_Fury,Hurricane's Fury,4,20,,3500,332,,1,1,0x000444A2,2,2,34,4,80,1,7,{ bonus2 bSubSize,Size_Medium,10+getrefine(); bonus bAspdRate,getrefine(); bonus3 bAutoSpell,"NPC_PULSESTRIKE",5,20; },{},{}
-1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,1500; },{},{}
+1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,2000; },{},{}
1379,BF_Two_Handed_Axe1,Valorous Insane Battle Axe,4,20,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
1380,BF_Two_Handed_Axe2,Brave Insane Battle Axe,4,20,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; autobonus "{ bonus bBreakArmorRate,10000; }",20,3000,BF_WEAPON,"{ specialeffect2 EF_POTION_BERSERK; }"; bonus bUnbreakableWeapon,0; },{},{}
1381,N_Battle_Axe,Novice Battle Axe,4,0,,0,100,,1,3,0x000444A2,7,2,34,1,3,0,7,{},{},{}
@@ -1551,7 +1551,7 @@
2730,Morroc_Seal,Seal of Continental Guard,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bMaxHP,50; bonus bAspdRate,3; },{},{}
2731,Morroc_Charm_Stone,Rune Spellstone,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bMaxSP,50; bonus bCastRate,-1; },{},{}
2732,Morroc_Ring,Death Loop,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bCritical,5; },{},{}
-2733,Medal_Gunner,Sheriff Badge,5,20,,0,,1,,0,0x01000000,7,2,136,,70,0,0,{ bonus2 bAddRace,RC_NonBoss,5; bonus2 bAddRace,RC_Boss,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,1000,ATF_LONG; },{},{}
+2733,Medal_Gunner,Sheriff Badge,5,20,,0,,1,,0,0x01000000,7,2,136,,70,0,0,{ bonus2 bAddRace,RC_NonBoss,5; bonus2 bAddRace,RC_Boss,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,100,ATF_LONG; },{},{}
2734,Directive_A,Directive,5,0,,0,,1,,0,0x00000001,7,2,136,,0,0,0,{},{},{}
2735,Directive_B,Directive,5,0,,0,,1,,0,0x00000001,7,2,136,,0,0,0,{},{},{}
2736,Navel_Ring,Navel Ring,5,20,,100,,0,,0,0xFFFFFFFE,7,2,136,,75,0,0,{ bonus bDex,3; bonus bLuk,3; bonus bMdef,2; },{},{}
@@ -2543,7 +2543,7 @@
5373,Darkness_Helm,Dark Randgris Helm,5,20,,300,,2,,1,0xFFFFFFFF,7,2,768,,0,1,379,{ bonus bDex,3; bonus bMdef,1; },{},{}
5374,L_Magestic_Goat,Gigantic Majestic Goat,5,20,,800,,5,,0,0xFFFFFFFF,7,2,256,,0,1,380,{ bonus2 bAddRace,RC_DemiHuman,12; bonus bBaseAtk,(JobLevel*2)/7; },{},{}
5375,L_Orc_Hero_Helm,Orc Hero Headdress,5,20,,900,,5,,1,0xFFFFFFFF,7,2,768,,0,1,381,{ bonus bStr,2; bonus3 bAutoSpellWhenHit,"BS_WEAPONPERFECT",3,10; },{},{}
-5376,Satanic_Chain_P,Flying Evil Wing,5,20,,100,,3,,1,0xFFFFFFFF,7,2,256,,0,1,382,{ bonus bMaxSP,120; bonus3 bAddEffWhenHit,Eff_Curse,100,ATF_SELF; },{},{}
+5376,Satanic_Chain_P,Flying Evil Wing,5,20,,100,,3,,1,0xFFFFFFFF,7,2,256,,0,1,382,{ bonus bMaxSP,120; bonus2 bAddEff2,Eff_Curse,300; },{},{}
5377,Antique_Pipe,Gentleman's Pipe,5,20,,100,,0,,0,0xFFFFFFFF,7,2,1,,0,0,383,{ bonus2 bSubRace,RC_DemiHuman,2; },{},{}
5378,Rabbit_Ear_Hat,Bunny Top Hat,5,20,,300,,0,,0,0xFFFFFFFF,7,2,256,,0,1,384,{ bonus bAgi,3; bonus3 bAutoSpellWhenHit,"AL_INCAGI",5,10; },{},{}
5379,Balloon_Hat,Tam,5,0,,800,,3,,1,0xFFFFFFFF,7,2,256,,50,1,385,{ bonus bMdef,2; bonus bMatkRate,2+(getrefine()/2); },{},{}
@@ -4765,7 +4765,7 @@
12217,Aspersio_5_Scroll,LV5 Aspersio Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(countitem(523)>0) { skilleffect "PR_ASPERSIO",0; sc_start SC_ASPERSIO,180000,5; delitem 523,1; } },{},{}
12218,Assumptio_5_Scroll,LV5 Assumptio Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ skilleffect "HP_ASSUMPTIO",0; sc_start SC_ASSUMPTIO,100000,5; },{},{}
12219,Wind_Walk_10_Scroll,LV10 Wind Walker Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ skilleffect "SN_WINDWALK",0; sc_start SC_WINDWALK,250000,5; },{},{}
-12220,Adrenaline_Scroll,LV5 Adrenaline Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(getiteminfo(getequipid(EQI_HAND_R),14)==6||getiteminfo(getequipid(EQI_HAND_R),14)==7) { skilleffect "BS_ADRENALINE",0; sc_start SC_ADRENALINE,150000,5; } },{},{}
+12220,Adrenaline_Scroll,LV5 Adrenaline Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ set .@type,getiteminfo(getequipid(EQI_HAND_R),11); if (.@type==6||.@type==7||.@type==8) { skilleffect "BS_ADRENALINE",0; sc_start SC_ADRENALINE,150000,5; } },{},{}
12221,Megaphone_,Megaphone,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ input @megaphone$; announce strcharinfo(0) + ": " + @megaphone$,bc_all,0xFF0000; end; },{},{}
12225,Sweet_Candy_Striper,Sweet Candy Cane,2,20,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ pet 1245; },{},{}
12226,Examination1,Examination 1,0,20,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_SpeedUp0,5400000,0; percentheal 100,100; sc_start SC_STRFOOD,5400000,10; sc_start SC_DEXFOOD,5400000,5; sc_start SC_ATKPOTION,5400000,22; sc_start SC_MATKFOOD,5400000,15; },{},{}
diff --git a/db/pre-re/item_trade.txt b/db/pre-re/item_trade.txt
index b5fedbd62..84b0220f5 100644
--- a/db/pre-re/item_trade.txt
+++ b/db/pre-re/item_trade.txt
@@ -1,6 +1,6 @@
//Item Trading Restrictions File
//Specify here special rules for item trading.
-//Item ID, TradeMask, GM-Level Override
+//Item ID, TradeMask, Group-Level Override
//Trading mask values:
//1:Item can't be droped
//2:Item can't be traded (nor vended)
@@ -13,7 +13,7 @@
//256:Item can't be auctioned
//Example:
//1161,67,50 //Balmung: No drop, No trade, No Guild Store (1+2+64 =67),
-//only GMs of GM-level 50 and up can override the setting.
+//only groups of group-level 50 and up can override the setting.
// Wedding Related items
2634,507,100 // Wedding Ring
diff --git a/db/pre-re/map_zone_db.conf b/db/pre-re/map_zone_db.conf
index 36689ac57..6fb18084b 100644
--- a/db/pre-re/map_zone_db.conf
+++ b/db/pre-re/map_zone_db.conf
@@ -16,11 +16,42 @@
//= maps can be linked to a specific zone through the zone mapflag
//= '<map name><tab>mapflag<tab>zone<tab><zone name>'
//== available types for 'disabled_skills':
-//= PLAYER, HOMUN, MERCENARY, MONSTER, ALL and NONE
+//= PLAYER, HOMUN, MERCENARY, MONSTER, PET, ELEMENTAL, ALL and NONE
//== More on
//= http://hercules.ws/board/topic/302-introducing-hercules-map-zone-database/
+//= (TODO: replace with wiki link and detail the wiki page in a decent format ^)
zones: (
{
+ /* All zone is a dynamic (very special) zone that is forcebly inherited by ALL maps automatically */
+ name: "All" /* changing this name requires MAP_ZONE_ALL_NAME to also be changed in src/map/map.h file */
+
+ disabled_skills: {
+ //both examples below disable napalm beat (id 11) to players
+ //MG_NAPALMBEAT: "PLAYER"
+ //ID11: "PLAYER"
+ }
+
+ disabled_items: {
+ //Both examples below disable apple (id 501)
+ //Apple: true
+ //ID501: true
+ }
+
+ mapflags: ( )
+
+ /* "command:min-group-lv-to-override" e.g. "heal: 70" */
+ disabled_commands: {
+ //Example Below makes @heal be used in maps within this zone only by those group lv 70 and above
+ //heal: 70
+ }
+ skill_damage_cap: {
+ //Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage,
+ // (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h)
+ // to players and monsters.
+ //MG_FIREBOLT: (50,"PLAYER | MONSTER")
+ }
+},
+{
/* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */
/* However, it wont be applied to maps with its own zones (specified thru mapflag) */
name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */
@@ -37,6 +68,7 @@ zones: (
}
mapflags: ( )
+
},
{
/* PvP zone is applied to all maps with a pvp mapflag */
diff --git a/db/pre-re/skill_db.txt b/db/pre-re/skill_db.txt
index 806bb4d11..df52ec439 100644
--- a/db/pre-re/skill_db.txt
+++ b/db/pre-re/skill_db.txt
@@ -38,7 +38,6 @@
// 0x1000- disable usage on enemies (for non-offensive skills).
// 0x2000- skill ignores land protector (e.g. arrow shower)
// 0x4000- chorus skill
-// 0x8000- skill wont be passed to clones
// 13 maxcount: max amount of skill instances to place on the ground when
// player_land_skill_limit/monster_land_skill_limit is enabled. For skills
// that attack using a path, this is the path length to be used.
diff --git a/db/quest_db.txt b/db/quest_db.txt
index 3e2e53b00..dc3b87d2d 100644
--- a/db/quest_db.txt
+++ b/db/quest_db.txt
@@ -41,7 +41,7 @@
1149,0,0,0,0,0,0,0,"Help the poor cat"
1150,0,0,0,0,0,0,0,"Help the poor cat"
1151,0,0,0,0,0,0,0,"Help the poor cat"
-1152,86400,0,0,0,0,0,0,"Help the poor cat"
+1152,82800,0,0,0,0,0,0,"Help the poor cat"
1153,0,0,0,0,0,0,0,"Help the poor cat"
1154,0,2197,20,0,0,0,0,"Help the poor cat"
1155,0,0,0,0,0,0,0,"Help the poor cat"
@@ -465,6 +465,14 @@
4134,0,0,0,0,0,0,0,"Iara"
4135,86400,0,0,0,0,0,0,"Iara"
+4154,0,0,0,0,0,0,0,"Homunculus Researcher"
+4155,0,0,0,0,0,0,0,"Homunculus S Mutation Mission - 1"
+4156,0,0,0,0,0,0,0,"Homunculus S Mutation Mission - 2"
+4157,0,0,0,0,0,0,0,"Homunculus S Mutation Mission - 3"
+4158,0,0,0,0,0,0,0,"Homunculus S Mutation Mission - 4"
+4159,0,0,0,0,0,0,0,"Homunculus S Mutation Mission - 5"
+4160,0,0,0,0,0,0,0,"Homunculus S Mutation Mission - 6"
+
// Paradise 86 - 90 [Chilly]
4167,0,1321,30,0,0,0,0,"Paradise: Dragon Tail Handling"
4168,0,1322,30,0,0,0,0,"Paradise: Spring Rabbit Handling"
@@ -539,32 +547,42 @@
5052,0,0,0,0,0,0,0,"Traditional Weapon"
5053,0,0,0,0,0,0,0,"Traditional Weapon"
5054,0,0,0,0,0,0,0,"Traditional Weapon"
-5058,0,0,0,0,0,0,0,"State of mind-(1)"
-5059,0,0,0,0,0,0,0,"State of mind-(1)"
+
+5058,0,0,0,0,0,0,0,"The mood of the players-(1)"
+5059,0,0,0,0,0,0,0,"The mood of the players-(2)"
5060,180,0,0,0,0,0,0,"Cat Shock"
-5061,0,0,0,0,0,0,0,"State of mind-(1)"
-5062,0,0,0,0,0,0,0,"State of mind-(1)"
-5063,0,0,0,0,0,0,0,"State of mind-(1)"
-5064,0,0,0,0,0,0,0,"State of mind-(1)"
-5065,0,0,0,0,0,0,0,"State of mind-(1)"
-5066,0,0,0,0,0,0,0,"State of mind-(1)"
-5067,0,0,0,0,0,0,0,"State of mind-(1)"
-5068,72000,0,0,0,0,0,0,"State of mind-(1)"
-5069,3600,0,0,0,0,0,0,"State of mind-(1)"
+5061,0,0,0,0,0,0,0,"Am I scared?"
+5062,0,0,0,0,0,0,0,"I met Eryu."
+5063,0,0,0,0,0,0,0,"I met Stew."
+5064,0,0,0,0,0,0,0,"I met Ketchup."
+5065,0,0,0,0,0,0,0,"I met Eff."
+5066,0,0,0,0,0,0,0,"Scary image-(1)"
+5067,0,0,0,0,0,0,0,"Scary image-(2)"
+5068,72000,0,0,0,0,0,0,"Collecting complaint"
+5069,3600,0,0,0,0,0,0,"Token of honor"
5070,86400,0,0,0,0,0,0,"Rock Paper Scissors"
5071,86400,0,0,0,0,0,0,"Chamchamcham"
5072,86400,0,0,0,0,0,0,"Kkongnyangkkong"
-5073,86400,0,0,0,0,0,0,"Sub Quest Games"
-5074,0,0,0,0,0,0,0,"Sub Quest Games"
-5075,0,0,0,0,0,0,0,"Sub Quest Games"
-5076,0,1282,30,0,0,0,0,"Sub Quest Games"
-5077,0,1209,10,0,0,0,0,"Sub Quest Games"
-5078,0,1019,50,0,0,0,0,"Sub Quest Games"
-5079,0,0,0,0,0,0,0,"Sub Quest Games"
-5080,0,0,0,0,0,0,0,"Sub Quest Games"
-5081,0,0,0,0,0,0,0,"Sub Quest Games"
-5082,0,0,0,0,0,0,0,"Sub Quest Games"
-5091,0,0,0,0,0,0,0,"Malang Road"
+5073,86400,0,0,0,0,0,0,"Challenging of flag wave"
+5074,0,1158,30,0,0,0,0,"Cat's Meal"
+5075,0,1144,50,0,0,0,0,"Health food"
+5076,0,1282,30,0,0,0,0,"Enemies"
+5077,0,1209,10,0,0,0,0,"Reaction Training"
+5078,0,1019,50,0,0,0,0,"Light bird food"
+5079,0,0,0,0,0,0,0,"How to stabilize the mind"
+5080,0,0,0,0,0,0,0,"Lack of Snack"
+5081,0,0,0,0,0,0,0,"Banned foods"
+5082,0,0,0,0,0,0,0,"Cool food"
+5083,0,0,0,0,0,0,0,"Please come back Eryu-(1)"
+5084,0,0,0,0,0,0,0,"Please come back Eryu-(2)"
+5085,0,0,0,0,0,0,0,"Please come back Stew-(1)"
+5086,0,0,0,0,0,0,0,"Please come back Stew-(2)"
+5087,0,0,0,0,0,0,0,"Please come back Ketchup-(1)"
+5088,0,0,0,0,0,0,0,"Please come back Ketchup-(2)"
+5089,0,0,0,0,0,0,0,"Please come back Eff-(1)"
+5090,0,0,0,0,0,0,0,"Please come back Eff-(2)"
+5091,0,0,0,0,0,0,0,"Go Malangdo"
+
5092,0,0,0,0,0,0,0,"Unlocking the Ultimate Mediocrity"
5093,0,0,0,0,0,0,0,"Unlocking the Ultimate Mediocrity"
5094,0,1002,1000,0,0,0,0,"Unlocking the Ultimate Mediocrity"
@@ -574,6 +592,7 @@
5098,0,0,0,0,0,0,0,"Unlocking the Ultimate Mediocrity"
5099,0,0,0,0,0,0,0,"Unlocking the Ultimate Mediocrity"
5100,0,0,0,0,0,0,0,"Unlocking the Ultimate Mediocrity"
+
5109,0,0,0,0,0,0,0,"Light but Unconfirmed Rumor"
5110,0,0,0,0,0,0,0,"The Rumored Character"
5111,0,0,0,0,0,0,0,"To the Lab..."
@@ -870,16 +889,33 @@
7239,0,0,0,0,0,0,0,"Toren's Errands (Normal)"
7240,0,0,0,0,0,0,0,"Strengthening Equipment"
7241,86400,0,0,0,0,0,0,"Toren's Errands - Tomorrow"
-
-7260,0,0,0,0,0,0,0,"Occurrence of insect origin"
+7242,0,0,0,0,0,0,0,"Play with the baby cat"
+7243,0,0,0,0,0,0,0,"Nyadventure-Duruduru Compass"
+7244,180,0,0,0,0,0,0,"Nyadventure-Duruduru Race"
+7245,180,0,0,0,0,0,0,"Nyadventure-Duruduru Race"
+7246,0,0,0,0,0,0,0,"Nyadventure-I'm coming now."
+7247,0,0,0,0,0,0,0,"Nyadventure-Stop the Bang!"
+//7248,0,0,0,0,0,0,0,""
+7249,86400,0,0,0,0,0,0,"Nyadventure-Bang! See you next time"
+7250,0,0,0,0,0,0,0,"Nyadventure-Hidden Treasure?"
+7251,0,0,0,0,0,0,0,"Nyadventure-The First piece of Painting"
+7252,0,0,0,0,0,0,0,"Nyadventure-The Second piece of Painting"
+7253,0,0,0,0,0,0,0,"Nyadventure-The Third piece of Painting"
+7254,0,0,0,0,0,0,0,"Nyadventure-The Fourth piece of Painting"
+7255,0,0,0,0,0,0,0,"Nyadventure-The Fifth piece of Painting"
+7256,0,0,0,0,0,0,0,"Nyadventure-The Sixth piece of Painting"
+7257,86400,0,0,0,0,0,0,"Nyadventure-Race, Come back tomorrow!"
+7258,0,0,0,0,0,0,0,"Nyadventure-Painting completed"
+7259,0,0,0,0,0,0,0,"Gift from the Mew Bravery Team"
+7260,0,0,0,0,0,0,0,"The origin of Bugs"
7261,0,0,0,0,0,0,0,"Cat Biscuits - Table"
7262,0,0,0,0,0,0,0,"Cat Biscuits - Mattress"
7263,0,0,0,0,0,0,0,"Cat Biscuits - Grill"
-7264,0,0,0,0,0,0,0,"Cat Chef"
-7265,0,0,0,0,0,0,0,"Cat Chef Anger"
-7266,0,0,0,0,0,0,0,"Cat Chef Intentions"
-7267,86400,0,0,0,0,0,0,"Cleanyang's meow and appointment time"
-7268,0,0,0,0,0,0,0,"Find the cat biscuits!"
+7264,0,0,0,0,0,0,0,"To Chef Nyas"
+7265,0,0,0,0,0,0,0,"Rage of Chef Nyas"
+7266,0,0,0,0,0,0,0,"Declaration of Chef Nyas"
+7267,86400,0,0,0,0,0,0,"Appointed time with Cleanyang"
+7268,0,0,0,0,0,0,0,"Find the Cat's hard biscuits!"
7269,0,0,0,0,0,0,0,"Cat Biscuits - Resting Place"
7270,0,0,0,0,0,0,0,"Cat Biscuits - Sand"
7271,0,0,0,0,0,0,0,"Cat Biscuits - Bottom of the Stairs"
@@ -887,7 +923,7 @@
7273,0,0,0,0,0,0,0,"Cat Biscuits - Locker"
7274,0,0,0,0,0,0,0,"Cat Biscuits - Foothold"
7275,0,0,0,0,0,0,0,"Cat Biscuits - Sand"
-7276,86400,0,0,0,0,0,0,"Food delivery promise"
+7276,86400,0,0,0,0,0,0,"Promise to deliver more food"
7281,0,0,0,0,0,0,0,"List of Errands"
7282,0,0,0,0,0,0,0,"List of Errands"
7283,0,0,0,0,0,0,0,"List of Errands"
@@ -1710,11 +1746,13 @@
11236,0,0,0,0,0,0,0,"Repair of cracks"
11237,0,0,0,0,0,0,0,"Repair of cracks"
11238,0,0,0,0,0,0,0,"Malangdo Fruits"
-11239,86400,0,0,0,0,0,0,"Malangdo Fruits"
+11239,82800,0,0,0,0,0,0,"Malangdo Fruits"
11240,0,0,0,0,0,0,0,"Repair of cracks"
11241,0,0,0,0,0,0,0,"Repair of cracks"
11242,0,0,0,0,0,0,0,"Repair of cracks"
-11243,86400,0,0,0,0,0,0,"Repair of cracks"
+11243,82800,0,0,0,0,0,0,"Repair of cracks"
+11244,0,0,0,0,0,0,0,"Soft Jelly"
+11245,82800,0,0,0,0,0,0,"Soft Jelly"
11284,0,0,0,0,0,0,0,"Nurse at Port Malaya-1"
11285,0,0,0,0,0,0,0,"Nurse at Port Malaya-2"
@@ -1807,7 +1845,7 @@
12061,10,0,0,0,0,0,0,"Concentration"
12062,86400,0,0,0,0,0,0,"Today's Mining Closed"
12070,14400,0,0,0,0,0,0,"Limited time for enter"
-
+12071,86400,0,0,0,0,0,0,"Stamp a seal on the attendance book"
12072,0,1034,20,0,0,0,0,"Hunt tharafrog"
12073,0,1248,15,0,0,0,0,"Remove Cruiser"
12074,0,1070,30,0,0,0,0,"Remove Kukre"
@@ -1986,6 +2024,29 @@
12252,0,0,0,0,0,0,0,"Missing Information on Tuale"
12253,82800,0,0,0,0,0,0,"Missing Person Search Time Limit"
+// Malangdo Culverts
+12254,3600,0,0,0,0,0,0,"Now it's cleaning"
+12255,0,2176,20,0,0,0,0,"Hunt deep sea crab"
+12256,0,2175,20,0,0,0,0,"Hunt deep sea squid"
+12257,0,2174,20,0,0,0,0,"Hunt Ancient crustacean"
+12258,0,2178,20,0,0,0,0,"Hunt deep sea shell"
+12259,0,2179,20,0,0,0,0,"Hunt ancient kukre"
+12260,0,2177,20,0,0,0,0,"Hunt deep sea conch"
+12261,0,2182,30,0,0,0,0,"Hunt deep sea horse"
+12262,0,2181,30,0,0,0,0,"Hunt ancient sword fish"
+12263,0,2180,30,0,0,0,0,"Hunt ancient sea god"
+12264,0,2183,30,0,0,0,0,"Hunt mutation anolian"
+12265,0,2184,30,0,0,0,0,"Hunt deep sea mermaid"
+12266,0,2185,30,0,0,0,0,"Hunt transformable kapha"
+12267,0,2188,1,0,0,0,0,"Hunt weird coelacanth"
+12268,0,2187,1,0,0,0,0,"Hunt dark coelacanth"
+12269,0,2190,1,0,0,0,0,"Hunt Cruel coelacanth"
+12270,0,2189,1,0,0,0,0,"Hunt mutation coelacanth"
+12271,82800,0,0,0,0,0,0,"In progress general culvert single day service"
+12272,82800,0,0,0,0,0,0,"In progress hard culvert single day service"
+12273,579600,0,0,0,0,0,0,"In progress general culvert weekly service"
+12274,579600,0,0,0,0,0,0,"In progress hard culvert weekly service"
+
12278,0,0,0,0,0,0,0,"Towards Bakonawa Lake..."
12279,0,0,0,0,0,0,0,"Get Rid of Bakonawa"
@@ -2468,4 +2529,4 @@
60352,0,0,0,0,0,0,0,"Bathroom Ghost"
60353,0,0,0,0,0,0,0,"Bathroom Ghost"
60354,0,0,0,0,0,0,0,"Bathroom Ghost"
-60355,0,0,0,0,0,0,0,"Bathroom Ghost" \ No newline at end of file
+60355,0,0,0,0,0,0,0,"Bathroom Ghost"
diff --git a/db/re/item_combo_db.txt b/db/re/item_combo_db.txt
index d921689c3..26b955d9b 100644
--- a/db/re/item_combo_db.txt
+++ b/db/re/item_combo_db.txt
@@ -12,10 +12,10 @@
1422:2133,{ bonus2 bAddRace,RC_NonBoss,4; bonus2 bAddRace,RC_Boss,4; bonus bDef,2; }
1428:2115,{ bonus3 bAutoSpellWhenHit,"HP_ASSUMPTIO",2,5; }
1433:2153,{ bonus2 bSkillAtk,"CR_GRANDCROSS",10; bonus2 bSkillAtk,"LG_RAYOFGENESIS",10; }
-1472:2677,{ bonus bMatkRate,6; bonus bDex,2; bonus bVariableCastrate,-getrefine(); }
-1472:2711,{ bonus bMatkRate,6; bonus bDex,2; bonus bVariableCastrate,-getrefine(); }
-1473:2677,{ bonus bMatkRate,6; bonus bDex,2; bonus bVariableCastrate,-getrefine(); }
-1473:2711,{ bonus bMatkRate,6; bonus bDex,2; bonus bVariableCastrate,-getrefine(); }
+1472:2677,{ bonus bMatkRate,6; bonus bDex,2; bonus bVariableCastrate,-getequiprefinerycnt(EQI_HAND_R); }
+1472:2711,{ bonus bMatkRate,6; bonus bDex,2; bonus bVariableCastrate,-getequiprefinerycnt(EQI_HAND_R); }
+1473:2677,{ bonus bMatkRate,6; bonus bDex,2; bonus bVariableCastrate,-getequiprefinerycnt(EQI_HAND_R); }
+1473:2711,{ bonus bMatkRate,6; bonus bDex,2; bonus bVariableCastrate,-getequiprefinerycnt(EQI_HAND_R); }
1474:2527,{ bonus2 bAddRace,RC_Dragon,5; }
1477:2700,{ bonus2 bResEff,Eff_Confusion,9500; }
1479:2700,{ bonus2 bResEff,Eff_Confusion,9500; }
@@ -26,11 +26,11 @@
1573:2716:2717,{ bonus bInt,5; bonus bMaxHP,700; bonus bAspdRate,5; }
1615:18539,{ bonus bMatk,10*getequiprefinerycnt(EQI_HAND_R); bonus bVariableCastrate,-10; }
1616:2515,{ bonus bSpeedRate,25; }
-1618:2509,{ bonus bMaxHP,300; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R)-5; bonus2 bSubEle,Ele_Neutral,getrefine()*3; }
+1618:2509,{ bonus bMaxHP,300; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R)-5; bonus2 bSubEle,Ele_Neutral,getequiprefinerycnt(EQI_HAND_R)*3; }
1618:2535,{ bonus bMatkRate,5; bonus2 bSubEle,Ele_Neutral,25; }
-1620:2509,{ bonus bMaxHP,300; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R)-5; bonus2 bSubEle,Ele_Neutral,getrefine()*3; }
+1620:2509,{ bonus bMaxHP,300; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R)-5; bonus2 bSubEle,Ele_Neutral,getequiprefinerycnt(EQI_HAND_R)*3; }
1620:2535,{ bonus bMatkRate,5; bonus2 bSubEle,Ele_Neutral,25; }
-1629:5045,{ bonus bDex,2; bonus bInt,2; bonus bSPrecovRate,5; bonus bMatkRate,getrefine(); }
+1629:5045,{ bonus bDex,2; bonus bInt,2; bonus bSPrecovRate,5; bonus bMatkRate,getequiprefinerycnt(EQI_HAND_R); }
1631:2129,{ bonus2 bSkillAtk,"PR_MAGNUS",20; bonus3 bAutoSpellWhenHit,"PR_TURNUNDEAD",1,20; }
1636:18539,{ bonus bMatk,10*getequiprefinerycnt(EQI_HAND_R); bonus bVariableCastrate,-10; }
1657:2471:2569:15029,{ bonus bHealPower,25; }
diff --git a/db/re/item_db.txt b/db/re/item_db.txt
index 49a80d28e..de07386a4 100644
--- a/db/re/item_db.txt
+++ b/db/re/item_db.txt
@@ -540,7 +540,7 @@
1181,Tae_Goo_Lyeon,Tae Goo Lyeon,4,20,,2000,250,,1,2,0x00004082,2,2,34,4,90,1,3,{ bonus bFlee2,10; if(JobLevel>=70) autobonus "{ bonus bBaseAtk,50; }",10,10000,BF_WEAPON,"{ specialeffect2 EF_POTION_BERSERK; }"; if(getrefine()>8) { bonus bVariableCastrate,-20; bonus bDelayRate,-20; } },{},{}
1182,Bloody_Eater,Bloody Eater,4,20,,1200,200,,1,2,0x00004082,7,2,34,4,50,1,3,{ bonus bAtkEle,Ele_Ghost; autobonus "{ bonus bCritical,100; bonus bBaseAtk,50; }",1,5000,0,"{ specialeffect2 EF_FIRESPLASHHIT; }"; bonus bHPGainValue,100; },{},{}
1183,BF_Two_Handed_Sword1,Brave Assaulter's Katzbalger,4,20,,0,200,,1,0,0x00004082,7,2,34,3,80,1,3,{ bonus bStr,2; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
-1184,BF_Two_Handed_Sword2,Valorous Assaulter's Katzbalger,4,20,,0,200,,1,0,0x00004082,7,2,34,3,80,1,3,{ bonus2 bAddRace,RC_DemiHuman,55; bonus bCritAtkRate,20; bonus bUnbreakableWeapon,0; },{},{}
+1184,BF_Two_Handed_Sword2,Valorous Assaulter's Katzbalger,4,20,,0,200,,1,0,0x00004082,7,2,34,3,80,1,3,{ bonus bCritical,20; bonus2 bAddRace,RC_DemiHuman,55; bonus bCritAtkRate,20; bonus bUnbreakableWeapon,0; },{},{}
1185,Violet_Fear,Violet Fear,4,20,,2200,275,,1,2,0x00004082,2,2,34,4,80,1,3,{ bonus3 bAutoSpell,"WZ_METEOR",3,30; bonus3 bAutoSpell,"WZ_FROSTNOVA",5,50; autobonus "{ bonus bIgnoreDefRace,RC_NonBoss; }",50,5000; },{},{}
1186,Death_Guidance,Death Guidance,4,20,,2000,200,,1,2,0x00004082,2,2,34,4,70,1,3,{ bonus bStr,5; bonus bAgi,2; bonus bFlee2,20; bonus3 bAutoSpell,"NPC_HELLPOWER",1,10; bonus4 bAutoSpell,"NPC_HELLPOWER",1,10,0; if( getrefine()>8 ) bonus3 bAutoSpell,"NPC_VAMPIRE_GIFT",2,20; else bonus3 bAutoSpell,"NPC_VAMPIRE_GIFT",1,20; },{},{}
1187,Krieger_Twohand_Sword1,Glorious Claymore,4,20,,0,220,,1,0,0x00004082,7,2,34,4,80,1,3,{ bonus2 bAddRace,RC_DemiHuman,70; bonus2 bIgnoreDefRate,RC_DemiHuman,25; bonus bUnbreakableWeapon,0; if(getrefine()>5) { bonus2 bAddRace,RC_DemiHuman,pow(((getrefine()>14)?14:getrefine())-3,1); bonus2 bIgnoreDefRate,RC_DemiHuman,5; } if(getrefine()>8) { bonus3 bAutoSpell,"LK_CONCENTRATION",getskilllv("LK_CONCENTRATION")>1?getskilllv("LK_CONCENTRATION"):1,30; bonus3 bAutoSpell,"LK_AURABLADE",getskilllv("LK_AURABLADE")>1?getskilllv("LK_AURABLADE"):1,30; } },{},{}
@@ -631,7 +631,7 @@
1271,Blood_Tears,Blood Tears,4,20,,1700,120,,1,2,0x00001000,2,2,34,4,55,1,16,{ if(getrefine()>=9){ bonus3 bAutoSpell,"NPC_WIDEBLEEDING",2,30; } else bonus3 bAutoSpell,"NPC_WIDEBLEEDING",1,30; },{},{}
1272,Scratcher,Scratcher,4,20,,0,120,,1,0,0x00001000,7,2,34,1,0,0,16,{ bonus2 bAddRace,RC_Boss,50; bonus2 bAddRace,RC_NonBoss,50; },{},{}
1273,Bloody_Roar_C,Refined Bloody Roar,4,1,,0,148,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bIgnoreDefRace,RC_DemiHuman; bonus bFlee,-160; bonus bFlee2,-160; },{},{}
-1274,Unholy_Touch_C,Refined Unholy Touch,4,1,,0,179,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Curse,500; bonus bCritical,-1; bonus bUnbreakableWeapon,0; },{},{}
+1274,Unholy_Touch_C,Refined Unholy Touch,4,1,,0,179,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Curse,5000; bonus bCritical,-1; bonus bUnbreakableWeapon,0; },{},{}
1275,Katar_Of_Cold_Icicle_,Katar of Frozen Icicle,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Water; bonus2 bAddEff,Eff_Freeze,500; },{},{}
1276,Katar_Of_Thornbush_,Katar of Quaking,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Earth; bonus2 bAddEff,Eff_Blind,500; },{},{}
1277,Katar_Of_Raging_Blaze_,Katar of Raging Blaze,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Fire; bonus2 bAddEff,Eff_Silence,500; },{},{}
@@ -698,9 +698,9 @@
1373,Brood_Axe_C,Refined Bloody Axe,4,2,,0,205,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,20; bonus bSpeedRate,25; bonus bAspdRate,5; },{},{}
1374,Tomahawk_C,Tomahawk,4,2,,0,200,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bAtkEle,Ele_Wind; skill "ITM_TOMAHAWK",1; },{},{}
1375,Berdysz,Berdysz,4,20,,2500,200,,1,2,0x000444A2,2,2,34,3,70,1,7,{ bonus2 bSubSize,Size_Medium,13; bonus2 bSubSize,Size_Large,15; },{},{}
-1376,Heart_Breaker,Heart Breaker,4,20,,2000,175,,1,1,0x000444A2,2,2,34,4,70,1,7,{ bonus bCritical,20+getrefine(); bonus bAspdRate,5; if((Class==Job_Whitesmith)||(Class==Job_Creator)) bonus3 bAutoSpell,"BS_HAMMERFALL",3,30; },{},{}
+1376,Heart_Breaker,Heart Breaker,4,20,,2000,175,,1,1,0x000444A2,2,2,34,4,70,1,7,{ bonus bCritical,20+getrefine(); bonus bAspdRate,5; if((Class==Job_Whitesmith)||(Class==Job_Creator)||(Class==Job_Mechanic)||(Class==Job_Mechanic_T)||(Class==Job_Genetic)||(Class==Job_Genetic_T)) bonus3 bAutoSpell,"BS_HAMMERFALL",3,30; },{},{}
1377,Hurricane_Fury,Hurricane's Fury,4,20,,3500,332,,1,1,0x000444A2,2,2,34,4,80,1,7,{ bonus2 bSubSize,Size_Medium,10+getrefine(); bonus bAspdRate,getrefine(); bonus3 bAutoSpell,"NPC_PULSESTRIKE",5,20; },{},{}
-1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,1500; },{},{}
+1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,2000; },{},{}
1379,BF_Two_Handed_Axe1,Valorous Insane Battle Axe,4,20,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
1380,BF_Two_Handed_Axe2,Brave Insane Battle Axe,4,20,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; autobonus "{ bonus bBreakArmorRate,10000; }",20,3000,BF_WEAPON,"{ specialeffect2 EF_POTION_BERSERK; }"; bonus bUnbreakableWeapon,0; },{},{}
1381,N_Battle_Axe,Novice Battle Axe,4,0,,0,100,,1,3,0x000444A2,7,2,34,1,3,0,7,{},{},{}
@@ -1764,7 +1764,7 @@
2730,Morroc_Seal,Seal of Continental Guard,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bMaxHP,50; bonus bAspdRate,3; },{},{}
2731,Morroc_Charm_Stone,Rune Spellstone,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bMaxSP,50; bonus bVariableCastrate,-1; },{},{}
2732,Morroc_Ring,Death Loop,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bCritical,5; },{},{}
-2733,Medal_Gunner,Sheriff Badge,5,20,,0,,1,,0,0x01000000,7,2,136,,70,0,0,{ bonus2 bAddRace,RC_NonBoss,5; bonus2 bAddRace,RC_Boss,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,1000,ATF_LONG; },{},{}
+2733,Medal_Gunner,Sheriff Badge,5,20,,0,,1,,0,0x01000000,7,2,136,,70,0,0,{ bonus2 bAddRace,RC_NonBoss,5; bonus2 bAddRace,RC_Boss,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,100,ATF_LONG; },{},{}
2734,Directive_A,Directive,5,0,,0,,1,,0,0x00000001,7,2,136,,0,0,0,{},{},{}
2735,Directive_B,Directive,5,0,,0,,1,,0,0x00000001,7,2,136,,0,0,0,{},{},{}
2736,Navel_Ring,Navel Ring,5,20,,100,,0,,0,0xFFFFFFFE,7,2,136,,75,0,0,{ bonus bDex,3; bonus bLuk,3; bonus bMdef,2; },{},{}
@@ -3067,7 +3067,7 @@
5373,Darkness_Helm,Dark Randgris Helm,5,20,,300,,2,,1,0xFFFFFFFF,7,2,768,,0,1,379,{ bonus bDex,3; bonus bMdef,1; },{},{}
5374,L_Magestic_Goat,Gigantic Majestic Goat,5,20,,800,,5,,0,0xFFFFFFFF,7,2,256,,0,1,380,{ bonus2 bAddRace,RC_DemiHuman,12; bonus bBaseAtk,(JobLevel*2)/7; },{},{}
5375,L_Orc_Hero_Helm,Orc Hero Headdress,5,20,,900,,5,,1,0xFFFFFFFF,7,2,768,,0,1,381,{ bonus bStr,2; bonus3 bAutoSpellWhenHit,"BS_WEAPONPERFECT",3,10; },{},{}
-5376,Satanic_Chain_P,Flying Evil Wing,5,20,,100,,3,,1,0xFFFFFFFF,7,2,256,,0,1,382,{ bonus bMaxSP,120; bonus3 bAddEffWhenHit,Eff_Curse,100,ATF_SELF; },{},{}
+5376,Satanic_Chain_P,Flying Evil Wing,5,20,,100,,3,,1,0xFFFFFFFF,7,2,256,,0,1,382,{ bonus bMaxSP,120; bonus2 bAddEff2,Eff_Curse,300; },{},{}
5377,Antique_Pipe,Gentleman's Pipe,5,20,,100,,0,,0,0xFFFFFFFF,7,2,1,,0,0,383,{ bonus2 bSubRace,RC_DemiHuman,2; },{},{}
5378,Rabbit_Ear_Hat,Bunny Top Hat,5,20,,300,,0,,0,0xFFFFFFFF,7,2,256,,0,1,384,{ bonus bAgi,3; bonus3 bAutoSpellWhenHit,"AL_INCAGI",5,10; },{},{}
5379,Balloon_Hat,Tam,5,0,,800,,3,,1,0xFFFFFFFF,7,2,256,,50,1,385,{ bonus bMdef,2; bonus bMatkRate,2+(getrefine()/2); },{},{}
@@ -3893,7 +3893,7 @@
6342,Fade_Notation_Purple,Fade Notation Purple,3,0,,10,,,,,,,,,,,,,{},{},{}
6343,Fade_Notation_Blue,Fade Notation Blue,3,0,,10,,,,,,,,,,,,,{},{},{}
6344,Muscle_Story,Muscle Story,3,0,,0,,,,,,,,,,,,,{},{},{}
-6345,Love_Ball,Love Ball,3,0,,0,,,,,,,,,,,,,{},{},{}
+6345,Love_Ball,Love Lump,3,0,,0,,,,,,,,,,,,,{},{},{}
6346,Seagate_Mark,Seagate Mark,3,0,,0,,,,,,,,,,,,,{},{},{}
6347,Bless_Word_Paper1,Bless Word Paper,3,4020,,0,,,,,,,,,,,,,{},{},{}
6348,Bless_Word_Paper2,Bless Word Paper,3,4020,,0,,,,,,,,,,,,,{},{},{}
@@ -5519,7 +5519,7 @@
12217,Aspersio_5_Scroll,LV5 Aspersio Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(countitem(523)>0) { skilleffect "PR_ASPERSIO",0; sc_start SC_ASPERSIO,180000,5; delitem 523,1; } },{},{}
12218,Assumptio_5_Scroll,LV5 Assumptio Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ skilleffect "HP_ASSUMPTIO",0; sc_start SC_ASSUMPTIO,100000,5; },{},{}
12219,Wind_Walk_10_Scroll,LV10 Wind Walker Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ skilleffect "SN_WINDWALK",0; sc_start SC_WINDWALK,250000,5; },{},{}
-12220,Adrenaline_Scroll,LV5 Adrenaline Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(getiteminfo(getequipid(EQI_HAND_R),14)==6||getiteminfo(getequipid(EQI_HAND_R),14)==7) { skilleffect "BS_ADRENALINE",0; sc_start SC_ADRENALINE,150000,5; } },{},{}
+12220,Adrenaline_Scroll,LV5 Adrenaline Scroll,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ set .@type,getiteminfo(getequipid(EQI_HAND_R),11); if (.@type==6||.@type==7||.@type==8) { skilleffect "BS_ADRENALINE",0; sc_start SC_ADRENALINE,150000,5; } },{},{}
12221,Megaphone_,Megaphone,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ input @megaphone$; announce strcharinfo(0) + ": " + @megaphone$,bc_all,0xFF0000; end; },{},{}
12225,Sweet_Candy_Striper,Sweet Candy Cane,2,20,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ pet 1245; },{},{}
12226,Examination1,Examination 1,0,20,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_SpeedUp0,5400000,0; percentheal 100,100; sc_start SC_STRFOOD,5400000,10; sc_start SC_DEXFOOD,5400000,5; sc_start SC_ATKPOTION,5400000,22; sc_start SC_MATKFOOD,5400000,15; },{},{}
@@ -6153,12 +6153,12 @@
13059,E_Asura_C,Asura,4,1,,0,120,,1,0,0x02000000,7,2,2,1,1,0,1,{},{},{}
13060,E_Counter_Dagger_C,Counter Dagger,4,1,,0,209,,1,0,0x00810204,7,2,2,4,1,0,1,{},{},{}
13061,Black_Wing,Black Wing,4,20,,600,142,,1,1,0x00020000,7,2,2,3,102,1,1,{ bonus2 bSkillAtk,"SC_FATALMENACE",30+(getrefine()*2); bonus bMatkRate,(getrefine()*3); },{},{}
-13062,Ancient_Dagger,Ancient Dagger,4,20,,600,107,,0,0,0x028F5EEE,2,2,2,4,120,1,1,{ bonus bMatk,120; bonus bMaxSP,100; bonus bSPrecovRate,5; bonus2 bAddEff2,Eff_Curse,50; },{},{}
+13062,Ancient_Dagger,Ancient Dagger,4,20,,600,107,,0,0,0x028F5EEE,2,2,2,4,120,1,1,{ bonus bMatk,120; bonus bMaxSP,100; bonus bSPrecovRate,5; bonus2 bAddEff2,Eff_Curse,20; bonus3 bAddEff,Eff_Curse,20,ATF_SELF|ATF_SKILL; },{},{}
//13063,
//13064,
//13065,
13066,P_Dagger3,Eden Dagger III,4,0,,0,165:80,,1,0,0xFE9F7EEF,7,2,2,3,60,0,1,{},{},{}
-13067,Kris,Kris,4,20,,700,107:70,,1,1,0xFE9F7EEF,2,2,2,3,30,1,1,{ bonus2 bHpDrainRate,50,10; },{},{}
+13067,Caress,Keris,4,20,,700,107:70,,1,1,0xFE9F7EEF,2,2,2,3,30,1,1,{ bonus2 bHpDrainRate,20,10; },{},{}
13068,Pompano,Pompano,4,0,,0,160:100,,3,0,0xFE9F7EEF,7,2,2,1,50,0,1,{ bonus bUnbreakableWeapon,0; autobonus "{ bonus bBaseAtk,30; }",10,7000,BF_WEAPON,"{ specialeffect2 EF_ENHANCE; }"; autobonus "{ bonus bMatk,20; }",10,7000,BF_MAGIC,"{ specialeffect2 EF_SUFFRAGIUM; }"; if(BaseLevel>99) { bonus bBaseAtk,10; bonus bMatk,10; } },{},{}
13069,As-nail,As-nail,4,56000,,500,160:80,,1,0,0x000654E2,7,2,2,4,110,1,1,{ bonus bAtkEle,Ele_Wind; bonus2 bAddEff,Eff_Freeze,100+(getrefine()*50); },{},{}
13070,Scarlet-nail,Scarlet-nail,4,56000,,500,160:80,,1,0,0x000654E2,7,2,2,4,110,1,1,{ bonus bAtkEle,Ele_Fire; bonus2 bAddEff,Eff_Stone,100+(getrefine()*50); },{},{}
@@ -6233,7 +6233,7 @@
13205,Poison_Sphere,Poison Sphere,10,80,,5,50,,,,0x01000000,7,2,32768,,1,,5,{ bonus bAtkEle,Ele_Poison; bonus2 bAddEff,Eff_Poison,500; },{},{}
13206,Blind_Sphere,Blind Sphere,10,80,,5,50,,,,0x01000000,7,2,32768,,1,,5,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Blind,500; },{},{}
13207,Freezing_Sphere,Freezing Sphere,10,80,,5,50,,,,0x01000000,7,2,32768,,1,,5,{ bonus bAtkEle,Ele_Water; },{},{}
-13208,Gong_Bug,Gong Bug,10,0,,20,50,,,,0x01000000,7,2,32768,,50,,3,{},{},{}
+13208,Gong_Bug,Sow Bug,10,0,,20,50,,,,0x01000000,7,2,32768,,50,,3,{ /*bonus2 bAddEff,Eff_Stun,?;*/ },{},{}
// Shurikens & Kunais
13250,Shuriken,Shuriken,10,4,,5,10,,,,0x02000000,7,2,32768,,1,,6,{},{},{}
13251,Nimbus_Shuriken,Nimbus Shuriken,10,10,,5,30,,,,0x02000000,7,2,32768,,20,,6,{},{},{}
@@ -6278,7 +6278,10 @@
13289,Petti_Noodle_To_Throw,Throwing Petite Tail Soup,10,100,,50,0,,,,0x00040000,8,2,32768,,99,,9,{ sc_start SC_PUTTI_TAILS_NOODLES,300000,20; },{},{}
13290,Black_Thing_To_Throw,Throwing Black Mass,10,100,,50,0,,,,0x00040000,8,2,32768,,99,,9,{ sc_start SC_STOMACHACHE,60000,rand(5,10); },{},{}
// More Shurikens & Kunais
-13294,Explosive_Kunai,Explosive Kunai,10,100,,50,30,,,,0x02000000,7,2,32768,,100,,7,{ bonus bAtkEle,Ele_Neutral; },{},{}
+13291,Starfish,Starfish,10,0,,5,110,,,,0x02000000,7,2,32768,,50,,7,{ bonus bAtkEle,Ele_Neutral; /*bonus2 bAddEff,Eff_Stun,?;*/ },{},{}
+13292,Dried_Squid,Dried Squid,10,10,,20,50,,,,0x02000000,7,2,32768,,1,,7,{ bonus bAtkEle,Ele_Neutral; /*bonus2 bAddEff,Eff_Blind,?;*/ },{},{}
+13293,Flying_Fish,Flying Fish,10,10,,20,50,,,,0x02000000,7,2,32768,,1,,6,{ bonus bAtkEle,Ele_Neutral; /*bonus2 bAddEff,Eff_Bleeding,?;*/ },{},{}
+13294,Explosive_Kunai,Explosive Kunai,10,100,,30,50,,,,0x02000000,7,2,32768,,100,,7,{ bonus bAtkEle,Ele_Neutral; },{},{}
// Ninja Fuuma Shurikens
13300,Huuma_Bird_Wing,Huuma Wing Shuriken,4,90000,,3000,150,,1,0,0x02000000,7,2,34,4,65,1,22,{ bonus bUnbreakableWeapon,0; bonus bAtkEle,Ele_Wind; bonus bDex,-2; bonus bAgi,-1; },{},{}
13301,Huuma_Giant_Wheel,Huuma Giant Wheel Shuriken,4,40000,,2500,50,,1,3,0x02000000,7,2,34,4,42,1,22,{ bonus bUnbreakableWeapon,0; bonus2 bAddEff,Eff_Bleeding,100; },{},{}
@@ -7302,10 +7305,10 @@
//15033,
//15034,
//15035,
-15036,Urj_Plate,Urj Plate,5,20,,3000,,110,,0,0x00000080,8,2,16,,100,1,0,{ bonus bMdef,10; bonus bMaxHPRate,getequiprefinerycnt(EQI_ARMOR); bonus2 bSubRace,RC_DemiHuman,5; bonus2 bSubEle,Ele_Neutral,5; },{},{}
-15037,Pertz_Plate,Pertz Plate,5,20,,3000,,110,,0,0x00000080,8,2,16,,100,1,0,{ bonus bMdef,10; bonus bBaseAtk,20; bonus bFlee,17; },{},{}
-15038,Sabath's_Cloth,Sabath's Cloth,5,20,,100,,45,,1,0x00001000,7,2,16,,100,1,0,{ bonus bLuk,3; bonus3 bAutoSpell,"ASC_METEORASSAULT",getskilllv("ASC_METEORASSAULT"),10; },{},{}
-15039,Nabeu's_Cloth,Nabeu's Cloth,5,20,,100,,45,,1,0x00001000,7,2,16,,100,1,0,{ bonus bStr,2; bonus bInt,2; },{},{}
+15036,Ur_Plate,Urj Plate,5,20,,3000,,110,,0,0x00000080,8,2,16,,100,1,0,{ bonus bMdef,10; bonus bMaxHPRate,getequiprefinerycnt(EQI_ARMOR); bonus2 bSubRace,RC_DemiHuman,5; bonus2 bSubEle,Ele_Neutral,5; },{},{}
+15037,Peuz_Plate,Pertz Plate,5,20,,3000,,110,,0,0x00000080,8,2,16,,100,1,0,{ bonus bMdef,10; bonus bBaseAtk,20; bonus bFlee,17; },{},{}
+15038,Sabah_Cloth,Sabath's Cloth,5,20,,100,,45,,1,0x00001000,7,2,16,,100,1,0,{ bonus bLuk,3; bonus3 bAutoSpell,"ASC_METEORASSAULT",getskilllv("ASC_METEORASSAULT"),10; },{},{}
+15039,Nab_Cloth,Nabeu's Cloth,5,20,,100,,45,,1,0x00001000,7,2,16,,100,1,0,{ bonus bStr,2; bonus bInt,2; },{},{}
//15040,
//15041,
15042,White_Wing_Suit,White Wing Suit,5,20,,100,,45,,1,0x00000800,7,2,16,,100,1,0,{ bonus bLongAtkRate,getrefine()*2; bonus bFlee,getrefine(); },{},{}
@@ -7313,12 +7316,12 @@
15044,Green_Surgical_Gown,Green Surgical Gown,5,56000,,660,,66,,1,0x00040000,7,2,16,,100,1,0,{ bonus bDex,1; bonus bMaxSP,30; },{},{}
//15045,
15046,Siege_Plate,Siege Plate,5,0,,3300,,85,,1,0x006444A2,7,2,16,,95,1,0,{ bonus bMdef,5; bonus2 bSubRace,RC_DemiHuman,2; if(getrefine()>5) { bonus bHealpower2,12; bonus bAddItemHealRate,12; } if(getrefine()>8) { bonus bMaxHPRate,25; } },{},{}
-15047,Siege_Suit,Siege Suit,5,0,,750,,50,,1,0x036E5CEA,7,2,16,,95,1,0,{ bonus bMdef,10; bonus2 bSubRace,RC_DemiHuman,2; if(getrefine()>5) { bonus bFlee2,5; bonus bLongAtkDef,20; } if(getrefine()>8) { bonus bMaxHPRate,15; } },{},{}
+15047,Siege_Suits,Siege Suit,5,0,,750,,50,,1,0x036E5CEA,7,2,16,,95,1,0,{ bonus bMdef,10; bonus2 bSubRace,RC_DemiHuman,2; if(getrefine()>5) { bonus bFlee2,5; bonus bLongAtkDef,20; } if(getrefine()>8) { bonus bMaxHPRate,15; } },{},{}
15048,Siege_Robe,Siege Robe,5,0,,500,,40,,1,0x00818315,7,2,16,,95,1,0,{ bonus bMdef,20; bonus2 bSubRace,RC_DemiHuman,2; if(getrefine()>5) { bonus bFlee,5; bonus bLongAtkDef,15; } if(getrefine()>8) { bonus bMaxHP,1000; bonus bMaxSP,100; } },{},{}
//15049,
//15050,
-15051,Bakunawa_Scale_Armor,Bakunawa Scale Armor,5,20,,500,,55,,0,0xFFFFFFFF,7,2,16,,1,1,0,{ bonus2 bSubRace,RC_Boss,getrefine()/2; bonus bAllStats,1; },{},{}
-15052,Bayani_Bakunawa_Scale_Armor,Bayani Bakunawa Scale Armor,5,20,,500,,55,,1,0xFFFFFFFF,7,2,16,,1,1,0,{ bonus2 bSubRace,RC_Boss,getrefine()/2; bonus bAllStats,2; },{},{}
+15051,Bakonawa_Armor,Bakunawa Scale Armor,5,20,,500,,55,,0,0xFFFFFFFF,7,2,16,,1,1,0,{ bonus2 bSubRace,RC_Boss,getrefine()/2; bonus bAllStats,1; },{},{}
+15052,Bayani_Bakonawa_Armor,Bayani Bakunawa Scale Armor,5,20,,500,,55,,1,0xFFFFFFFF,7,2,16,,1,1,0,{ bonus2 bSubRace,RC_Boss,getrefine()/2; bonus bAllStats,2; },{},{}
15053,Special_Ninja_Suit,Special Ninja Suit,5,10000,,1200,,70,,0,0x02000000,7,2,16,,100,1,0,{ bonus bAgi,1+(getrefine()/3); },{},{}
15054,Ninja_Scale_Armor,Ninja Scale Armor,5,10000,,1800,,90,,1,0x02000000,7,2,16,,100,1,0,{ bonus bMaxHPRate,15; bonus bMaxSPRate,-30; },{},{}
15055,Armor_of_Nothingness,Armor of Nothingness,5,10000,,1500,,60,,1,0x02000000,7,2,16,,100,1,0,{ bonus bAgi,1; },{},{}
@@ -7339,7 +7342,7 @@
//16012,
16013,Judgement_Mace1,Judgement Mace I,4,20,,1200,140:180,,1,2,0x00000100,2,2,2,3,100,1,8,{ bonus bStr,1; bonus bInt,1; autobonus "{ bonus2 bAddRace,RC_Demon,20; }",10,7000,BF_WEAPON|BF_MAGIC,"{ specialeffect2 EF_BLOODDRAIN; }"; },{},{}
16014,P_Mace3,Eden Mace III,4,0,,0,172,,1,0,0x0004C5B3,7,2,2,3,60,0,8,{},{},{}
-//16015,
+16015,Cat_Club,Cat Club,4,20,,700,88,,1,3,0x0004C5B3,7,2,2,1,1,1,8,{ bonus2 bAddRace,RC_Brute,15; },{},{}
16016,Tuna,Tuna,4,0,,0,180,,1,0,0x0004C5B3,7,2,2,1,50,0,8,{ bonus bUnbreakableWeapon,0; bonus2 bAddEff,Eff_Stun,100; bonus3 bAutoSpell,"SM_BASH",5+5*(getskilllv("SM_BASH")==10),10; if(BaseLevel>99) { bonus bBaseAtk,20; } },{},{}
16017,Bloody_Cross,Bloody Cross,4,20,,1500,170,,1,0,0x00008110,7,2,2,4,100,1,8,{ bonus bAtkEle,Ele_Dark; bonus3 bAutoSpell,"WL_HELLINFERNO",1,10+(getrefine()*5); },{},{}
16018,Judgement_Mace2,Judgement Mace II,4,20,,1200,170:180,,1,1,0x00000100,2,2,2,3,130,1,8,{ bonus bStr,2; bonus bInt,2; autobonus "{ bonus2 bAddRace,RC_Demon,40; }",10,7000,BF_WEAPON|BF_MAGIC,"{ specialeffect2 EF_BLOODDRAIN; }"; },{},{}
diff --git a/db/re/item_trade.txt b/db/re/item_trade.txt
index 9ad2a8c65..c6faa991b 100644
--- a/db/re/item_trade.txt
+++ b/db/re/item_trade.txt
@@ -1,6 +1,6 @@
//Item Trading Restrictions File
//Specify here special rules for item trading.
-//Item ID, TradeMask, GM-Level Override
+//Item ID, TradeMask, Group-Level Override
//Trading mask values:
//1:Item can't be droped
//2:Item can't be traded (nor vended)
@@ -13,7 +13,7 @@
//256:Item can't be auctioned
//Example:
//1161,67,50 //Balmung: No drop, No trade, No Guild Store (1+2+64 =67),
-//only GMs of GM-level 50 and up can override the setting.
+//only groups of group-level 50 and up can override the setting.
// Wedding Related items
2634,507,100 // Wedding Ring
diff --git a/db/re/map_zone_db.conf b/db/re/map_zone_db.conf
index 36689ac57..6fb18084b 100644
--- a/db/re/map_zone_db.conf
+++ b/db/re/map_zone_db.conf
@@ -16,11 +16,42 @@
//= maps can be linked to a specific zone through the zone mapflag
//= '<map name><tab>mapflag<tab>zone<tab><zone name>'
//== available types for 'disabled_skills':
-//= PLAYER, HOMUN, MERCENARY, MONSTER, ALL and NONE
+//= PLAYER, HOMUN, MERCENARY, MONSTER, PET, ELEMENTAL, ALL and NONE
//== More on
//= http://hercules.ws/board/topic/302-introducing-hercules-map-zone-database/
+//= (TODO: replace with wiki link and detail the wiki page in a decent format ^)
zones: (
{
+ /* All zone is a dynamic (very special) zone that is forcebly inherited by ALL maps automatically */
+ name: "All" /* changing this name requires MAP_ZONE_ALL_NAME to also be changed in src/map/map.h file */
+
+ disabled_skills: {
+ //both examples below disable napalm beat (id 11) to players
+ //MG_NAPALMBEAT: "PLAYER"
+ //ID11: "PLAYER"
+ }
+
+ disabled_items: {
+ //Both examples below disable apple (id 501)
+ //Apple: true
+ //ID501: true
+ }
+
+ mapflags: ( )
+
+ /* "command:min-group-lv-to-override" e.g. "heal: 70" */
+ disabled_commands: {
+ //Example Below makes @heal be used in maps within this zone only by those group lv 70 and above
+ //heal: 70
+ }
+ skill_damage_cap: {
+ //Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage,
+ // (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h)
+ // to players and monsters.
+ //MG_FIREBOLT: (50,"PLAYER | MONSTER")
+ }
+},
+{
/* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */
/* However, it wont be applied to maps with its own zones (specified thru mapflag) */
name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */
@@ -37,6 +68,7 @@ zones: (
}
mapflags: ( )
+
},
{
/* PvP zone is applied to all maps with a pvp mapflag */
diff --git a/db/re/mob_db.txt b/db/re/mob_db.txt
index e608cbf49..bfbd55d8a 100644
--- a/db/re/mob_db.txt
+++ b/db/re/mob_db.txt
@@ -1180,7 +1180,7 @@
2071,HEADLESS_MULE,Headless Mule,Headless Mule,80,6620,1,1011,1120,1,210,267,33,44,68,51,50,35,67,20,10,12,2,6,63,0x3985,165,1216,816,432,0,0,0,0,0,0,0,7120,4000,2317,5,7097,1000,7122,1000,1269,1,2317,1,1255,2,0,0,0,0,0,0
2072,JAGUAR,Jaguar,Jaguar,71,3914,1,720,512,1,192,234,44,15,69,30,45,5,59,5,10,12,1,2,42,0x91,150,576,1248,480,0,0,0,0,0,0,0,7171,3000,7172,2000,919,1000,756,40,1810,1,0,0,0,0,0,0,0,0,0,0
2073,TOUCAN,Toucan,Toucan,70,3640,1,659,544,1,166,201,12,12,54,14,40,35,44,10,10,12,1,2,44,0x1089,155,960,1440,960,0,0,0,0,0,0,0,917,3000,7053,1000,510,50,508,100,2612,200,0,0,0,0,0,0,0,0,0,0
-2074,CURUPIRA,Curupira,Curupira,68,3096,1,622,450,1,140,175,42,12,32,23,38,20,45,10,10,12,1,7,22,0x118B,250,528,480,384,0,0,0,0,0,0,0,517,3000,757,250,1011,10,7267,500,1505,100,0,0,0,0,0,0,0,0,0,0
+2074,CURUPIRA,Curupira,Curupira,68,3096,1,622,450,1,140,175,42,12,32,23,38,20,45,10,10,12,1,7,22,0x108B,250,528,480,384,0,0,0,0,0,0,0,517,3000,757,250,1011,10,7267,500,1505,100,0,0,0,0,0,0,0,0,0,0
// Event MVP
2075,E_VADON_X,Ragunta,Ragunta,150,25000000,0,9999999,9999999,1,7000,10000,500,500,100,100,100,100,100,100,10,12,2,5,88,0x37B5,150,1632,432,540,4999999,0,0,0,0,0,0,960,5000,7095,3000,7093,3000,984,1000,985,500,7444,50,617,10,0,0,0,0,6414,9000
@@ -1256,12 +1256,12 @@
2135,CREEPER,Creeper,Creeper,100,1000,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,3,22,0x40,2000,192,192,576,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2136,LITTLE_FATUM,Little Fatum,Little Fatum,142,85100,1,7500,6500,1,442,894,51,198,10,66,17,148,148,97,10,12,0,7,44,0x3885,150,432,300,432,0,0,0,0,0,0,0,6395,5000,7938,100,11519,100,2465,3,0,0,0,0,0,0,0,0,0,0,4511,1
2137,MIMING,Miming,Miming,140,81200,1,7100,6300,1,430,652,120,120,90,66,105,77,133,77,10,12,0,0,20,0x3885,250,576,1140,504,0,0,0,0,0,0,0,6394,5000,7938,100,969,1,2853,3,0,0,0,0,0,0,0,0,0,0,4510,1
-2138,NYDHOG_MEMORY1_1,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0xC9,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-2139,NYDHOG_MEMORY1_2,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0xC9,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-2140,NYDHOG_MEMORY2_1,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0xC9,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-2141,NYDHOG_MEMORY2_2,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0xC9,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-2142,NYDHOG_MEMORY3_1,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0xC9,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-2143,NYDHOG_MEMORY3_2,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0xC9,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2138,NYDHOG_MEMORY1_1,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0x161,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2139,NYDHOG_MEMORY1_2,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0x161,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2140,NYDHOG_MEMORY2_1,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0x161,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2141,NYDHOG_MEMORY2_2,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0x161,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2142,NYDHOG_MEMORY3_1,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0x161,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2143,NYDHOG_MEMORY3_2,Nydhogg's Memory,Nydhogg's Memory,130,10,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0x161,200,1248,576,1248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2144,G_ANTLER_SCARABA,Antler Scaraba,Antler Scaraba,136,62600,1,0,0,1,412,822,155,102,23,99,59,129,91,45,10,12,1,4,42,0x3985,200,504,624,360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2145,G_RAKE_SCARABA,Rake Scaraba,Rake Scaraba,139,67700,1,0,0,1,830,942,250,70,90,66,145,52,112,77,10,12,1,4,42,0x3985,150,588,768,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2146,G_S_NYDHOG,G_S_NYDHOG,G_S_NYDHOG,117,300000,0,0,0,2,840,1680,60,60,1,30,30,136,88,30,10,12,2,9,87,0x37B5,150,1596,1620,864,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@@ -1528,3 +1528,734 @@
2378,MER_ANTLER_SCARABA,Antler Scaraba,Antler Scaraba,1,50,0,0,0,1,7,10,0,5,1,1,1,1,6,30,10,12,1,3,21,0x83,400,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2379,XMAS_SMOKEY_SOCK,Smokey Sock,Smokey Sock,1,50,0,0,0,1,7,10,0,5,1,1,1,1,6,30,10,12,1,3,21,0x83,400,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2380,XMAS_SMOKEY_GIFT,Smokey Gift,Smokey Gift,1,50,0,0,0,1,7,10,0,5,1,1,1,1,6,30,10,12,1,3,21,0x83,400,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+
+// Monster's Waitting To Be Coded In
+//2381,E_VADON_X_S
+//2382,E_VADON_X_H
+//2383,E_VADON_X_H_S
+//2384,KRAKEN_LEG_1
+//2385,KRAKEN_LEG_2
+//2386,KRAKEN_LEG_3
+//2387,KRAKEN_LEG_4
+//2388,KRAKEN_LEG_5
+//2389,G_KRAKEN_LEG_1
+//2390,G_KRAKEN_LEG_2
+//2391,G_KRAKEN_LEG_3
+//2392,G_KRAKEN_LEG_4
+//2393,G_KRAKEN_LEG_5
+//2394,MERMAN_SE
+//2395,SEIREN
+//2396,POSEIDON
+//2397,KRAKEN_BABY
+//2398,LITTLE_PORING
+//2399,E_MINI_DEMON
+//2400,E_DIABOLIC
+//2401,G_PORING
+//2402,POPORING_IMMUNE_M
+//2403,POPORING_IMMUNE_A
+//2404,DEAD_PLANKTON
+//2405,WEAK_SKELETON
+//2406,WEAK_SKEL_SOLDIER
+//2407,SAILOR_SKELETON
+//2408,DUMMY_10
+//2409,DUMMY_50
+//2410,DUMMY_100
+//2411,DUMMY_150
+//2412,E_VALKIWI
+//2413,DUMMY_10_FIRE
+//2414,RUNAWAY_BOOK
+//2415,L_SEYREN
+//2416,L_EREMES
+//2417,L_HARWORD
+//2418,L_SHECIL
+//2419,L_KATRINN
+//2420,L_MAGALETA
+//2421,L_YGNIZEM
+//2422,L_WHIKEBAIN
+//2423,L_ARMAIA
+//2424,L_KAVAC
+//2425,L_DANCER
+//2426,L_RAWREL
+//2427,L_EREND
+//2428,G_L_SEYREN
+//2429,G_L_EREMES
+//2430,G_L_HARWORD
+//2431,G_L_SHECIL
+//2432,G_L_KATRINN
+//2433,G_L_MAGALETA
+//2434,G_L_YGNIZEM
+//2435,G_L_WHIKEBAIN
+//2436,G_L_ARMAIA
+//2437,G_L_KAVAC
+//2438,G_L_DANCER
+//2439,G_L_RAWREL
+//2440,G_L_EREND
+//2441,B_NOVICE
+//2442,B_SUPERNOVICE
+//2443,AIRA
+//2444,KULUNA
+//2445,MALLINA
+//2446,EZELLA
+//2447,LUNE
+//2448,MORIN
+//2449,NASARIN
+//2450,THIEF_PORING
+//2451,BABY_STRANGE
+//2452,TREASURE_BOX_TE
+//2453,TREASURE_BOX_TE_1
+//2454,TREASURE_BOX_TE_2
+//2455,TREASURE_BOX_TE_3
+//2456,TREASURE_BOX_TE_4
+//2457,TREASURE_BOX_TE_5
+//2458,TREASURE_BOX_TE_6
+//2459,TREASURE_BOX_TE_7
+//2460,TREASURE_BOX_TE_8
+//2461,TREASURE_BOX_TE_9
+//2462,TREASURE_BOX_TE_10
+//2463,E_BOMBPORING
+//2464,MG_ZOMBIE
+//2465,MG_WRAITH
+//2466,MG_GHOUL
+//2467,MG_ARCLOUSE
+//2468,MG_RAYDRIC
+//2469,MG_RAYDRIC_ARCHER
+//2470,MG_KNIGHT_OF_ABYSS
+//2471,MG_KHALITZBURG
+//2472,MG_BLOODY_KNIGHT
+//2473,MG_M_UNDEAD_KNIGHT
+//2474,MG_F_UNDEAD_KNIGHT
+//2475,MG_CORRUPTION_ROOT
+//2476,MG_AMDARAIS
+//2477,NG_WANDER_MAN
+//2478,NG_RIDEWORD
+//2479,NG_MIMIC
+//2480,NG_EVIL_DRUID
+//2481,NG_WRAITH_DEAD
+//2482,G_MG_KHALITZBURG
+//2483,NG_BAPHOMET
+//2484,G_NG_BAPHOMET_
+//2485,NG_CHIMERA
+//2486,ISIS_ANNIV
+//2487,PASANA_ANNIV
+//2488,OSIRIS_ANNIV
+//2489,GM_WOMAN
+//2490,GM_SAY
+//2491,GM_SMOKIE
+//2492,GM_PHOENIX
+//2493,GM_MEN
+//2494,GM_HINALLE
+//2495,HIDDEN_MOB2
+//2496,I_UZHAS
+//2497,I_DOKEBI
+//2498,G_WISH_MAIDEN
+//2499,J_PORING
+//2500,E_MEGALODON
+//2501,E_ASTER
+//2502,E_CRAB
+//2503,E_SHELLFISH
+//2504,E_COELACANTH_N_E
+//2505,E_RED_ERUMA
+//2506,E_KING_DRAMOH
+//2507,E_CORNUTUS
+//2508,E_PENOMENA
+//2509,KRAKEN_LEG_6
+//2510,WATERMELON_1
+//2511,WATERMELON_2
+//2512,WATERMELON_3
+//2513,WATERMELON_4
+//2514,WATERMELON_5
+//2515,WATERMELON_6
+//2516,WATERMELON_7
+//2517,WATERMELON_8
+//2518,WATERMELON_9
+//2519,WATERMELON_10
+//2520,WATERMELON_11
+//2521,WATERMELON_12
+//2522,WATERMELON_13
+//2523,WATERMELON_14
+//2524,WATERMELON_15
+//2525,WATERMELON_16
+//2526,E_BANDIT
+//2527,ME_ANOPHELES
+//2528,FACEWORM
+//2529,FACEWORM_QUEEN
+//2530,FACEWORM_DARK
+//2531,VENOM_BUG
+//2532,FACEWORM_QUEEN_R
+//2533,FACEWORM_QUEEN_G
+//2534,FACEWORM_QUEEN_B
+//2535,FACEWORM_QUEEN_Y
+//2536,HIDDEN_MOB3
+//2537,HIDDEN_MOB4
+//2538,E_KING_PORING
+//2539,HIDDEN_MOB5
+//2540,FACEWORM_EGG
+//2541,FACEWORM_LARVA
+//2542,IRENE_ELDER
+//2543,PAYONSOLDIER
+//2544,PAYONSOLDIER2
+//2545,GUARDDOG
+//2546,GUARDDOG2
+//2547,MER_GARM_BABY
+//2548,MER_HILLSRION
+//2549,GEFFEN_MAGE_1
+//2550,GEFFEN_MAGE_2
+//2551,GEFFEN_MAGE_3_1
+//2552,GEFFEN_MAGE_3_2
+//2553,GEFFEN_MAGE_3_3
+//2554,GEFFEN_MAGE_4
+//2555,GEFFEN_MAGE_5
+//2556,GEFFEN_MAGE_6
+//2557,GEFFEN_MAGE_7
+//2558,GEFFEN_MAGE_8
+//2559,GEFFEN_MAGE_9
+//2560,GEFFEN_MAGE_10
+//2561,GEFFEN_MAGE_11
+//2562,GEFFEN_MAGE_12
+//2563,FEI_KANABIAN
+//2564,GEFFEN_FENRIR
+//2565,ALPHONSE
+//2566,ALPHONSE_JR
+//2567,E_GEFFEN_MAGE_3_2
+//2568,E_GEFFEN_MAGE_3_3
+//2569,G_ANOPHELES
+//2570,G_BREEZE
+//2571,G_BUTOIJO
+//2572,G_CARAMEL
+//2573,G_CHONCHON
+//2574,G_CIVIL_SERVANT
+//2575,G_COCO
+//2576,G_CREAMY
+//2577,G_FABRE
+//2578,G_HORN
+//2579,G_HYLOZOIST
+//2580,G_KAHO
+//2581,G_LUDE
+//2582,G_LUNATIC
+//2583,G_MARTIN
+//2584,G_MINERAL
+//2585,G_MOLE
+//2586,G_NERAID
+//2587,G_OBSIDIAN
+//2588,G_PITMAN
+//2589,G_POPORING
+//2590,G_ROCKER
+//2591,G_SAVAGE
+//2592,G_SIORAVA
+//2593,G_SIROMA
+//2594,G_SNOWIER
+//2595,G_STAINER
+//2596,G_STAPO
+//2597,G_STEEL_CHONCHON
+//2598,G_UNGOLIANT
+//2599,G_WILD_RIDER
+//2600,G_WOLF
+//2601,G_YOYO
+//2602,G_ZIPPER_BEAR
+//2603,C1_ZOMBIE_SLAUGHTER
+//2604,C2_ZOMBIE_PRISONER
+//2605,C3_ZOMBIE_MASTER
+//2606,C4_ZOMBIE
+//2607,C5_ZAKUDAM
+//2608,C1_YOYO
+//2609,C2_YOYO
+//2610,C3_WORM_TAIL
+//2611,C4_WOOTAN_FIGHTER
+//2612,C5_WOOD_GOBLIN
+//2613,C1_WOLF
+//2614,C2_WIND_GHOST
+//2615,C3_WILOW
+//2616,C4_WILD_ROSE
+//2617,C5_WICKED_NYMPH
+//2618,C2_WHISPER
+//2619,C3_WEAK_SKELETON
+//2620,C4_WANDER_MAN
+//2621,C5_VIOLY
+//2622,C1_VIOLY
+//2623,C2_VIOLY
+//2624,C3_VENOMOUS
+//2625,C4_VENATU_1
+//2626,C5_VAVAYAGA
+//2627,C1_VANBERK
+//2628,C2_VADON
+//2629,C3_UNGOLIANT
+//2630,C4_TOUCAN
+//2631,C5_TIYANAK
+//2632,C2_THIEF_BUG
+//2633,C3_THIEF_BUG
+//2634,C4_THIEF_BUG
+//2635,C5_THARA_FROG
+//2636,C1_TEDDY_BEAR
+//2637,C2_TATACHO
+//2638,C3_TAROU
+//2639,C4_TAMRUAN
+//2640,C5_STING
+//2641,C1_STEM_WORM
+//2642,C2_STEEL_CHONCHON
+//2643,C3_STAPO
+//2644,C4_STALACTIC_GOLEM
+//2645,C5_STAINER
+//2646,C1_SPORE
+//2647,C2_SOLIDER
+//2648,C3_SOLDIER_SKELETON
+//2649,C4_SOLDIER_SKELETON
+//2650,C5_SOLACE
+//2651,C1_SOHEE
+//2652,C2_SNOWIER
+//2653,C3_SNAKE
+//2654,C4_SMOKIE
+//2655,C5_SLEEPER
+//2656,C1_SLEEPER
+//2657,C2_SKOGUL
+//2658,C3_SKELETON_GENERAL
+//2659,C4_SKELETON_GENERAL
+//2660,C5_SKEL_WORKER
+//2661,C1_SIROMA
+//2662,C2_SIDE_WINDER
+//2663,C3_SIDE_WINDER
+//2664,C4_SHINOBI
+//2665,C5_SHELTER
+//2666,C1_SHELLFISH
+//2667,C2_SHECIL
+//2668,C3_SEE_OTTER
+//2669,C4_SEDORA
+//2670,C5_SCORPION
+//2671,C1_SAVAGE_BABE
+//2672,C2_SAVAGE
+//2673,C3_SAVAGE
+//2674,C4_SAND_MAN
+//2675,C5_SALAMANDER
+//2676,C1_SAILOR_SKELETON
+//2677,C2_ROWEEN
+//2678,C3_RODA_FROG
+//2679,C4_RODA_FROG
+//2680,C5_ROCKER
+//2681,C1_RIDEWORD
+//2682,C2_RIDEWORD
+//2683,C3_RICE_CAKE_BOY
+//2684,C4_RETRIBUTION
+//2685,C5_RETRIBUTION
+//2686,C1_RETRIBUTION
+//2687,C2_REQUIEM
+//2688,C3_REMOVAL
+//2689,C5_RED_ERUMA
+//2690,C1_RAYDRIC
+//2691,C2_RAYDRIC
+//2692,C3_RAWREL
+//2693,C4_RAKE_SCARABA
+//2694,C5_RAGGLER
+//2695,C1_RAFFLESIA
+//2696,C3_PORING
+//2697,C4_PORING
+//2698,C5_PORING
+//2699,C1_PORING
+//2700,C2_PORCELLIO
+//2701,C3_POPORING
+//2702,C4_POPORING
+//2703,C5_POPORING
+//2704,C1_POISON_TOAD
+//2705,C2_POISON_SPORE
+//2706,C3_PLASMA_Y
+//2707,C4_PLANKTON
+//2708,C5_PITMAN
+//2709,C1_PIRANHA
+//2710,C2_PINGUICULA_D
+//2711,C3_PINGUICULA
+//2712,C4_PICKY_
+//2713,C5_PHEN
+//2714,C1_PETIT
+//2715,C2_PETIT
+//2716,C3_PENOMENA
+//2717,C4_PENOMENA
+//2718,C5_PECOPECO
+//2719,C1_PASANA
+//2720,C2_PARASITE
+//2721,C3_OWL_DUKE
+//2722,C4_ORK_WARRIOR
+//2723,C5_ORC_ZOMBIE
+//2724,C1_ORC_SKELETON
+//2725,C2_ORC_LADY
+//2726,C3_OBSERVATION
+//2727,C4_NOXIOUS
+//2728,C5_NOVUS
+//2729,C1_NOVUS
+//2730,C2_NOVUS
+//2731,C3_NOVUS
+//2732,C4_NIGHTMARE_TERROR
+//2733,C5_NG_WRAITH_DEAD
+//2734,C1_NG_WANDER_MAN
+//2735,C2_NEPENTHES
+//2736,C3_NECROMANCER
+//2737,C4_MYSTCASE
+//2738,C5_MUSCIPULAR
+//2739,C1_MUMMY
+//2740,C2_MUMMY
+//2741,C3_MUKA
+//2742,C4_MOROCC_1
+//2743,C5_MOROCC_1
+//2744,C1_MOROCC_1
+//2745,C2_MOLE
+//2746,C3_MIYABI_NINGYO
+//2747,C4_MINOROUS
+//2748,C5_MINOROUS
+//2749,C1_MINOROUS
+//2750,C2_MINERAL
+//2751,C3_MIMING
+//2752,C4_MIMIC
+//2753,C5_MIMIC
+//2754,C1_METALLER
+//2755,C2_METALING
+//2756,C3_METALING
+//2757,C4_MERMAN
+//2758,C5_MENBLATT
+//2759,C1_MEDUSA
+//2760,C2_MARTIN
+//2761,C3_MARIONETTE
+//2762,C4_MARIN
+//2763,C5_MARDUK
+//2764,C1_MANTIS
+//2765,C2_MANDRAGORA
+//2766,C3_MANANANGGAL
+//2767,C4_MAJORUROS
+//2768,C5_MAGNOLIA
+//2769,C1_MAGMARING
+//2770,C2_LUNATIC
+//2771,C3_LUNATIC
+//2772,C4_LUDE
+//2773,C5_LUCIOLA_VESPA
+//2774,C1_LOLI_RURI
+//2775,C2_LIVE_PEACH_TREE
+//2776,C3_LITTLE_PORING
+//2777,C4_LITTLE_FATUM
+//2778,C5_LI_ME_MANG_RYANG
+//2779,C1_LES
+//2780,C2_LEIB_OLMAI
+//2781,C3_LEAF_CAT
+//2782,C4_L_WHIKEBAIN
+//2783,C5_L_EREMES
+//2784,C1_KOBOLD_ARCHER
+//2785,C2_KOBOLD_1
+//2786,C3_KNOCKER
+//2787,C4_KIND_OF_BEETLE
+//2788,C5_KASA
+//2789,C1_KARAKASA
+//2790,C2_ISIS
+//2791,C3_ISILLA
+//2792,C4_INJUSTICE
+//2793,C5_INCREASE_SOIL
+//2794,C1_ICE_TITAN
+//2795,C2_IARA
+//2796,C3_HYEGUN
+//2797,C4_HUNTER_FLY
+//2798,C5_HORNET
+//2799,C1_HORN_SCARABA
+//2800,C2_HORN
+//2801,C3_HODREMLIN
+//2802,C4_HODE
+//2803,C5_HILL_WIND_1
+//2804,C1_HILL_WIND_1
+//2805,C2_HIGH_ORC
+//2806,C3_HARPY
+//2807,C4_HARPY
+//2808,C5_GREEN_IGUANA
+//2809,C1_GREATEST_GENERAL
+//2810,C2_GRAND_PECO
+//2811,C3_GRAND_PECO
+//2812,C4_GOLEM
+//2813,C5_GOBLIN_1
+//2814,C1_GOBLIN_1
+//2815,C2_GOAT
+//2816,C3_GOAT
+//2817,C4_GLD_KOBOLD_2
+//2818,C5_GLD_KOBOLD_2
+//2819,C1_GLD_DARK_SHADOW
+//2820,C2_GLD_DARK_SHADOW
+//2821,C3_GIANT_HONET
+//2822,C4_GHOUL
+//2823,C5_GHOUL
+//2824,C1_GEOGRAPHER
+//2825,C2_GEOGRAPHER
+//2826,C3_GARGOYLE
+//2827,C4_GARGOYLE
+//2828,C5_GALION
+//2829,C1_FUR_SEAL
+//2830,C2_FREEZER
+//2831,C3_FREEZER
+//2832,C4_FERUS_
+//2833,C5_FARMILIAR
+//2834,C1_FAKE_ANGEL
+//2835,C2_FABRE
+//2836,C3_FABRE
+//2837,C4_EXPLOSION
+//2838,C5_EVIL_DRUID
+//2839,C1_ELDER_WILOW
+//2840,C2_ELDER_WILOW
+//2841,C3_ECHIO
+//2842,C4_DUSTINESS
+//2843,C1_DRYAD
+//2844,C2_DROSERA
+//2845,C3_DROPS
+//2846,C4_DRILLER
+//2847,C5_DRAINLIAR
+//2848,C1_DRAGON_TAIL
+//2849,C2_DRACO
+//2850,C3_DOLOMEDES
+//2851,C4_DOKEBI
+//2852,C5_DISGUISE
+//2853,C1_DIMIK_1
+//2854,C2_DEVIRUCHI
+//2855,C3_DESERT_WOLF_B
+//2856,C4_DESERT_WOLF_B
+//2857,C5_DENIRO
+//2858,C1_DEATHWORD
+//2859,C2_DEATHWORD
+//2860,C3_DEATHWORD
+//2861,C4_DARK_PRIEST
+//2862,C5_DANCING_DRAGON
+//2863,C1_CREAMY
+//2864,C2_CORNUTUS
+//2865,C3_COOKIE
+//2866,C4_CONSTANT
+//2867,C5_COMODO
+//2868,C1_COCO
+//2869,C2_COCO
+//2870,C3_CLOCK
+//2871,C4_CLOCK
+//2872,C5_CHONCHON
+//2873,C1_CENTIPEDE
+//2874,C2_CENERE
+//2875,C3_CELIA
+//2876,C4_CATERPILLAR
+//2877,C5_CARAT
+//2878,C1_CARAMEL
+//2879,C2_BUNGISNGIS
+//2880,C3_BREEZE
+//2881,C4_BREEZE
+//2882,C5_BRADIUM_GOLEM
+//2883,C1_BLOOD_BUTTERFLY
+//2884,C3_BIGFOOT
+//2885,C4_BATHORY
+//2886,C5_BANSHEE_MASTER
+//2887,C1_BANSHEE
+//2888,C2_BANASPATY
+//2889,C3_ASSULTER
+//2890,C4_ARGOS
+//2891,C5_ARGIOPE
+//2892,C1_ARGIOPE
+//2893,C2_ARCLOUSE
+//2894,C3_ARCLOUSE
+//2895,C4_APOCALIPS
+//2896,C5_ANTLER_SCARABA
+//2897,C1_ANTIQUE_BOOK
+//2898,C2_ANTIQUE_BOOK
+//2899,C4_ANOLIAN
+//2900,C5_ANGRA_MANTIS
+//2901,C1_ANGRA_MANTIS
+//2902,C2_ANDRE
+//2903,C3_ANCIENT_MIMIC
+//2904,C4_ANACONDAQ
+//2905,C5_AMBERNITE
+//2906,C1_ALNOLDI
+//2907,C2_ALLIGATOR
+//2908,C3_ALIZA
+//2909,C4_ALICEL
+//2910,C5_ALARM
+//2911,C1_AGAV
+//2912,C2_ACIDUS_
+//2913,C3_ACIDUS_
+//2914,E_GEFFEN_MAGE_3_1
+//2915,HIDDEN_MOB6
+//2916,BIG_BEN
+//2917,BIG_BELL
+//2918,TIME_KEEPER
+//2919,NEO_PUNK
+//2920,ARC_ELDER
+//2921,OWL_VISCOUNT
+//2922,G_OWL_VISCOUNT
+//2923,OWL_MARQUEES
+//2924,T_ELDER_WILOW
+//2925,T_WILOW
+//2926,T_HARPY
+//2927,T_MINERAL
+//2928,T_GIBBET
+//2929,T_PLASMA_G
+//2930,T_SOLACE
+//2931,T_METALING
+//2932,T_POPORING
+//2933,T_DEVILING
+//2934,T_ARCHANGELING
+//2935,T_EVIL_CLOUD_HERMIT
+//2936,E_GHOSTRING
+//2937,M_LOKI
+//2938,MM_MAGIC_SEAL
+//2939,MM_EVIL_SHADOW1
+//2940,MM_EVIL_SHADOW2
+//2941,MM_EVIL_SHADOW3
+//2942,MM_EVIL_FANATICS
+//2943,MM_ICE_MINE
+//2944,J_HORNET
+//2945,J_MUMMY
+//2946,J_ANUBIS
+//2947,J_EGGYRA
+//2948,CURSED_SOLDIER
+//2949,CURSED_SENTINEL
+//2950,BROKEN_MIND
+//2951,FLOATING_WORD
+//2952,LIKE_LOVE
+//2953,CURSED_MEMORY
+//2954,COLORLESS_VOW
+//2955,OLD_FRIENDSHIP
+//2956,SWEET_SLAUGHTER
+//2957,FORGOTTEN_NAME
+//2958,FATAL_DAYS
+//2959,TORTUROUS_REDEEMER
+//2960,MM_FLAMECROSS
+//2961,E_TORTUROUS_REDEEMER
+//2962,E_DEVILING
+//2963,WOODIE
+//2964,EXP_1000
+//2965,TW_APOCALIPS_H
+//2966,TW_B_EREMES
+//2967,TW_B_HARWORD
+//2968,TW_B_SEYREN
+//2969,TW_BAPHOMET2
+//2970,TW_DARK_LORD
+//2971,TW_DARK_SNAKE_LORD
+//2972,TW_DOPPELGANGER
+//2973,TW_DRACULA
+//2974,TW_EDDGA
+//2975,TW_FALLINGBISHOP
+//2976,TW_GLOOMUNDERNIGHT
+//2977,TW_IFRIT
+//2978,TW_KTULLANUX
+//2979,TW_LORD_OF_DEATH2
+//2980,TW_MISTRESS
+//2981,TW_ORK_HERO2
+//2982,TW_OSIRIS2
+//2983,TW_RANDGRIS
+//2984,TW_TURTLE_GENERAL
+//2985,E_MYSTERIOUS_BUG
+//2986,J_XMAS_SMOKEY_GIFT
+//2987,XM_TREE
+//2988,XM_ANTONIO
+//2989,XM_COOKIE
+//2990,XM_CRUISER
+//2991,XM_MYSTCASE
+//2992,XM_LUDE
+//2993,XM_HYLOZOIST
+//2994,XM_MARIONETTE
+//2995,XM_TEDDY_BEAR
+//2996,XM_CELINE_KIMI
+//2997,G_XM_CELINE_KIMI
+//2998,EP14_MORS_EVENT
+//2999,EP14_MORS_BOSSA
+//3000,EP14_MORS_BOSSB
+//3001,EP14_MORS_MOB1
+//3002,EP14_MORS_MOB2
+//3003,EP14_MORS_MOB3
+//3004,EP14_MORS_MOB4
+//3005,EP14_MORS_MOB5
+//3006,EP14_MORS_MOB6
+//3007,EP14_MORS_DUMMY
+//3008,EP14_MORS_HIDDEN
+//3009,EP14_3_DEATH_BOSS
+//3010,EP14_3_DEATH_A_MOB1
+//3011,EP14_3_DEATH_A_MOB2
+//3012,EP14_3_DEATH_A_MOB3
+//3013,EP14_3_DEATH_B_MOB1
+//3014,EP14_3_DEATH_B_MOB2
+//3015,EP14_3_DEATH_B_MOB3
+//3016,EP14_3_DEATH_C_MOB1
+//3017,EP14_3_DEATH_C_MOB2
+//3018,EP14_3_DEATH_C_MOB3
+//3019,CELINE_KIMI
+//3020,FIRE_CONDOR
+//3021,FIRE_SAND_MAN
+//3022,FIRE_FRILLDORA
+//3023,FIRE_GOLEM
+//3024,14_3_MERCENARY_A
+//3025,14_3_MERCENARY_B
+//3026,FIREPIT
+//3027,FULBUK
+//3028,SONIA
+//3029,GRIM_REAPER_ANKOU
+//3030,STANDING_SOUL
+//3031,MUTANT_NECROMANCER
+//3032,MUTANT_GHOUL
+//3033,MUTANT_OSIRIS
+//3034,MUTANT_ARCHER_SKELETON
+//3035,MUTANT_WRAITH_DEAD
+//3036,MUTANT_VERIT
+//3037,MUTANT_LUDE
+//3038,HIDDEN_MOB7
+//3039,B_MOROCC_1
+//3040,B_MOROCC_2
+//3041,B_MOROCC_4
+//3042,WATERMELON_17
+//3043,WATERMELON_18
+//3044,WATERMELON_19
+//3045,WATERMELON_20
+//3046,WATERMELON_21
+//3047,WATERMELON_22
+//3048,WATERMELON_23
+//3049,WATERMELON_24
+//3050,WATERMELON_25
+//3051,WATERMELON_26
+//3052,WATERMELON_27
+//3053,WATERMELON_28
+//3054,WATERMELON_29
+//3055,WATERMELON_30
+//3056,WATERMELON_31
+//3057,WATERMELON_32
+//3058,WATERMELON_33
+//3059,EIGHT_DIVISION
+//3060,E_QUESTION_OCTOPUS
+//3061,E_ANGRY_MIMIC
+//3062,GIANT_DEVIRUCHI
+//3063,DEVIRUCHI_W
+//3064,GIANT_DEVIRUCHI_W
+//3065,E_ICE_MINE
+//3066,SNAKE_NEWYEAR
+//3067,E_ORC_WOMAN
+//3068,E_PYTHON_SKIN
+//3069,PERE1
+//3070,PERE2
+//3071,PERE3
+//3072,PERE4
+//3073,GRAND_PERE
+//3074,TIMEHOLDER
+//3075,WA_TREASURE
+//3076,WA_MONSTER_1
+//3077,WA_MONSTER_2
+//3078,WA_MONSTER_3
+//3079,WA_MONSTER_4
+//3080,WA_MONSTER_5
+//3081,WA_MONSTER_6
+//3082,WA_MONSTER_7
+//3083,WA_MONSTER_8
+//3084,WA_MONSTER_9
+//3085,WA_MONSTER_10
+//3086,WA_MERCENARY
+//3087,M_NYDHOG
+//3088,MM_BRINARANEA_BABY
+//3089,MM_LOCO_KASA
+//3090,MM_LOCO_SALAMANDER
+//3091,MM_BRINARANEA
+//3092,MM_MUSPELLSKOLL
+//3093,MM_BRINARANEA_CORE
+//3094,MM_MUSPELLSKOLL_CORE
+//3095,MM_GOD_SHADOW
+//3096,MM_MOROCC_KID
+//3097,MM_MOROCC_ADT
+//3098,MM_MOROCC_ORIGIN
+//3099,MM_MOROCC_REST
+//3100,MM_MANA_BLACK
+//3101,MM_MANA_WHITE
+//3102,MM_MANA_RED
+//3103,MM_MANA_YELLOW
+//3104,MM_MANA_BLUE
+//3105,MM_GB_MOROCC_1
+//3106,MM_GB_MOROCC_4
+//3107,E_EASTER_BUNNY
+//3108,JITTERBUG1
+//3109,JITTERBUG2
diff --git a/db/re/mob_skill_db.txt b/db/re/mob_skill_db.txt
index 5ba654c93..662754b4b 100644
--- a/db/re/mob_skill_db.txt
+++ b/db/re/mob_skill_db.txt
@@ -5884,8 +5884,8 @@
2086,Rake Scaraba@NPC_STONESKIN,attack,675,3,10000,1000,30000,no,self,myhpltmaxrate,50,,,,,,6,
2086,Rake Scaraba@NPC_STONESKIN,chase,675,3,10000,1000,30000,no,self,myhpltmaxrate,50,,,,,,6,
2086,Rake Scaraba@PF_SPIDERWEB,chase,405,1,300,0,10000,yes,target,always,0,,,,,,7,
-2086,Rake Scaraba@NPC_EMOTION,chase,197,1,1000,0,5000,yes,self,always,0,19,0x81,,,,,
-2086,Rake Scaraba@NPC_EMOTION,idle,197,1,3000,0,5000,yes,self,always,0,6,0x3095,,,,,
+2086,Rake Scaraba@NPC_EMOTION,chase,197,1,1000,0,5000,yes,self,always,0,19,0x181,,,,,
+2086,Rake Scaraba@NPC_EMOTION,idle,197,1,3000,0,5000,yes,self,always,0,6,0x3195,,,,,
2087,Queen Scaraba@AL_HEAL,attack,28,11,10000,0,5000,no,friend,friendhpltmaxrate,60,,,,,,3,
2087,Queen Scaraba@AL_HEAL,attack,28,11,10000,0,5000,no,self,myhpltmaxrate,30,,,,,,3,
2087,Queen Scaraba@AL_HEAL,chase,28,11,10000,0,5000,no,friend,friendhpltmaxrate,60,,,,,,3,
@@ -6428,14 +6428,17 @@
2137,Miming@NPC_SILENCEATTACK,chase,178,2,500,700,5000,no,target,always,0,,,,,,32,
2138,Nydhogg's Memory@NPC_TALK,idle,682,10,2500,0,10000,yes,self,always,0,,,,,,,35
2138,Nydhogg's Memory@NPC_TALK,attack,682,10,10000,0,30000,yes,self,always,0,,,,,,,35
+2138,Nydhogg's Memory@NPC_SUMMONSLAVE,idle,196,1,10000,0,0,no,self,onspawn,0,2139,,,,,,
2139,Nydhogg's Memory@NPC_TALK,idle,682,10,2500,0,10000,yes,self,always,0,,,,,,,36
2139,Nydhogg's Memory@NPC_TALK,attack,682,10,10000,0,30000,yes,self,always,0,,,,,,,36
2140,Nydhogg's Memory@NPC_TALK,idle,682,10,2500,0,10000,yes,self,always,0,,,,,,,37
2140,Nydhogg's Memory@NPC_TALK,attack,682,10,10000,0,30000,yes,self,always,0,,,,,,,37
+2140,Nydhogg's Memory@NPC_SUMMONSLAVE,idle,196,1,10000,0,0,no,self,onspawn,0,2141,,,,,,
2141,Nydhogg's Memory@NPC_TALK,idle,682,10,2500,0,10000,yes,self,always,0,,,,,,,38
2141,Nydhogg's Memory@NPC_TALK,attack,682,10,10000,0,30000,yes,self,always,0,,,,,,,38
2142,Nydhogg's Memory@NPC_TALK,idle,682,10,2500,0,10000,yes,self,always,0,,,,,,,39
2142,Nydhogg's Memory@NPC_TALK,attack,682,10,10000,0,30000,yes,self,always,0,,,,,,,39
+2142,Nydhogg's Memory@NPC_SUMMONSLAVE,idle,196,1,10000,0,0,no,self,onspawn,0,2143,,,,,,
2143,Nydhogg's Memory@NPC_TALK,idle,682,10,2500,0,10000,yes,self,always,0,,,,,,,40
2143,Nydhogg's Memory@NPC_TALK,attack,682,10,10000,0,30000,yes,self,always,0,,,,,,,40
diff --git a/db/re/skill_db.txt b/db/re/skill_db.txt
index ed4671c00..0bb63d7e9 100644
--- a/db/re/skill_db.txt
+++ b/db/re/skill_db.txt
@@ -38,7 +38,6 @@
// 0x1000- disable usage on enemies (for non-offensive skills).
// 0x2000- skill ignores land protector (e.g. arrow shower)
// 0x4000- chorus skill
-// 0x8000- skill wont be passed to clones
// 13 maxcount: max amount of skill instances to place on the ground when
// player_land_skill_limit/monster_land_skill_limit is enabled. For skills
// that attack using a path, this is the path length to be used.
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index ae5465bdf..aa3112d62 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
Binary files differ
diff --git a/npc/custom/breeder.txt b/npc/custom/breeder.txt
index a4452db68..bf7c34592 100644
--- a/npc/custom/breeder.txt
+++ b/npc/custom/breeder.txt
@@ -32,7 +32,7 @@ prontera,124,201,1 script Universal Rental NPC 726,{
message strcharinfo(0),"You do not meet requirements to rent.";
close; }
specialeffect2 EF_TEIHIT3;
- close;
+ end;
}
//============================================================
diff --git a/npc/custom/healer.txt b/npc/custom/healer.txt
index ab7eb9f55..5533330cd 100644
--- a/npc/custom/healer.txt
+++ b/npc/custom/healer.txt
@@ -30,7 +30,7 @@
specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
}
if (.@Delay) set @HD, gettimetick(2)+.@Delay;
- close;
+ end;
}
alberta,25,240,6 duplicate(Healer) Healer#alb 909
diff --git a/npc/merchants/buying_shops.txt b/npc/merchants/buying_shops.txt
index 89654f0cc..4532921bd 100644
--- a/npc/merchants/buying_shops.txt
+++ b/npc/merchants/buying_shops.txt
@@ -211,7 +211,7 @@ alberta_in,58,52,4 script Purchasing Team#Buying 59,{
mes "Okay, you're now approved to open the Bulk Buyer Shop.";
set Zeny,Zeny-10000;
getitem 6377,5; //Buy_Stall_Permit
- skill "ALL_BUYING_STORE",1,0;
+ skill "ALL_BUYING_STORE",1,3;
next;
mes "[Mr. Hugh]";
mes "Currently, only normal items ^8C2121EXCEPT^000000 equipment, certain potions, and hand-crafted items can be purchased in bulk, but this can still be very beneficial to you, depending on how you use it.";
diff --git a/npc/merchants/coin_exchange.txt b/npc/merchants/coin_exchange.txt
index a894485a8..c52db9787 100644
--- a/npc/merchants/coin_exchange.txt
+++ b/npc/merchants/coin_exchange.txt
@@ -13,6 +13,8 @@
//= 1.2 Optimized and merged into one file. [Euphy]
//============================================================
+// Manuk & Splendide
+//============================================================
- script ::merchant_13_2 -1,{
set .@n$, "["+strnpcinfo(1)+"]";
mes .@n$;
diff --git a/npc/other/fortune.txt b/npc/other/fortune.txt
index 9e0e1b6b4..485273f25 100644
--- a/npc/other/fortune.txt
+++ b/npc/other/fortune.txt
@@ -66,7 +66,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
set .@card_1_love,rand(1,74);
if (.@card_1_love == 1) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " You are afraid to show yourself working, to your loved one.. ";
mes " But that is not love. Do not be afraid to show different sides of yourself to your loved one.. ";
@@ -76,7 +76,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 2) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " Maybe you are using love as an excuse to work? The card is saying to try observing love from a different perspective. ";
next;
@@ -85,7 +85,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 3) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " How about taking a break from love and giving yourself time to relax.. I agree with what the card is saying. ";
next;
@@ -94,7 +94,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 4) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " A shovel..? ";
next;
@@ -107,7 +107,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 5) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " Its pure eyes look at a loved one but cannot recognize them, the wings flutter towards the loved one, but it helplessly stays in one place, ";
mes " it calls its loved one, but they cannot hear.. ";
@@ -118,7 +118,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 6) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The passion of love like a raging wave... You can't even hide it. ";
mes " With such passionate love, isn't there only one way..? ";
@@ -128,13 +128,13 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 7) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The teeth of dustiness are very strong. This means.. use your teeth for victory?! ";
next;
}
if (.@card_1_love == 8) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The card is telling me, 'Fly to your loved one as if you were a butterfly and shoot at it as if you were a star.' ";
mes "..even though it doesn't sound like something a moth would say. ";
@@ -144,7 +144,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 9) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " Perhaps the person you believe to be a butterfly is actually a moth. This fortune is awaiting a prudent judgement. ";
next;
@@ -153,7 +153,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 10) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " The one you love will give you a kiss of death. ";
mes " The irresistable kiss.. It is up to you to decide whether to avoid it or not. ";
@@ -163,7 +163,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 11) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " You are looking at a wonderful person, but their eyes are fixed in darkness. ";
mes " How about trying to grab their attention? ";
@@ -173,7 +173,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 12) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Your love needs fresh blood. Healthy exercises and eating habits are necessary! ";
mes " You must change your living pattern first. ";
@@ -183,7 +183,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 13) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Don't you think you are infatuated by outer appearance and gambling with love? You might have to be more careful about it this time. ";
next;
@@ -192,13 +192,13 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 14) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " Become a pirate of love! It is a simple, yet strong fortune! ";
next;
}
if (.@card_1_love == 15) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " No matter how romantic and beautiful love is, if it is not rightful, it is undesirable.. ";
mes " is what this card means. ";
@@ -208,7 +208,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 16) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " In the rough sea called the world, only pirates, the outlaws of love, are the law. ";
mes " This card supports strong love. ";
@@ -218,7 +218,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 17) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " It is a warning not to get involved in false love like pirated editions! ";
mes " You may have to reconsider your love right now. ";
@@ -228,7 +228,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 18) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " This is praising the type of love that is always there, yet barely has a form as if it does not exist. ";
mes " Are you involved this type of love? ";
@@ -238,7 +238,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 19) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " You must be careful. Love is quietly approaching and spreading poison. Be careful of the poison of love. ";
next;
@@ -247,7 +247,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 20) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " Aren't you already caught in love that you cannot run away from? Look around you. ";
mes " You might be captured inside invisible walls. ";
@@ -257,7 +257,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 21) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " This fortune is saying that love is.. approaching wobbly and softly~ and then bam~ embracing it. ";
mes " Very romantic. Hehe. ";
@@ -267,7 +267,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 22) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " This card is warning you to not treat your loved one like a puppet. ";
mes " You're not doing this, are you? ";
@@ -277,7 +277,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 23) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " Dolls understand a human's heart more than a human. Try treating your loved one as if they were a doll. ";
next;
@@ -286,7 +286,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 24) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " If you are afraid to look into a doll's eyes, that is because there is a dark shadow covering your love. ";
mes " Rid yourselves of that shadow. Then the doll will smile as well. ";
@@ -296,7 +296,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 25) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " Dolls become accustomed to the owner the more they are handled. Give your doll more attention. ";
mes " The doll is craving attention. A lot of attention. ";
@@ -306,7 +306,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 26) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " Do you fear the snake hair of a Medusa? However, love cannot be achieved with fear. ";
mes " You must move forward! ";
@@ -316,7 +316,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 27) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " Warriors that hastily attacked the Medusa all failed, but the one hero that used a mirror succeeded. ";
mes " You cannot succeed in love with brute force. You must use wisdom. ";
@@ -326,7 +326,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 28) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " Must you love the one that has hair of snakes? Reconsider this love and think about it earnestly. ";
next;
@@ -335,7 +335,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 29) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " It is a hint saying that a strong hairstyle is the key to turning over the situation. Change your hairstyle! ";
next;
@@ -344,7 +344,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 30) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " Love must have two things: great strength and the will to live. Have you thought about whether or not you can overcome this with your current self? ";
next;
@@ -353,7 +353,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 31) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " A scythe may seem burdensome but a strong Baphomet can freely use it. ";
mes " It is the same concept. If you are ready, any type of love is possible. There is no such thing as impossible. ";
@@ -363,7 +363,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 32) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " Love must have two things: great strength and the will to live. Have you thought about whether or not you can overcome this with your current self? ";
next;
@@ -372,7 +372,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 33) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " There are those who are born, destined to run into this wall, an obstacle. Your love seems to have reached that wall.. It must be hard. ";
next;
@@ -381,7 +381,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 34) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " This Baphomet looks as if it is having a hard time. The person must be exhausted even if it may not seem so. ";
next;
@@ -390,7 +390,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 35) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " Can't you hear the cry of the card? It is suffering. Love is like that.. ";
next;
@@ -399,7 +399,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 36) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " Your love right now is so bored that it is yawning. How about trying something fresh and new? ";
next;
@@ -408,7 +408,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 37) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " Deep sleep brings happiness and dreams. I think what you need right now is sleep. ";
next;
@@ -417,7 +417,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 38) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " I feel some sort of emptiness.. Maybe there is a gap in your love? ";
next;
@@ -426,7 +426,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 39) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Even a traditional beauty can seem cold to others. Try looking at your loved one from a different point of view. ";
next;
@@ -435,7 +435,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 40) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " They may seem dreary and ominous but their attire is spotless. They show devotion to the other. ";
mes " Even though you are not satisfied with your love right now, take a look at their attire. ";
@@ -445,7 +445,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 41) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " There is a person you must not deal with thoughtlessly nearby. Don't say or do anything carelessly. You must be careful when dealing with this person. ";
next;
@@ -454,7 +454,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 42) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Even if the wind blows and the trail of her clothes flutter, her posture never changes. Loving a person with that type of heart will bring goodwill and happiness. ";
next;
@@ -463,7 +463,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 43) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " That lightens and attacks with a pickaxe! You must aggressively move forward. What do you think? Your fortune is a good one. ";
next;
@@ -472,7 +472,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 44) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The card only shows gaunt bones, but notice how it has all the necessary tools?";
mes " Even though your love right now may seem as if there is nothing to it, it has everything you need. ";
@@ -482,7 +482,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 45) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " It has a lantern on its back and even in its hand.. it believes one light is insufficient. ";
mes " If you are only shining one type of light to your loved one, shining another might help. ";
@@ -492,7 +492,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 46) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " You know the smile of Mona Lisa.. Perhaps the person you are looking at has the same expression? ";
next;
@@ -501,7 +501,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 47) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " A knight on a horse is a fantasy in every person's heart. Make it so that this fantasy becomes real. ";
next;
@@ -510,7 +510,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 48) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " Is that soldier waiting to attack? I can feel great tension between the horse and knight. ";
mes " Don't run forward carelessly. Raise your sword and wait for your chance. ";
@@ -520,7 +520,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 49) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " He is falling asleep awaiting a battle. Is it because he is laid back, or simply pathetic? Depends on the situation I suppose. ";
mes " But you've got to give him credit for his boldness. ";
@@ -530,7 +530,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 50) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " Very favorable. It's to a point that I can feel strong energy from the card. I will give some of this energy to you. ";
next;
@@ -539,7 +539,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 51) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " What does the god of death have to say about love? It is something ominous for sure. ";
next;
@@ -548,7 +548,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 52) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " Hmm. How about giving a cute puppy as a gift? One with a round nose. Then they will surely be happy. ";
next;
@@ -557,7 +557,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 53) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " I can tell what it was doing from the way it is crying while holding an axe with blood. It is deeply wounded by love. ";
next;
@@ -566,7 +566,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 54) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The pattern of the clothes symbolizes a warning. It is saying to be careful of love. ";
next;
@@ -575,7 +575,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 55) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " He is a warning you not to drool over someone else. ";
next;
@@ -584,7 +584,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 56) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " Who is he so fiercly gazing at with those grand muscles? He is looking at someone else for sure. ";
next;
@@ -593,7 +593,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 57) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " Strengthen your body and observe the target. That is the step to success. ";
next;
@@ -602,7 +602,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 58) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " His navel is very pretty. You have to meet someone with that type of navel to be happy. ";
next;
@@ -611,7 +611,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 59) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " You'll get hurt if you mess around. This card is giving you a piece of advice. ";
next;
@@ -620,7 +620,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 60) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " From the way he is massaging its back because of a shoulder cramp, maybe your love is seeking someone to massage them. Love starts from little thoughts.";
next;
@@ -629,7 +629,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 61) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " His expression is in awe. When encountering an absurd incident, his face and expression becomes peculiarly distorted. ";
mes " I think the one you are looking towards has that type of expression. ";
@@ -639,13 +639,13 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 62) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " If the lover does something wrong he pokes them with a needle. How scary.. ";
next;
}
if (.@card_1_love == 63) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " A person's heart is like this card. If you flip it over nobody can tell what is behind it. Try turning the person's card over. ";
next;
@@ -654,7 +654,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 64) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Jokers are sly, but that is just because it is their habit. ";
mes " The reason the person may seem capricious or cunning is partially because they are born like that. ";
@@ -664,7 +664,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 65) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The joker can't use any of his strength because he is tied to a card. Perhaps the person is caught in something and can't show their true merit? ";
next;
@@ -673,7 +673,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 66) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Don't get fooled by tricks. They are a person, too. They know how to lie once in a while. Search for the trick calmly and carefully. ";
next;
@@ -682,7 +682,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 67) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " It is saying that daring action is necessary, such as that of the Hode that strikes up from the sand. ";
next;
@@ -691,7 +691,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 68) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Seeing that the Hode spits out sand to those who bother them, you must have done something to bother the person somehow. ";
next;
@@ -700,7 +700,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 69) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Hode has a very strong will to live. It is to survive in the forest. It is suggesting dating with that kind of will.";
next;
@@ -709,7 +709,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 70) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Ah.. there is a noble person up north. North it is. This direction will never change. ";
next;
@@ -718,7 +718,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 71) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " A walking bull is rare. The person you are looking towards is that rare. Don't let go of them. You may never see them again.. ";
next;
@@ -727,7 +727,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 72) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " Can you see the strong muscles that even arrows cannot pierce? The person is like that, too. ";
next;
@@ -736,7 +736,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 73) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " The scariest thing is not the hammer nor horn. It is the massive legs that support its heavy weight. Nobody can survive a hit by those legs. The person is also probably hiding the most dangerous part. ";
next;
@@ -745,7 +745,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_love == 74) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " No matter how fearful the bull may be, if it has a nose ring, it has already been tamed by humans. No matter how astonishing that person may be, taming is your responsibility. ";
next;
@@ -756,7 +756,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
mes "[Lhimetorra]";
mes " You seeked advice about love. ";
mes " Even if you may not pleased with it, consider it calmly and make an effort to find true happiness. ";
- cutin "°¡À̾ƽºÄ«µå",255;
+ cutin "°¡À̾ƽºÄ«µå",255;
next;
mes "[Lhimetorra]";
mes " Then... ";
@@ -768,7 +768,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
set .@card_1_money,rand(1,73);
if (.@card_1_money == 1) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " You must work hard to become wealthy. Don't think of other things.. Focus on and put effort into achieving your goals. ";
next;
@@ -777,7 +777,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 2) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " Something very rare may come your way. A gold mine has been the dream of many since ancient times. You have a gold mine right in front of you. ";
next;
@@ -786,7 +786,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 3) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " In the stomach pocket, there must be a secret treasure. There may be something in your pocket as well. ";
next;
@@ -795,7 +795,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 4) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " The card says that you should not be too greedy, for that may cause you to dig your own grave. ";
next;
@@ -804,7 +804,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 5) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " Did you know that a moth's wings has infinite amounts of powder on it? A moth symbolizes wealth in the sense that it can gather wealth just as the powder on its wings. ";
next;
@@ -813,7 +813,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 6) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " You must work hard to become wealthy. Don't think of other things. Simply focusing on your goals putting effort into it will help. ";
next;
@@ -822,7 +822,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 7) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " There is a common saying that when a moth flaps its wings, wealth will fly away as well. It's not a very good sign. ";
next;
@@ -831,7 +831,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 8) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " Dustiness teeth are very strong. This means.. ";
next;
@@ -840,7 +840,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 9) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " When a dustiness flies around, a big expense comes up. You may need to spend some money soon. ";
next;
@@ -849,7 +849,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 10) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Dracula brings in money. Maybe it is the moral influence from when it was a count. It is expensive to be a vampire, but I've never seen a poor one before. ";
next;
@@ -858,7 +858,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 11) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " To Dracula, money is not important. Blood is more valuable. To you, money must not be that important. You don't need to be concerned about money. ";
next;
@@ -867,7 +867,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 12) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Dracula mocks human's money. To him it is worthless. ";
next;
@@ -876,7 +876,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 13) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " No matter what, stealing is wrong! Even if a Drake blesses you in the name of pirates! Stealing is forbidden! ";
next;
@@ -885,7 +885,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 14) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " You will gather good fortune in a secretive and peculiar way.. Although, there seems to be shadows over some parts of your life. ";
next;
@@ -894,7 +894,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 15) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " The reason pirates indulge in others assets in the vast rough ocean, is because it is the only way to let the people of the land know of their existence. ";
next;
@@ -903,7 +903,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 16) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " Marina prefers clean funds. It hates suspicious money. Your possessions should be clean as well. ";
next;
@@ -912,7 +912,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 17) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " The Marina gathers money quietly, little by little, and freely roaming at the same time. That's the real way to make money. The Marina is suggesting this method to you. ";
next;
@@ -921,7 +921,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 18) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " The Marina is not interested in money. The card suggests that you will resemble these traits as well. You will enjoy life apart from money. ";
next;
@@ -930,7 +930,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 19) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " You will gather money swiftly and quietly, then boom~ blow it all at once. ";
next;
@@ -939,7 +939,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 20) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette treasures art over wealth. Bear that in mind. Honor over assets. ";
next;
@@ -948,7 +948,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 21) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette likes shiny money. Not dull money, but the shiny kind. ";
next;
@@ -957,7 +957,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 22) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette requires lots of money. Its expenditures are enormous. You must have many expenditures ahead of you. ";
next;
@@ -966,7 +966,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 23) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette uses a lot of money. There is someone around you that is like that, too. ";
next;
@@ -975,7 +975,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 24) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The hair of the Medusa symbolizes the amount of wealth. Seems as if something good will happen to you, young one. ";
next;
@@ -984,7 +984,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 25) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The hair of the Medusa are all snakes. Snakes symbolize greed and slyness. When gathering things, it seems as if a cunning force will join you. It's not exactly a bright sign.. ";
next;
@@ -993,7 +993,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 26) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa is strongly recommending saving. This card is telling you to save. It says to put many savings accounts in your hair and make yourself resemble its head shape. ";
next;
@@ -1002,7 +1002,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 28) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa does not enjoy playing with money. If you are attempting to use money other than the way it should be used, you should stop. Why? ";
next;
@@ -1011,7 +1011,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 29) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The great strength of the Baphomet brings in fortune. It seems as if you will be able to gather much wealth with the aid of the Baphomet's force! ";
next;
@@ -1020,7 +1020,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 30) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The scythe of the Baphomet means a strong tool to gather wealth. If you have a strong tool like his, it should be easy to gather wealth. ";
next;
@@ -1029,13 +1029,13 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 31) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " How about getting involved in raising cattle? It seems like you can gather much wealth through it. ";
next;
}
if (.@card_1_money == 32) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The Baphomet would like a tribute. He is saying that if you do, he will return great benefits. ";
next;
@@ -1044,7 +1044,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 33) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " The Sandman cries with sadness when money comes up. It is sad because money does not possess love or affection. ";
next;
@@ -1053,7 +1053,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 34) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " The Sandman is screaming because it saw too much money. It saw the money in the hands of your future. I wonder what all that money is? ";
next;
@@ -1062,7 +1062,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 35) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " The Sandman's body is empty inside. Your wallet seems to be emtpy, too. You should save up some money. ";
next;
@@ -1071,7 +1071,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 36) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " Money is like sand. Even if you save it, once the wind blows, it disappears. This card shows the emptiness of money. ";
next;
@@ -1080,7 +1080,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 37) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Sohee is wearing a fine article. To wear something like that, you would need plenty of money. Do you know what the secret is? Sohee saved very much when she was once alive. ";
next;
@@ -1089,7 +1089,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 38) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Sohee hates misers. She believes she has become like that because of a miser. Don't be stingy in front of Sohee! ";
next;
@@ -1098,7 +1098,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 39) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Sohee dislikes the wealthy. They try to gather money, but never use it for others. If you don't want to be cursed by Sohee, you need to learn how to be generous with money. ";
next;
@@ -1107,7 +1107,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 40) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Sohee likes foreign money. They are cute and pretty. If you have foreign currency, Sohee will love you. ";
next;
@@ -1116,7 +1116,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 41) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Those who work hard will gather great fortune. The Skeleton says diligent work will help greatly in gathering wealth. ";
next;
@@ -1125,7 +1125,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 42) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Its youth is gone after a lifetime of chasing after gold. It became a monster with only bones left. No matter how much you like money and your work, look after your life as well. ";
next;
@@ -1134,7 +1134,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 43) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " To become rich, you must work hard as if you became a skeleton. The Skeleton is saying to work hard until you become a skeleton. ";
next;
@@ -1143,7 +1143,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 44) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The Skeleton says that you can make money by going north. Go north. ";
next;
@@ -1152,7 +1152,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 45) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " A knight is a job that requires a lot of money. A hint of a big expense. You might want to tighten your belt. ";
next;
@@ -1161,7 +1161,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 46) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " Knights do not fight for money. If they did, they would be a mercenary. A knight reaches for something higher. What the knight wants to tell you is the way to live. ";
next;
@@ -1170,7 +1170,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 47) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " A knight values honor more than fortune. They consider discussing wealth itself dirty not worthy. How would you be able to ask such a knight a fortune about wealth? ";
next;
@@ -1179,7 +1179,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 48) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " You need to think of an ideal more noble than money. The fortune the knight suggests is this: Knights never speak of ways to make money. ";
next;
@@ -1188,7 +1188,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 49) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " Working hard is the only way to gather wealth; don't get sidetracked and put effort into working will help your fortune. ";
next;
@@ -1197,7 +1197,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 50) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " What does the god of death have to say about wealth? It is surely a bad omen. It is trying to warn something. ";
next;
@@ -1206,7 +1206,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 51) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis is very interested in the sacrifices offered. The offerings he likes are youth and effort. ";
next;
@@ -1215,7 +1215,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 52) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis is giving a warning of the west. There is a being there that can break away your wealth. ";
next;
@@ -1224,7 +1224,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 53) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis hates those who try to gather money for his death. He believes it's a waste of money. Don't make the mistake of gathering money for death. ";
next;
@@ -1233,7 +1233,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 54) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord possesses much wealth. It's because of greed. Greed is essential in collecting money. The desire and greediness to make money is not something to be ashamed about. Be diligent and go make money. ";
next;
@@ -1242,7 +1242,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 55) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord starts drooling about anything involving money. He targets anybody with money. ";
next;
@@ -1254,7 +1254,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 56) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " There should be great wealth awaiting in the direction the Orc Lord's horn is pointing. The card is directing towards.. ";
next;
@@ -1263,7 +1263,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 57) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord likes gold. Of all the treasures, gold is the best. Closely watch gold. ";
next;
@@ -1272,7 +1272,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 58) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack makes money through jokes. Others' happiness is the key to his wealth. ";
next;
@@ -1281,7 +1281,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 59) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack likes fun money. He detests sad and burdensome money. ";
mes " He always says this. Light-hearted and easy money isn't dangerous even if it piles up. ";
@@ -1291,7 +1291,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 60) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack thinks of money as a foolish item. But somehow he makes that kind of money. ";
mes " That's why those who are controlled by fools consider the other a fool, too. ";
@@ -1302,7 +1302,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 61) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack is asking for money. Don't be stingy about paying those who bring entertainment and fun. ";
next;
@@ -1311,7 +1311,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 62) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Do you know what a joker's specialty is? It is tricking others and making money. Be wary of the joker. ";
next;
@@ -1320,7 +1320,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 63) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The Joker says if you let him borrow money, he will repay you with more. You're going to refuse, right? But the Joker's temptation does not end after one try. ";
mes " He will linger around you as a neighbor, or a rare item and ask for money. ";
@@ -1330,7 +1330,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 64) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Even if a joker asks for change, never give any to him. He will ask for change, then end up ask for a big sum of money. ";
mes " Jokers are like that. They have the ability to turn a small mistake into a big calamity. ";
@@ -1340,7 +1340,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 65) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " There is only one reason a Joker requests money.. to take yours. ";
mes " His goal is not to become rich. A real foul playful one. ";
@@ -1350,7 +1350,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 66) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Hodes do not know about money. They just gobble everything up. But that might be the shortcut to gaining great wealth. ";
next;
@@ -1359,7 +1359,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 67) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Hodes do not know anything about money. But they do not forgive those who have an eye on their things. ";
mes " Not being greedy and taking care of your share is the wisest way to manage your wealth. ";
@@ -1369,7 +1369,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 68) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Hode knows nothing about money. But a very rare item drops from a Hode's body. ";
mes " It has a treasure in it without knowing. ";
@@ -1379,7 +1379,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 69) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Hodes are strong even though they live in the desert. Just because the environment is poor, doesn't mean that you can't gather wealth. ";
next;
@@ -1388,7 +1388,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 70) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " Do you know the saying that says those who work like bulls become rich? Working hard is the best way. ";
next;
@@ -1397,7 +1397,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 71) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " Bulls only know how to work, but the bull itself has a lot to offer. Meat, leather, horn.. ";
next;
@@ -1406,7 +1406,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 72) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " Bulls continue to work even on gloomy days. Then they can gather a lot of things. ";
next;
@@ -1415,7 +1415,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_money == 73) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " Bulls do not like working for money. They are disgruntled when others consider labor as money. ";
mes " Shouldn't you reconsider working against your will just for money? ";
@@ -1427,7 +1427,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
mes " Most people are curious about money. ";
mes " It is a very humanly and common curiosity. Cards are very stingy about fortunes regarding wealth. ";
next;
- cutin "°¡À̾ƽºÄ«µå",255;
+ cutin "°¡À̾ƽºÄ«µå",255;
mes "[Lhimetorra]";
mes " Therefore, getting a fortune like this is considered being lucky. Use this fortune to prosper. ";
break;
@@ -1438,7 +1438,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
set .@card_1_future,rand(1,67);
if (.@card_1_future == 1) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " Youth is not eternal. At one point when you wake up, you realize you are already a middle-aged worker. ";
mes " Even reminiscing about the past over a cup of coffee can't bring back time. ";
@@ -1448,7 +1448,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 2) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " This fortune is foreshadowing that you will become a strong and healthy worker in the future. ";
mes " Not a normal worker, but one that has great strength and might.. ";
@@ -1458,7 +1458,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 3) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " Smoking in a mine is an imprudent, life-threatening thing to do. You are wasting your precious life with that kind of behavior. ";
next;
@@ -1467,7 +1467,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 4) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " You may be shoveling in the future. In a dark dark place, shoveling that requires great strength. You must be careful young one. ";
next;
@@ -1476,7 +1476,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 5) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The moth is used when it is a caterpillar and ignored after it becomes a moth, by humans. ";
mes " Which is better? ";
@@ -1486,7 +1486,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 6) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The moth flies around without worrying about the future. It is telling you to fly freely rather than getting anxious about the future.. ";
next;
@@ -1495,7 +1495,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 7) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " Dustiness' teeth are very strong. This means... ";
next;
@@ -1504,7 +1504,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 8) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The moth says that this is not a time to think about wealth and prosperity. It says that someone important has appeared near you. ";
next;
@@ -1513,7 +1513,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 9) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " Dustiness symbolizes a hazy future. It is similar to your mind right now. It says it is obvious. ";
mes " It says that there is no set path in the future. Isn't a relief in a way? ";
@@ -1523,7 +1523,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 10) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Sometime in your future, a future like Dracula awaits you. ";
next;
@@ -1532,7 +1532,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 11) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " If the condition is just right, vampires can live forever. But, when that perfect condition is disrupted, they meet a tragic end. ";
next;
@@ -1541,7 +1541,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 12) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " The Dracula says to be true to the present. Indeed, thinking and being true to the present is much more important than trying to figure out your future. ";
next;
@@ -1550,7 +1550,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 13) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " Pirates do not have a future. That doesn't mean you do not have one. But.. you simply need to make more prudent decisions. ";
next;
@@ -1559,7 +1559,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 14) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " In this world, being a pirate out in the rough seas is very dangerous. But, they do not regret their decisions. ";
next;
@@ -1568,7 +1568,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 15) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " Pirates are remembered as pirates even after they pass away. A person's name is beyond the matter of life and death. ";
next;
@@ -1577,7 +1577,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 16) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " The Marina does not think of its future.. But I can tell you one thing. Survival. The Marina only thinks about survival and life. ";
next;
@@ -1586,7 +1586,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 17) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " The Marina doesn't think of its future.. but I can tell you one thing. Freedom. The Marina swims freely. ";
next;
@@ -1595,7 +1595,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 18) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " Leave your future to the Marina. The Marina treasures its precious ocean. The sea will be of great significance in your future, too. ";
next;
@@ -1604,7 +1604,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 19) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " A Marionette is a Marionette forever. Its past and future never changes. Its present is its future. Don't you think it is rather sad? ";
next;
@@ -1613,7 +1613,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 20) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " A Marionette is restrained but it has hope that it will be freed one day. ";
next;
@@ -1622,7 +1622,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 21) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The eyes of a Marionette symbolize 'challenge.' Challenge will mean a lot in your future. ";
next;
@@ -1631,7 +1631,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 22) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette believes the present is more important than the future. Basically, asking about the future is pointless. ";
next;
@@ -1640,7 +1640,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 23) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa symbolizes the absolute one who accepts everyone's challenge. Your future will be in a position that is challenged by many. ";
next;
@@ -1649,7 +1649,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 24) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa symbolizes the absolute one who accepts everyone's challenge. Your future must be filled with challenges! ";
next;
@@ -1658,7 +1658,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 25) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa says that there will be great chaos in the future. Chaos... I'm not sure what type of chaos it means, but it is definitely something that has never happened before. ";
next;
@@ -1667,7 +1667,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 26) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The hair of the Medusa are sticking up. It is nervous about the big change that is going to happen. A change that even makes the scary Medusa worried. ";
next;
@@ -1676,7 +1676,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 27) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The Baphomet doesn't care about a human's future. They simply observe quietly. Hmm... It seems like it has nothing to say about your future as well... ";
next;
@@ -1685,7 +1685,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 28) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The scythe the Baphomet is holding signifies the strong will to conquer the future. ";
mes " What you need is not someone else's help or wisdom, but strong willpower. ";
@@ -1695,7 +1695,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 29) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The Baphomet says that humans have no future. It says that their greed and selfishness shows no hope. ";
mes " The future will only open to those that go beyond human's greed. ";
@@ -1705,7 +1705,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 30) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The Baphomet is facing the future. No matter how much effort you put in, without an eye that looks towards the future, it is pointless. ";
mes " The Baphomet is telling you to look towards the future. ";
@@ -1715,7 +1715,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 31) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " A sand's future is simply sand. Not a rock, nor mud. Some things just don't change young one. ";
next;
@@ -1724,7 +1724,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 32) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " A sand dune changes its shape even after a day. The Sandman card is speaking of a future with many changes. ";
next;
@@ -1733,7 +1733,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 33) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " You will have a son in the future. Hmm? What'd you say? No plans for a baby? ";
next;
@@ -1742,7 +1742,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 34) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " There are rare and precious treasures in the sand. The Sandman says that in the vast sand of the world, a treasure, will be discovered. That treasure is you young one.";
next;
@@ -1751,7 +1751,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 35) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Do you know what a Sohee thinks the most pitiful thing is? The future. It is because she was not able to live her future. ";
mes " That is why you cannot bring up the subject of future in front of Sohee. I'm very sorry I cannot help. ";
@@ -1761,7 +1761,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 36) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Even in darkness you will shine for your goal. ";
mes " The Skeleton is encouraging you to not lose your light even in a life in dark and damp places. ";
@@ -1771,7 +1771,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 37) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The story I heard from the skeleton goes like this. I am the king of the future. What in the world is that supposed to mean? ";
next;
@@ -1780,7 +1780,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 38) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " If you want to do something great in the future, you must express your thankfulness to the Skeleton. ";
mes " Then the Skeleton will help you. How do you express your thankfulness? ";
@@ -1791,7 +1791,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 39) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The Skeleton has the ability to dig where it feels the future, rather than looking into it. ";
mes " It is digging in the east right now. How about it, won't you try going there? ";
@@ -1801,7 +1801,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 40) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " A knight's future leads to death. An honorable death on the battlefield. ";
mes " One cannot live as a knight without being proud of that type of future. ";
@@ -1812,7 +1812,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 41) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " A knight commenting about a person's future is very rare. ";
mes " It says nothing for you in particular. Nothing ominous. ";
@@ -1822,7 +1822,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 42) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " A knight commenting about a person's future is very rare. ";
mes " It says it will say one thing for you. Dark clouds can be seen beyond the clear skies. ";
@@ -1832,7 +1832,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 43) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " It is necessary to reflect upon the past and present in order to look into the future. This card says to look carefully into your past. ";
next;
@@ -1841,7 +1841,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 44) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " What does the god of death want to say about the future? It is definitely an ominous sign. ";
next;
@@ -1850,7 +1850,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 45) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis likes comedy despite people's expectations. It looks forward to comedy. Comedy must be important in the future. ";
next;
@@ -1859,7 +1859,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 46) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis is the god of death, but it expresses more interest in the future than death. ";
next;
@@ -1868,7 +1868,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 47) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis says it has no interest in you. It is a good sign. ";
next;
@@ -1877,7 +1877,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 48) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord says that dairy farming will develop in the future. Why don't you invest in it as well? ";
next;
@@ -1886,7 +1886,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 49) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord says you need great strength in the future. Strength that is three, four times greater than now. ";
next;
@@ -1895,7 +1895,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 50) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord says that love for your companions will become great strength in the future. ";
mes " Your strength is not enough. ";
@@ -1905,7 +1905,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 51) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord is expressing opposition in being too curious about the future. ";
mes " Pay a little more attention to the present. ";
@@ -1915,7 +1915,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 52) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack says something interesting will happen in the future. According to him, the future will be more fun than the present. ";
next;
@@ -1924,7 +1924,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 53) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack says, in order to prepare for the future, a delightful preparation is necessary. ";
mes " Delightful preparation? I don't understand.. I suppose I am too old. Maybe young ones get it.. ";
@@ -1934,7 +1934,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 54) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack is jealous because a splendid person is headed your way in the future. ";
mes " I wonder what type of person it is to make that Jack jealous! ";
@@ -1944,7 +1944,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 56) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack says you may be frustrated in the future. ";
mes " He says to overcome the frustration, it is necessary to think of happy thoughts. ";
@@ -1954,7 +1954,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 57) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The Joker is trying to trick you. This card has all different types of ominous fortunes. ";
mes " He wants to enjoy watching you tremble with anxiety. ";
@@ -1964,7 +1964,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 58) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Jokers don't just appear and go away. They come back in the future. ";
mes " They will seduce you numerous times. ";
@@ -1975,7 +1975,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 59) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Do you see the thing that looks like a leaf flying around the Joker? That is the spade mark. ";
mes " Spades means death. Jokers leave those kinds of marks on purpose. ";
@@ -1985,7 +1985,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 60) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Joker offers a nice insurance and says to prepare for the future, but most of it is a waste of time. ";
next;
@@ -1994,7 +1994,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 61) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Hodes do not know about tomorrow. But though they are quiet, they endanger other living things. ";
mes " Effort into oneself puts great power into the mere existence of one. ";
@@ -2004,7 +2004,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 62) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Hodes do not know about tomorrow, but they still know about death. ";
mes " Even though you may be honest and simple, in a time of a crisis, you must be alert. ";
@@ -2014,7 +2014,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 62) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Hodes do not ponder about life, but their will to live is very strong.";
mes " You can gain a lot simply through the will to hold on to life. ";
@@ -2024,7 +2024,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 63) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " Hodes are afraid of crises. You should try not to be afraid of crises either. ";
next;
@@ -2033,7 +2033,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 64) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " Before, bulls used to be thought of as foolishly honest workers, but these days bulls are great strong fighters. ";
next;
@@ -2042,7 +2042,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 65) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " Do bulls leave leather when they pass away? Or was it the tiger? ";
mes " Anyways, he is jealous of the humans that leave their name in history. ";
@@ -2053,7 +2053,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 66) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " It might seem funny that a bull will look into the future, but the bull is looking into your future right now. ";
mes " He says your future is mixed with storms and fall weather. ";
@@ -2063,7 +2063,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_future == 67) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " The bull thinks of the happiness awaiting in the future, but it doesn't like reduced efficiency because of that happiness. ";
next;
@@ -2076,7 +2076,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
mes " Speaking of the future is as dangerous act. ";
mes " Humans may face disaster if speaking of the future carelessly. That's why we ask cards about the future. ";
next;
- cutin "°¡À̾ƽºÄ«µå",255;
+ cutin "°¡À̾ƽºÄ«µå",255;
mes "[Lhimetorra]";
mes " Your fortune is a rather good one. There are some in this world who get more horrible fortunes. ";
mes " Use this fortune as a support in your life. Ok? ";
@@ -2088,7 +2088,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
set .@card_1_warning,rand(1,70);
if (.@card_1_warning == 1) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " Do you see the forbidden mark on its shoulder? It is telling you to not do something. ";
next;
@@ -2097,7 +2097,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 2) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " Someone is after you. The person is very strong like the picture. They might be holding grudges against you. ";
next;
@@ -2106,19 +2106,19 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 3) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " It is saying to be careful not to burn your mustache with a cigarette. When you do something, something is always at risk.. It is probably warning about that. ";
next;
}
if (.@card_1_warning == 4) {
- cutin "°¡À̾ƽºÄ«µå",4;
+ cutin "°¡À̾ƽºÄ«µå",4;
mes "[Lhimetorra]";
mes " 'Be careful of shoveling'.. You might get hit by a shovel. Should you be careful around a construction site? ";
next;
}
if (.@card_1_warning == 5) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The sound of a moth's wings fluttering means chaos. A chaotic event may occur around you. ";
next;
@@ -2127,7 +2127,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 6) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " Be aware of the wings. Wings symbolize flight, adventure, and fickleness of a player. ";
next;
@@ -2136,43 +2136,43 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 7) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The teeth of Dustiness are very strong. This means.. Someone may attempt to bite you with their teeth?! ";
next;
}
if (.@card_1_warning == 8) {
- cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
+ cutin "´õ½ºÆ¼³×½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The moth's warning: 'Dangerous!'. A very simple, yet obvious warning. ";
next;
}
if (.@card_1_warning == 9) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Dracula says, 'Be careful in the streets at night.' ";
next;
}
if (.@card_1_warning == 10) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Dracula says, 'Don't be too picky.' ";
next;
}
if (.@card_1_warning == 11) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Dracula says, 'Brush your teeth 3 times a day.' Make sure you brush your teeth! ";
next;
}
if (.@card_1_warning == 12) {
- cutin "µå¶óÅ¥¶óÄ«µå",4;
+ cutin "µå¶óÅ¥¶óÄ«µå",4;
mes "[Lhimetorra]";
mes " Dracula says, 'Study the important points first.' Cramming will not work! ";
next;
}
if (.@card_1_warning == 13) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " If you see the flag of a pirate, either run or do as they say. Pirates do not give more than one warning. ";
next;
@@ -2181,7 +2181,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 14) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " Pirates give warnings about many things. But right now, this card is speaking of betrayal. ";
next;
@@ -2190,25 +2190,25 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 15) {
- cutin "µå·¹ÀÌÅ©Ä«µå",4;
+ cutin "µå·¹ÀÌÅ©Ä«µå",4;
mes "[Lhimetorra]";
mes " The pirate is warning you of your beauty. Don't show off your beauty too much. Pirates are very jealous of appearance, as well. ";
next;
}
if (.@card_1_warning == 16) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " The Marina is warning of a hot stinging poison. Be cautious of poison. ";
next;
}
if (.@card_1_warning == 17) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " The Marina is warning about a lazy lifestyle. It says such a lifestyle will lead to something like itself. ";
next;
}
if (.@card_1_warning == 18) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " The Marina doesn't really think about anything else.. But it will say one thing. Food. The Marina loves food. ";
next;
@@ -2217,20 +2217,20 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 19) {
- cutin "¸¶¸®³ªÄ«µå",4;
+ cutin "¸¶¸®³ªÄ«µå",4;
mes "[Lhimetorra]";
mes " The Marina is warning about a big belly. It's not happy because it resembles itself.. How about losing some weight? ";
next;
}
if (.@card_1_warning == 20) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette says that you must not rely on violence and to use a different method. ";
mes " I'm not quite sure, but it may become an important word of advice to you..? ";
next;
}
if (.@card_1_warning == 21) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette is warning about ominous activities. If you did something recently, you should settle it soon. ";
next;
@@ -2239,7 +2239,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 22) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette's eyes are warning about your falsehood. Lies, deceit, fake calculations and actions.. The Marionette is warning about all of them. ";
next;
@@ -2248,7 +2248,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 23) {
- cutin "¸¶¸®¿À³×Ʈīµå",4;
+ cutin "¸¶¸®¿À³×Ʈīµå",4;
mes "[Lhimetorra]";
mes " The Marionette is emphasizing a proper diet. Don't rely too much on meat. ";
next;
@@ -2257,7 +2257,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 24) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa punishes those who challenge it without warning. Unexpected punishment. ";
next;
@@ -2266,7 +2266,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 25) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa is warning you to be nice to others, or else it will turn you into stone.";
next;
@@ -2275,7 +2275,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 26) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa is warning you to return anything you borrow on time. ";
mes " Saying it will not forgive those who use other's things like a black hole.. borrowing and never returning ";
@@ -2285,7 +2285,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 27) {
- cutin "¸ÞµÎ»çÄ«µå",4;
+ cutin "¸ÞµÎ»çÄ«µå",4;
mes "[Lhimetorra]";
mes " The Medusa is warning about a person near you. Of their existence.. and the relationship, ";
next;
@@ -2294,7 +2294,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 28) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The Baphomet says to beware when intervening with others' issues. ";
next;
@@ -2303,7 +2303,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 29) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The Baphomet is warning about arrogance. Even a strong and wise warrior must show respect to a Baphomet, ";
mes " Arrogance takes away that respect. The Baphomet hates that type of arrogance. ";
@@ -2313,7 +2313,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 30) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The Baphomet is warning about the laziness that stops one from sharpening the scythe. ";
mes " That laziness will cause you to lose your life in an instant. ";
@@ -2323,13 +2323,13 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 31) {
- cutin "¹ÙÆ÷¸ÞƮīµå",4;
+ cutin "¹ÙÆ÷¸ÞƮīµå",4;
mes "[Lhimetorra]";
mes " The Baphomet says it has nothing to say. I wonder why? Isn't it a very good sign?!! ";
next;
}
if (.@card_1_warning == 32) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " Sand is an instant cure of athlete's foot. He says to beware of athlete's foot and that he hates those rubbing their infected feet into his body. ";
next;
@@ -2338,7 +2338,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 33) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " A chicken puts sand in its mouth to aid its insufficient digestion system. ";
mes " The Sandman says to watch out before you become like a chicken. ";
@@ -2348,7 +2348,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 34) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " The Sandman says over-sleepers will be punished by society! ";
next;
@@ -2357,7 +2357,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 35) {
- cutin "»÷µå¸ÇÄ«µå",4;
+ cutin "»÷µå¸ÇÄ«µå",4;
mes "[Lhimetorra]";
mes " One warning from the Sandman, respect your parents. ";
next;
@@ -2366,7 +2366,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 36) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Sohee dislikes stinky feet. Don't forget to wash your feet. ";
next;
@@ -2375,7 +2375,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 37) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Sohee stands on the tip of her toes. It is because her toes are very strong. ";
mes " No matter what a person does, physical strength is the most important. Exercise and get stronger. ";
@@ -2385,7 +2385,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 38) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Look at Sohee's hairstyle. Isn't it splendid. ";
mes " Sohee likes to take care of her appearance. If you don't, Sohee will get mad at you. ";
@@ -2396,7 +2396,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 39) {
- cutin "¼ÒÈñÄ«µå",4;
+ cutin "¼ÒÈñÄ«µå",4;
mes "[Lhimetorra]";
mes " Once, Sohee didn't get her change back when she asked a baby ghost to run an errand. ";
mes " No can do! Always return the change. ";
@@ -2406,7 +2406,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 40) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Even though it is a skeleton with only bones, it has all the safety gear needed. ";
next;
@@ -2415,7 +2415,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 41) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The skeleton card has a gray tone. If you read the grey, you can see the darkness. ";
mes " It seems like darkness is on its way. Be careful, this darkness isn't ordinary. ";
@@ -2425,7 +2425,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 42) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The skeleton is warning you about an irregular eating pattern. ";
mes " It says it became like that because of a bad eating habit. ";
@@ -2435,7 +2435,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 43) {
- cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
+ cutin "½ºÄÌ¿öÄ¿Ä«µå",4;
mes "[Lhimetorra]";
mes " The skeleton's pickaxe is very strong. Even though its body seems weak, with the right tools, it can do great things. ";
next;
@@ -2444,14 +2444,14 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 44) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " The knight is warning you of reckless driving. Do you ride a Pecopeco by any chance? ";
mes " Anyhow, you should avoid reckless driving.. If a knight is saying that, it is a big problem. ";
next;
}
if (.@card_1_warning == 45) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " The knight is warning you of cruelty. It could be yours or that of someone around you. ";
next;
@@ -2460,7 +2460,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 46) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " The misfortune shown in the knight card is hastiness. That is also what takes away a knight's life, too. ";
next;
@@ -2470,7 +2470,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 47) {
- cutin "½ºÄ̳ªÀÌƮīµå",4;
+ cutin "½ºÄ̳ªÀÌƮīµå",4;
mes "[Lhimetorra]";
mes " This knight is warning you of loneliness. He doesn't have a person to help his horse, ";
mes " nor a lover awaiting him, so loneliness hits him in the heart. ";
@@ -2480,7 +2480,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 48) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The warning of the god of death is death itself. ";
next;
@@ -2489,7 +2489,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 49) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis says to be careful of darkness. In darkness, death lingers in the dark. ";
next;
@@ -2498,7 +2498,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 50) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis doesn't like foul language. You don't have a foul mouth, do you? ";
mes " Watch your mouth. The Anubis is after those that say foul language.";
@@ -2508,7 +2508,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 51) {
- cutin "¾Æ´©ºñ½ºÄ«µå",4;
+ cutin "¾Æ´©ºñ½ºÄ«µå",4;
mes "[Lhimetorra]";
mes " The Anubis is warning you of hatred. Hatred only brings upon death. ";
mes " The Anubis must not like being busy these days. ";
@@ -2518,7 +2518,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 52) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord is warning you of self-righteousness. It is the most dangerous noxious bug that will feed on you. ";
next;
@@ -2527,7 +2527,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 53) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord is warning you about freedom. Isn't freedom a good thing? ";
mes " Not always! Too much freedom can lead to self-indulgence! ";
@@ -2537,7 +2537,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 54) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord warning you of the opposite sex. Yes. They are poisonous. Keep your distance. ";
next;
@@ -2546,7 +2546,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 55) {
- cutin "¿ÀÅ©·ÎµåÄ«µå",4;
+ cutin "¿ÀÅ©·ÎµåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Orc Lord is warning about destruction. He knows destruction very well because he is a master of destruction. ";
next;
@@ -2555,7 +2555,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 56) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack is warning you of lame jokes. When he finds one saying them, he tends to hit them with his stick. ";
next;
@@ -2564,7 +2564,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 57) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " Jack is warning you about others' anger and that anger takes away happiness and kills a joke. ";
next;
@@ -2573,7 +2573,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 58) {
- cutin "ÀèÄ«µå",4;
+ cutin "ÀèÄ«µå",4;
mes "[Lhimetorra]";
mes " It seems like Jack is worried about excessive jokes. ";
mes " Jokes are fun, but too much will turn you into a ghost like him. ";
@@ -2583,7 +2583,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 59) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Jokers enjoy giving opposite warnings. He says to enjoy sleeping in.";
next;
@@ -2592,7 +2592,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 60) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Jokers enjoy giving opposite warnings. He says to enjoy a midnight snack. ";
next;
@@ -2601,7 +2601,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 61) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Jokers enjoy giving opposite warnings. ";
mes " He says if someone has something you want, make it yours. ";
@@ -2611,7 +2611,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 62) {
- cutin "öĿīµå",4;
+ cutin "Á¶Ä¿Ä«µå",4;
mes "[Lhimetorra]";
mes " Joker enjoys giving opposite warnings. ";
mes " What he is telling you is to not fear death. ";
@@ -2621,7 +2621,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 63) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Hode can forgive others, but not those who hurt it. ";
mes " You should also only not forgive those who hurt you. ";
@@ -2631,7 +2631,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 64) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Hode is warning you of voracious eating that made it sluggish. ";
mes " Eating is good, but the wild is a dangerous place. Leave your stomach partially empty. ";
@@ -2641,7 +2641,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 65) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Hode is warning you of voracious eating that made it sluggish. ";
mes " Eating is good, but the wild is a dangerous place. Leave your stomach partially empty.";
@@ -2651,7 +2651,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 66) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " If you are to the point of being warned by a Hode.. you must be one considerable person. ";
next;
@@ -2660,7 +2660,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 67) {
- cutin "È£µåÄ«µå",4;
+ cutin "È£µåÄ«µå",4;
mes "[Lhimetorra]";
mes " The Bull warns of corruption. A lazy hedonist that is not diligent. ";
mes " He believes that is like a cancer cell that can't be removed. ";
@@ -2670,7 +2670,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 68) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " The bull is warning about ignorance about a crisis. ";
mes " Not knowing that a crisis is a crisis is the most dangerous of all. ";
@@ -2680,7 +2680,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 69) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " The bull is warning of something that will make life sad. ";
mes " Sadness is a natural feeling, but don't let that put you down. ";
@@ -2691,7 +2691,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
next;
}
if (.@card_1_warning == 70) {
- cutin "Ȳ¼ÒÄ«µå",4;
+ cutin "Ȳ¼ÒÄ«µå",4;
mes "[Lhimetorra]";
mes " The bull is warning about meat from watered cows. ";
mes " Saying that, that type of behavior will surely bring upon monsters' curses. ";
@@ -2703,7 +2703,7 @@ payon_in03,117,128,5 script Fortune Teller 704,{
mes "[Lhimetorra]";
mes " A warning is always a useful fortune. You can never lose anything. ";
next;
- cutin "°¡À̾ƽºÄ«µå",255;
+ cutin "°¡À̾ƽºÄ«µå",255;
mes "[Lhimetorra]";
mes " I hope you will be able to avoid misfortune with this warning. Then... ";
close;
@@ -2770,142 +2770,142 @@ payon_in03,75,129,5 script Poring Fortune Teller 704,{
mes "[Chocarle]";
set .@card_2_love,rand(1,33);
if (.@card_2_love == 1) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Oh! Your lover is about to leave your side! Hold on tight! ";
}
if (.@card_2_love == 2) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Agh! You're about to give your soul to your loved one! Take it down a notch! ";
}
if (.@card_2_love == 3) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " No! Your heart is about to leave your love! Catch it! ";
}
if (.@card_2_love == 4) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Love is like juice in the forest! It is refreshing! Take care of your loved one! ";
}
if (.@card_2_love == 5) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Uh! You didn't share your juice with your loved one! What a shame! Take care of your loved one! ";
}
if (.@card_2_love == 6) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Why not share with your loved one? Don't be too greedy and try to keep it all! ";
}
if (.@card_2_love == 7) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " Your love is going to have a crisis! Protect your love! ";
}
if (.@card_2_love == 8) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " Hee! Go after your love like a mole! Puhahaha! ";
}
if (.@card_2_love == 9) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " Oh no! Your love is in danger! Run away from the menace! ";
}
if (.@card_2_love == 10) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " Oh no! You lost your loved one. And, nobody similar around you. Cheer up! ";
}
if (.@card_2_love == 11) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " Ah! A sexy rival has appeared! Don't get sidetracked! ";
}
if (.@card_2_love == 12) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " You are desperately searching for love! If you go beyond this desert, you can find love! ";
}
if (.@card_2_love == 13) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Prepare an event of love! They will be flying with happiness! ";
}
if (.@card_2_love == 14) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Love is sweet! Be careful not to get cavities! ";
}
if (.@card_2_love == 15) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Prepare a present for your love! They might get a heart attack because they will be overwhelmed with happiness! ";
}
if (.@card_2_love == 16) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " Don't be shy in front of your loved one! Love transcends everything! ";
}
if (.@card_2_love == 17) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " Embrace every aspect of your loved one! That is true love! ";
}
if (.@card_2_love == 18) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " Love will blossom with a totally different person! Wow, so cool! ";
}
if (.@card_2_love == 19) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " No matter what other people say, run towards your loved one! One-track love! ";
}
if (.@card_2_love == 20) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " Go to your loved one with a present! They will be very happy! ";
}
if (.@card_2_love == 21) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " Love requires health and strength! Exercise to become stronger! Power and love! ";
}
if (.@card_2_love == 22) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Even if you wish to approach your loved one, your body is discomforted! Take a break and rest! ";
}
if (.@card_2_love == 23) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Love is bending yourself for someone! Service! Sacrifice! ";
}
if (.@card_2_love == 24) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " You will be meeting your lover's parents! Prepare well! ";
}
if (.@card_2_love == 25) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Your relationship must be very happy as it seems you two are flying amongst the clouds! Very jealous! ";
}
if (.@card_2_love == 26) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Make an opportunity to be alone with each other! It will bring much happiness! ";
}
if (.@card_2_love == 27) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Uh oh! Someone is peeping at your love! Go scold them! ";
}
if (.@card_2_love == 28) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " Love blossoms from the foundation! Be true to the basics! ";
}
if (.@card_2_love == 29) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " When your loved one is hurt, be by them! They will be very happy! ";
}
if (.@card_2_love == 30) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " One day, when you wake up, your loved one will leave a present! Be happy! ";
}
if (.@card_2_love == 31) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " Give lots~~ of presents to your loved one! Then you will experience many~ many good things! ";
}
if (.@card_2_love == 32) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " Lean against a wall and await your love! *Boom* Love will appear! ";
}
if (.@card_2_love == 33) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " You must be lonely! It's ok, cheer up! ";
}
next;
mes "[Chocarle]";
mes " A fortune of love was told! What do you think! Do you like it? ";
mes " Even if you did not get the fortune you wished for, don't be do upset and simply go for your love! ";
- cutin "°¡À̾ƽºÄ«µå",255;
+ cutin "°¡À̾ƽºÄ«µå",255;
next;
mes "[Chocarle]";
mes " Then, see you next time~~~~~ ";
@@ -2918,135 +2918,135 @@ payon_in03,75,129,5 script Poring Fortune Teller 704,{
mes "[Chocarle]";
set .@card_2_study,rand(1,33);
if (.@card_2_study == 1) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Agh! Don't die from studying! Take breaks while you're at it! You need some rest! ";
}
if (.@card_2_study == 2) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Oh, no! You're missing the main points! Figure out the essentials! ";
}
if (.@card_2_study == 3) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Mmph! You're dying not to study! At times like this, a break is the best! ";
}
if (.@card_2_study == 4) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Studying is just like hunting a monster in the desert. Resting for a little is the best. Understand? ";
}
if (.@card_2_study == 5) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " A nice cup of cold juice under the hot sun! Studying should be done like that, too! ";
}
if (.@card_2_study == 6) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Even though it is the desert, you seem to have a relaxed smile! Maybe you need to relax like this when studying as well! ";
}
if (.@card_2_study == 7) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " Your grades are in danger! You must study harder! ";
}
if (.@card_2_study == 8) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " There may be a big crisis! Don't get too stressed just because you can't study! ";
}
if (.@card_2_study == 9) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " It is saying studying in the dark night can be dangerous! Careful when studying at night! ";
}
if (.@card_2_study == 10) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " Studying came to a strange place! It needs to find its original path! You can do it! ";
}
if (.@card_2_study == 11) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " You're gazing at a smart friend with the eyes of a Poring! Heehee! Doing good! ";
}
if (.@card_2_study == 12) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " Eh? You're too smart! You're at a much higher level than your friends! Take a break! ";
}
if (.@card_2_study == 13) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " You will be rewarded for your accomplishments! It was worth the effort! ";
}
if (.@card_2_study == 14) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Forget about studying for a moment and enjoy the party! It should be refreshing~! ";
}
if (.@card_2_study == 15) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Study something that will make people happy! Future set! ";
}
if (.@card_2_study == 16) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " If you're not sure of something, ask a friend! It's not something to be ashamed about! You can do it! ";
}
if (.@card_2_study == 17) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " Don't think that your head is empty! Because, you are smart! You can do it! ";
}
if (.@card_2_study == 18) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " There's a phenomenon you don't understand! Do a little more research! You'll be able to figure it out soon! ";
}
if (.@card_2_study == 19) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " Don't get lazy about studying wherever you go! Seek the road of truth and go down it to find the answer! ";
}
if (.@card_2_study == 20) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " You need strength to study! Get stronger! Running is a start! ";
}
if (.@card_2_study == 21) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " You will become an admirable person because of all the effort put into studying! You must feel very worth while! ";
}
if (.@card_2_study == 22) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Try studying the history of our country! From when the tiger started smoking! ";
}
if (.@card_2_study == 23) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " You must be having a hard time studying because of all the pressure! Go out and get some fresh air! ";
}
if (.@card_2_study == 24) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Your head seems to be heavy because of studying! You need a diversion! Put studying aside for a moment! ";
}
if (.@card_2_study == 25) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Try studying aerospace or meteorology! Don't you think it would be fun? ";
}
if (.@card_2_study == 26) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " How about studying theology? You even get to study about angels! ";
}
if (.@card_2_study == 27) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Study little by little and make yourself feel lighter! You can't study if you're overloaded with words! ";
}
if (.@card_2_study == 28) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " When studying, you should have a snack! It may seem trivial, but it is rather important! ";
}
if (.@card_2_study == 29) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " Even when you are sick, don't forget about studying! Where there is effort, there is bound to be good results! ";
}
if (.@card_2_study == 30) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " Newton discovered gravity through a falling apple! Be wary of even the little things in your surroundings! ";
}
if (.@card_2_study == 31) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " Green is good for studying! Color your walls green or get a green drink! The lucky color! Green! ";
}
if (.@card_2_study == 32) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " There is a jewel in your mind! You need to bring all the wisdom to life! Don't study bad things! ";
}
if (.@card_2_study == 33) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " You will receive good results from studying! You can focus on your current studies! ";
}
next;
@@ -3066,135 +3066,135 @@ payon_in03,75,129,5 script Poring Fortune Teller 704,{
mes "[Chocarle]";
set .@card_2_buddy,rand(1,33);
if (.@card_2_buddy == 1) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Ah! Your friend has gone crazy! They need the heal of friendship! ";
}
if (.@card_2_buddy == 2) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Mmm! You both have gone crazy. You must overcome it through conversations! ";
}
if (.@card_2_buddy == 3) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Agh! You are suffering because of your friend! Try opening your heart and be more lenient! ";
}
if (.@card_2_buddy == 4) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " You even split a pea between friends! Don't be so cruel. Reflect upon yourself and apologize! ";
}
if (.@card_2_buddy == 5) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Oh no! Your friend is ignoring you! Offer a bottle of juice to your friend! Your friendship may come back? ";
}
if (.@card_2_buddy == 6) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Eh!? What kind of friendship is this?! Hurry up and make up! ";
}
if (.@card_2_buddy == 7) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes "Oh no?! This person is not your friend, but an enemy! You must be careful! ";
}
if (.@card_2_buddy == 8) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " Your friend is in danger! You must help your friend! ";
}
if (.@card_2_buddy == 9) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " Your friendship is on the verge of falling apart! Cast a shield around your friendship! ";
}
if (.@card_2_buddy == 10) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " One person is left out amongst your friends! Be more friendly! ";
}
if (.@card_2_buddy == 11) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " Your friend hit you! Don't cry even if it may hurt! Hurry and make up! ";
}
if (.@card_2_buddy == 12) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " You must be alone! It must be hard to make friends! Try putting on a brighter face! ";
}
if (.@card_2_buddy == 13) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Give your friends a present! Your friendship will become deeper! ";
}
if (.@card_2_buddy == 14) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Prepare a hat to cover your friend's large head! They will be moved by your care! ";
}
if (.@card_2_buddy == 15) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " A friend is waiting for you! Be nice to your friend! ";
}
if (.@card_2_buddy == 16) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " Being close friends despite differences is true friendship! Shelter each other's differences! ";
}
if (.@card_2_buddy == 17) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " Your misunderstandings will be removed if you take the time to talk! Go have a conversation with your friend! ";
}
if (.@card_2_buddy == 18) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " When a friend is sick, visit them! They will be happy! For sure! ";
}
if (.@card_2_buddy == 19) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " Go out and have some fun with your friend! Your friendship will surely get stronger! ";
}
if (.@card_2_buddy == 20) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " Give your friend a present! They'll go bragging around town?! ";
}
if (.@card_2_buddy == 21) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " Share your bone with your friend! Sacrifices in friendship are beautiful! ";
}
if (.@card_2_buddy == 22) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Do anything for your friend! With all your heart and soul! Your friend will be delighted! ";
}
if (.@card_2_buddy == 23) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " No smoking, even with a friend! Stop smoking for your health! ";
}
if (.@card_2_buddy == 24) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " You and your friend will encounter hardships! Combine your powers and overcome it! ";
}
if (.@card_2_buddy == 25) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Go on a trip with your friend! Friendship can get stronger in new environments! ";
}
if (.@card_2_buddy == 26) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Give your friend a ride in a plane! They'll probably fly with joy!? ";
}
if (.@card_2_buddy == 27) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Don't forget your friend in heaven! Friendship is eternal! ";
}
if (.@card_2_buddy == 28) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " Help your friend's scar. Your friend would greatly appreciate it! ";
}
if (.@card_2_buddy == 29) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " You even split a slice of an apple among friends! Share more things with your friend! Something good will happen! ";
}
if (.@card_2_buddy == 30) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " When your friend is sleeping, think of them! Then there will be progress in your friendship! What do you think~ it means~?! ";
}
if (.@card_2_buddy == 31) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " Don't measure friendship with money! If you do, be careful for there will be a crack in your friendship! ";
}
if (.@card_2_buddy == 32) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " It seems as if your friend will give you many presents! Look forward to it! ";
}
if (.@card_2_buddy == 33) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " You must be lonely without a friend! A good friend will come along soon! ";
}
next;
@@ -3214,135 +3214,135 @@ payon_in03,75,129,5 script Poring Fortune Teller 704,{
mes "[Chocarle]";
set .@card_2_future,rand(1,33);
if (.@card_2_future == 1) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Oh no! You are not confident about the future! Trust yourself a little more! Hope! ";
}
if (.@card_2_future == 2) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Oh! Do you keep on thinking about your death in the future! First, forget about death and live your life! ";
}
if (.@card_2_future == 3) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Cut! You are filled with uncertainty about the future! Let's get rid of this! Wee! It's gone! ";
}
if (.@card_2_future == 4) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Life may seem like a hot and dry desert, but in the future, delicious juice and rest awaits you! ";
}
if (.@card_2_future == 5) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Even in a hot and dry desert, isn't the future happier since you can encounter sweet juice? Put forth your strength! ";
}
if (.@card_2_future == 6) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Don't your troubles disappear watching a poring smile? Your future must be filled with good things! ";
}
if (.@card_2_future == 7) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " There is danger waiting ahead! You should avoid it for now! Take care of yourself! ";
}
if (.@card_2_future == 8) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " You must be fearing your future!? Don't worry too much! Think of happy thoughts! ";
}
if (.@card_2_future == 9) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " You may endanger someone in the future! Don't become a bad person~! ";
}
if (.@card_2_future == 10) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " You may have to stand alone in the future! Prepare yourself right now! ";
}
if (.@card_2_future == 11) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " Many hardships await you in the future! But you can overcome them! ";
}
if (.@card_2_future == 12) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " You might not even be able to buy summer clothes in the future! Don't waste your money! ";
}
if (.@card_2_future == 13) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Something exciting may happen! What can it be? Fun! Fun! ";
}
if (.@card_2_future == 14) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Something good might happen on this nice day! You can look forward to it! Yay! ";
}
if (.@card_2_future == 15) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " A splendid event will be held! Go get ready! Look forward to it! ";
}
if (.@card_2_future == 16) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " You will meet someone new! It will be very interesting! ";
}
if (.@card_2_future == 17) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " If you go little by little, something good will happen! Sit and take a look around you! ";
}
if (.@card_2_future == 18) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " You get a headache from thinking about the future? Empty your mind! You will feel refreshed! ";
}
if (.@card_2_future == 19) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " You will become a respectable person in the future! Good job! ";
}
if (.@card_2_future == 20) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " I can see you working hard in the future! What a lively future! ";
}
if (.@card_2_future == 21) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " You have a very busy future! Take care of your health! ";
}
if (.@card_2_future == 22) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Pick a job where you can work with other people! It will be very rewarding, right? ";
}
if (.@card_2_future == 23) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Try doing some volunteer work! It is worthwhile and you will feel good about it, too! ";
}
if (.@card_2_future == 24) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " You may become a commander! Mmm~! Kind of scary! ";
}
if (.@card_2_future == 25) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Choose a job that involves flying! You show potential! ";
}
if (.@card_2_future == 26) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Scrumptious ice cream that could even be eaten in heaven! Challenge yourself and get involved in a job making things of that sort! ";
}
if (.@card_2_future == 27) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " In the future, things that cannot be done right now will be accomplished! You can look forward to it! ";
}
if (.@card_2_future == 28) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " Little things in life will bring you happiness and joy in the future! Even more than now! ";
}
if (.@card_2_future == 29) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " Do what you have to do. Live life to the fullest, even though the world may end tomorrow! ";
}
if (.@card_2_future == 30) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " You will deal with fruits in the future! How about preparing yourself? ";
}
if (.@card_2_future == 31) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " Your future self will encounter a high wall! Although, I'm not sure what type of building it may be! ";
}
if (.@card_2_future == 32) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " Green symbolizes peace! Your future seems as if it will be very peaceful! It's a good thing, right? ";
}
if (.@card_2_future == 33) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " Romance lays ahead in your future! Relax yourself and prepare yourself! ";
}
next;
@@ -3364,135 +3364,135 @@ payon_in03,75,129,5 script Poring Fortune Teller 704,{
mes "[Chocarle]";
set .@card_2_fortune,rand(1,33);
if (.@card_2_fortune == 1) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Uh oh! You're about to be robbed! You must save a little first! ";
}
if (.@card_2_fortune == 2) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Kek! Your mind goes blank when you think about money! Think of other thoughts! Forget about money for a while! ";
}
if (.@card_2_fortune == 3) {
- cutin "°í½ºÆ®¸µÄ«µå",4;
+ cutin "°í½ºÆ®¸µÄ«µå",4;
mes " Bah! This isn't a time to think about money. Calm down and put your mind at ease! ";
}
if (.@card_2_fortune == 4) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " If you look carefully, it is not drinking juice, but underground water through a straw in the ground! Money is hidden where nobody expects! Good luck searching! ";
}
if (.@card_2_fortune == 5) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " As you can quench your thirst in the dry desert, you can gather money even in this difficult world! ";
}
if (.@card_2_fortune == 6) {
- cutin "µå·ÓÇýºÄ«µå",4;
+ cutin "µå·ÓÇÁ½ºÄ«µå",4;
mes " Just like the juice inside the needles of a cactus, you can still gather wealth though you may be in anguish. You can do it! ";
}
if (.@card_2_fortune == 7) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes "Agh! Someone is after your possessions! Be careful! ";
}
if (.@card_2_fortune == 8) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " Uh oh! Someone is after your money! Take good care of it! ";
}
if (.@card_2_fortune == 9) {
- cutin "¸ÇƼ½ºÄ«µå",4;
+ cutin "¸ÇƼ½ºÄ«µå",4;
mes " It says you might be tempted to do something bad to gather money! Don't forget about a kind heart! ";
}
if (.@card_2_fortune == 10) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " You have hidden money in your clothes! Hidden rich one! Be careful not to be caught! ";
}
if (.@card_2_fortune == 11) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " In the future, it seems like you will be kicking money around with your feet like those Porings! Congratulations! ";
}
if (.@card_2_fortune == 12) {
- cutin "¹«³«Ä«µå",4;
+ cutin "¹«³«Ä«µå",4;
mes " You must be exhausted! Making money is not the easiest thing to do! But it will be that much more valuable! ";
}
if (.@card_2_fortune == 13) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Your tendency to spend money is growing! Be careful! Don't be left empty-handed! ";
}
if (.@card_2_fortune == 14) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Use your money to buy something fun! Then good luck will be headed your way! ";
}
if (.@card_2_fortune == 15) {
- cutin "»êŸÆ÷¸µÄ«µå",4;
+ cutin "»êŸÆ÷¸µÄ«µå",4;
mes " Use your money on something exciting! It looks as if good luck will be headed your way! ";
}
if (.@card_2_fortune == 16) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " It seems like you will have two lucky offerings! Don't miss these two opportunities! ";
}
if (.@card_2_fortune == 17) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " Doesn't it seem like there should be money in the small wallet? You will have some small income! Save money wisely! ";
}
if (.@card_2_fortune == 18) {
- cutin "¼ÖÄÌÅæÄ«µå",4;
+ cutin "¼ÖÁ®½ºÄÌÅæÄ«µå",4;
mes " So~ empty. Upsetting, but don't worry too much about money! Something better ought to happen! ";
}
if (.@card_2_fortune == 19) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " Someone will return something you lost! What a relief! ";
}
if (.@card_2_fortune == 20) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " No need to worry about osteoporosis! Wasn't it a good thing to eat so much calcium? Oops! This isn't about money?! ";
}
if (.@card_2_fortune == 21) {
- cutin "½ºÄÌ·¹ÅæÄ«µå",4;
+ cutin "½ºÄÌ·¹ÅæÄ«µå",4;
mes " Seeing that you work so hard, seems like you will make lots of money! Congratz~! ";
}
if (.@card_2_fortune == 22) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Even if you save money, it disappears like smoke. Don't get too caught up with it! ";
}
if (.@card_2_fortune == 23) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " It's hard to make money, isn't it? But don't forget the good deeds in life! ";
}
if (.@card_2_fortune == 24) {
- cutin "¿¡µå°¡Ä«µå",4;
+ cutin "¿¡µå°¡Ä«µå",4;
mes " Going around to collect money might lead you to a scary person! Be very careful! ";
}
if (.@card_2_fortune == 25) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Forget about money and fly~fly! You will feel very refreshed! ";
}
if (.@card_2_fortune == 26) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Money is like clouds! Instead of money, think about a happy life! ";
}
if (.@card_2_fortune == 27) {
- cutin "¿£Ã©¸µÄ«µå",4;
+ cutin "¿£Á©¸µÄ«µå",4;
mes " Even if it may seem pointless, if you persist, you will be able to make lots of money! You can do it! ";
}
if (.@card_2_fortune == 28) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " Don't neglect the trivial things on the floor! If you keep an open heart like that, you will be able to collect money! ";
}
if (.@card_2_fortune == 29) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " If you work with something that is related to mushrooms or apples, a good fortune awaits you! What kind of work would that be? ";
}
if (.@card_2_fortune == 30) {
- cutin "Æ÷¸µÄ«µå",4;
+ cutin "Æ÷¸µÄ«µå",4;
mes " How can you think of money looking at such a peaceful card! That's not nice! Sniff..sniffles! Anyhow, it seems like you will gather much fortune! ";
}
if (.@card_2_fortune == 31) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " You have many fine stones! You will prosper if you are involved in this industry! ";
}
if (.@card_2_fortune == 32) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " It is an indication that you will prosper! No need to worry now! ";
}
if (.@card_2_fortune == 33) {
- cutin "Æ÷Æ÷¸µÄ«µå",4;
+ cutin "Æ÷Æ÷¸µÄ«µå",4;
mes " You will collect many treasures! But the problem is protecting all of it! ";
}
next;
diff --git a/npc/other/gympass.txt b/npc/other/gympass.txt
index 33e4a8f3e..2991e6d84 100644
--- a/npc/other/gympass.txt
+++ b/npc/other/gympass.txt
@@ -77,7 +77,7 @@ payon,173,141,4 script Ripped Cabus#GymPass 899,{
mes "training together like this.";
delitem 7776,1; //Max_Weight_Up_Scroll
set gympassmemory,.@add_carry;
- skill "ALL_INCCARRY",.@add_carry,0;
+ skill "ALL_INCCARRY",.@add_carry,3;
close;
}
else {
@@ -133,7 +133,7 @@ payon,173,141,4 script Ripped Cabus#GymPass 899,{
mes "muscles grew back,";
mes "just like that! Try not to";
mes "wimp out again, okay?";
- skill "ALL_INCCARRY",gympassmemory,0;
+ skill "ALL_INCCARRY",gympassmemory,3;
close;
}
else {
diff --git a/npc/re/cities/dicastes.txt b/npc/re/cities/dicastes.txt
index f755a797e..6bab75559 100644
--- a/npc/re/cities/dicastes.txt
+++ b/npc/re/cities/dicastes.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Gennosuke Kouga, Muad_Dib
//===== Current Version: =====================================
-//= 1.2
+//= 1.2a
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
@@ -12,6 +12,7 @@
//= 1.0 First version.
//= 1.1 Standardized. [Euphy]
//= 1.2 Updated to match the official script. [Joseph]
+//= 1.2a Moved Guide to a separate file. [Euphy]
//============================================================
dicastes01,194,159,5 script Excited Galten#a 492,{
diff --git a/npc/re/cities/malangdo.txt b/npc/re/cities/malangdo.txt
index ce853dc5f..f6fd3f14d 100644
--- a/npc/re/cities/malangdo.txt
+++ b/npc/re/cities/malangdo.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Muad_Dib
//===== Current Version: =====================================
-//= 1.2
+//= 1.3
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
@@ -22,50 +22,50 @@
mes "Hey~! Hi human~ This is Mr. Dolangmal. kakaka~";
next;
mes "[Dolangmal]";
- mes "We are sent to here to take you to the heaven of cat, ^A2314BMeow Meow Island^000000.";
+ mes "We are sent to here to take you to the heaven of cats, ^A2314BMalangdo^000000.";
next;
mes "[Dolangmal]";
- set .@s$,"Why don't you go to ^A2314BMeow Meow Island^000000? ";
+ set .@s$,"Why don't you go to ^A2314BMalangdo^000000?";
switch(atoi(strnpcinfo(2))) {
- case 1: mes "How is that? Crowd people in Prontera is good, but why don't you go our heaven of the cat, ^A2314BMeow Meow Island^000000?"; break;
- case 2: mes "Why don't you go to ^A2314BMeow Meow Island^000000? That place is better than geffen where only simple honest wizards are crowded."; break;
- case 3: mes "Fresh air Payon is not bad, but why don't you go better palce the heaven of the cat, ^A2314BMeow Meow Island^000000?"; break;
- case 4: mes .@s$+"The beautiful and quiet place is better than Aldebaran where is so noisy with ticktock sound of clock."; break;
- case 5: mes .@s$+"The beautiful and quiet place is better than Morroc where is so hot and sandstorm?"; break;
- case 6: mes .@s$+"The beautiful place is better than Yuno where are full of headache books."; break;
- case 7: mes .@s$+"The complex place is better than Rachel where is too queit horribly?"; break;
- case 8: mes .@s$+"The safety place is better than Lighthanlzen where is too dangerous."; break;
- case 9: mes .@s$+"The smell of sea place is better than Mora where is full of grass smell."; break;
+ case 1: mes "How is that? The crowded city of Prontera is good, but why don't you go our heaven of the cats, ^A2314BMalangdo^000000?"; break;
+ case 2: mes "Why don't you go to ^A2314BMalangdo^000000? That place is better than Geffen, where there are only crowds of simple honest wizards."; break;
+ case 3: mes "The fresh air of Payon is not bad, but why don't you go better place like the heaven of the cats, ^A2314BMalangdo^000000?"; break;
+ case 4: mes .@s$+"The beautiful and quiet place is better than Aldebaran, where it's so noisy with the tick-tock sound of the clock."; break;
+ case 5: mes .@s$+"The beautiful and quiet place is better than Morroc, with its heat and sandstorms."; break;
+ case 6: mes .@s$+"The beautiful place is better than Yuno, which is full of books and headaches."; break;
+ case 7: mes .@s$+"The complex place is better than Rachel, where it's too horribly quiet."; break;
+ case 8: mes .@s$+"The safe place is better than Lighthanlzen, which is too dangerous."; break;
+ case 9: mes .@s$+"The smell of this sea place is better than Mora, which is full of a grassy smell."; break;
}
next;
- if(select("No:^A2314BMeow Meow Island^000000~ Go~ Go~") == 1) {
+ if(select("No:^A2314BMalangdo^000000~ Go~ Go~") == 1) {
mes "[Dolangmal]";
- mes "What!? You don't want to go ^A2314BMeow Meow Island^000000? Chet!";
+ mes "What!? You don't want to go ^A2314BMalangdo^000000? Chet!";
next;
mes "[Dolangmal]";
- mes "You such an annoying guy. If you don't go, why did you talk to me... but...";
+ mes "You're such an annoying guy. If you don't go, why did you talk to me... but...";
next;
mes "[Dolangmal]";
- mes "^9E1837Admiral Thomas^000000 said kidnapping human.. No.. Bring them politely?";
+ mes "^9E1837Admiral Tomas^000000 said to kidnap humans... No... Bring them politely?";
next;
mes "[Dolangmal]";
- mes "Anyway I got you. Whenever you want to go, just tell me.";
+ mes "Anyway, I got you. Whenever you want to go, just tell me.";
close;
}
mes "[Dolangmal]";
- mes "Ok! I like your attitude with full of passion.";
+ mes "Ok! I like your attitude. Full of passion.";
next;
mes "[Dolangmal]";
- mes "Now, before you go ^A2314BMeow Meow Island^000000, let me tell you some detail of caution.";
+ mes "Now, before you go ^A2314BMalangdo^000000, let me give you some warnings.";
next;
mes "[Dolangmal]";
- mes "First!! It is natural thing. When you arrive on the ^A2314BMeow Meow Island^000000, should notify that you are here to ^9E1837Admiral Thomas^000000..";
+ mes "First!! It is natural that when you arrive on ^A2314BMalangdo^000000, you should notify ^9E1837Admiral Tomas^000000 that you are here.";
next;
mes "[Dolangmal]";
- mes "If you don't do that, you might be attacked by scary and wild cats when you walk on dark street.";
+ mes "If you don't do that, you might be attacked by scary and wild cats when you walk through dark streets.";
next;
mes "[Dolangmal]";
- mes "Secondly!! This ^A2314BMeow Meow Island^000000 is absolutely our island of cat even though we open to the human.";
+ mes "Secondly!! This ^A2314BMalangdo^000000 is absolutely our island of cats, even though we open to humans.";
next;
mes "[Dolangmal]";
mes "We have a personality... no... no... respect us like one catality because we are cats.";
@@ -73,73 +73,77 @@
mes "[Dolangmal]";
mes "And the next one is...";
next;
- mes "Dolangmal must say that just say some cautions, but he said 100 kinds of cautions.";
+ mes "Dolangmal proceeds and gives hundreds of warnings.";
next;
mes "[Dolangmal]";
- mes "Ok! That is all for cautions!! It's easy and simple cautions... how is that? Can you keep this all?";
+ mes "Ok! Those are all the warnings!! They're easy and simple... right? Can you remember them?";
next;
- if(select("Keep this cautions:Can't keep this cautions") == 2) {
+ switch(select("Remember his warnings:Can't remember")) {
+ case 1:
+ mes "[Dolangmal]";
+ mes "Ok! Do not bite two mice with one mouth. ^9E1837Admiral Tomas^000000 is located at the ^A2314Bcenter of the ship in Malangdo^000000.";
+ next;
+ mes "[Dolangmal]";
+ mes "Don't forget to give him notice of your arrival.";
+ next;
+ mes "[Dolangmal]";
+ mes "Alright. Let's go to the heaven of the cats, ^A2314BMalangdo^000000~";
+ setquest 5091;
+ completequest 5091;
+ warp "malangdo",217,85;
+ close;
+ case 2:
mes "[Dolangmal]";
- mes "What!? Can't you keep this easy rule? Chet!";
+ mes "What!? Can't you keep these easy rules? Chet!";
next;
mes "[Dolangmal]";
- mes "You such an annoying guy. If you can't keep this, why did not tell me during the conversation. I told you everything..tierd.. but..";
+ mes "You're such an annoying guy. If you can't keep these, why didn't you tell me during our conversation? I told you everything... but..";
next;
mes "[Dolangmal]";
- mes "^9E1837Admiral Thomas^000000 said kidnapping human.. No.. Bring them politely?";
+ mes "^9E1837Admiral Tomas^000000 said to kidnap humans... No... Bring them politely?";
next;
mes "[Dolangmal]";
- mes "Anyway I got you. Just tell me whenever you want to go.";
+ mes "Anyway, I got you. Just tell me whenever you want to go.";
close;
}
+ }
+ mes "[Dolangmal]";
+ mes "Uh? You must be the one from last time...? Alright. Did you visit ^A2314BMalangdo^000000?";
+ next;
+ switch(select("Take me to ^A2314BMalangdo^000000 again:I have visited")) {
+ case 1:
mes "[Dolangmal]";
- mes "Ok! Do not bite two mice with one mouth. ^9E1837Admiral Thomas^000000 is located at the ^A2314Bcenter of ship in Meow Meow Island^000000.";
+ mes "I really want to send you there, but I can't because of the policy. It is difficult to send people who have visited ^A2314BMalangdo^000000 already.";
next;
mes "[Dolangmal]";
- mes "Don't forget give notice of arrival.";
+ mes "And that was roughly it... It's supposed to be rule 53...";
next;
mes "[Dolangmal]";
- mes "Alright. Let's go to the heaven of the cat, ^A2314BMeow Meow Island^000000~";
- setquest 5091;
- completequest 5091;
- warp "malangdo",217,85;
- close;
- }
- mes "[Dolangmal]";
- mes "Uh? You must be last time...? Alright. Did you visit ^A2314BMeow Meow Island^000000?";
- next;
- if(select("Take me to ^A2314BMeow Meow Island^000000 again:I have visited") == 1) {
+ mes "Actually, let me tell you rule 53. I am an indulgent cat.";
+ next;
mes "[Dolangmal]";
- mes "I really want to send you there, but I can't because of the policy. It is difficult to send people who visit ^A2314BMeow Meow Island^000000 at first.";
+ mes "If you want to go back to ^A2314BMalangdo^000000, take the ship at Izlude or Alberta.";
next;
mes "[Dolangmal]";
- mes "And you just heard roughly what I said... It is supposed to be rule 53...";
+ mes "If you enjoy that pleasant sea trip, you will arrive at the heaven of cats, ^A2314BMalangdo^000000.";
next;
mes "[Dolangmal]";
- mes "Specially, let me tell you rule 53. I am an indulgent cat.";
+ mes "So easy! Isn't it? Well, good bye~";
+ close;
+ case 2:
+ mes "[Dolangmal]";
+ mes "How was it? You liked it? I knew it. Kakaka~";
next;
mes "[Dolangmal]";
- mes "If you want to go back to ^A2314BMeow Meow Island^000000, just take ship at Izlude or Alberata.";
+ mes "Ah! I just want to make sure...";
next;
mes "[Dolangmal]";
- mes "If you enjoy pleasant sea trip, you will arrive the heaven of cat ^A2314BMeow Meow Island^000000.";
+ mes "Again, if you want to go back to ^A2314BMalangdo^000000, do you know where to take a ship at Izlude or Alberta?";
next;
mes "[Dolangmal]";
- mes "So easy! Isn't it? Well, good bye~";
+ mes "Hm~ You might know because you're a smart person. Well, see you again~";
close;
}
- mes "[Dolangmal]";
- mes "How is that? You like it? I knew it. Kakaka";
- next;
- mes "[Dolangmal]";
- mes "Ah! I just want to make sure..";
- next;
- mes "[Dolangmal]";
- mes "Again, if you want to go back to ^A2314BMeow Meow Island^000000, do you know that take a ship at Izlude or Alberta?";
- next;
- mes "[Dolangmal]";
- mes "Hm~ You might know that because you are smart person. Well, see you again~";
- close;
}
prontera,114,77,6 duplicate(Dolangmal) Dolangmal#1 553
geffen,109,61,6 duplicate(Dolangmal) Dolangmal#2 553
@@ -161,24 +165,24 @@ izlude,182,218,4 script Odgnalam#iz 554,{
next;
if (ep13_yong1 == 0) {
set .@price,1000;
- set .@s1$,"Huh!! You are such an annoying person. Let me send you to the heaven of the cat, ^A2314BMeow Meow Island^000000 with ^0000FF1000 Zeny^000000.";
+ set .@s1$,"Huh!! You are such an annoying person. Let me send you to the heaven of the cat, ^A2314BMalangdo^000000 with ^0000FF1000 Zeny^000000.";
set .@s2$,"Money? Where is the money? You can't go anywhere without the money. Shame on you.";
} else if (ep13_yong1 < 60) {
set .@price,999;
- set .@s1$,"You have a little relationship with fleet of cat. I'll give you special discount price ^0000FF999 Zeny^000000 to the heaven of the cat, ^A2314BMeow Meow Island^000000, because you have relationship with fleet.";
+ set .@s1$,"You have a little relationship with fleet of cat. I'll give you special discount price ^0000FF999 Zeny^000000 to the heaven of the cat, ^A2314BMalangdo^000000, because you have relationship with fleet.";
set .@s2$,"Where is the money? You don't have a sense of honor.";
} else if (ep13_yong1 > 59 && ep13_yong1 < 80) {
set .@price,500;
- set .@s1$,"You gave several help to our cat's fleet so let me give you special that with 50% discount price ^0000FF500 Zeny^000000. I'll send you to the heaven of the cat, ^A2314BMeow Meow Island^000000.";
+ set .@s1$,"You gave several help to our cat's fleet so let me give you special that with 50% discount price ^0000FF500 Zeny^000000. I'll send you to the heaven of the cat, ^A2314BMalangdo^000000.";
set .@s2$,"You don't have any money for paying 50% discount price? I can't believe it.";
} else {
mes "[Odgnalam]";
mes "You are a hero of cat's fleet. Your activity is the legend between us.";
next;
mes "[Odgnalam]";
- mes "As you are hero of fleet so let me send you to the heaven of the cat, ^A2314BMeow Meow Island^000000 for free.";
+ mes "As you are a hero of the cat fleet let me send you to ^A2314BMeow Meow Island^000000 for free.";
next;
- if(select("Let's go Meow Meow Island!!:Do not go") == 1) {
+ if(select("Send me to Meow Meow Island!:Do not go.") == 1) {
mes "[Odgnalam]";
mes "Have a comfortable trip... Alright let's go~";
warp "malangdo",217,85;
@@ -188,7 +192,7 @@ izlude,182,218,4 script Odgnalam#iz 554,{
mes "[Odgnalam]";
mes .@s1$;
next;
- if(select("Let's go Meow Meow Island!!:Do not go") == 2) close;
+ if(select("Send me to Meow Meow Island!:Do not go.") == 2) close;
if (Zeny < .@price) {
mes "[Odgnalam]";
mes "Money? Where is the money? You can't go anywhere without the money. Shame on you.";
@@ -200,7 +204,7 @@ izlude,182,218,4 script Odgnalam#iz 554,{
warp "malangdo",217,85;
close;
}
-alberta,200,151,4 duplicate(Odgnalam#iz) Odgnalam#albe 554
+alberta,200,151,4 duplicate(Odgnalam#iz) Odgnalam#Alberta 554
malangdo,219,86,4 script Kong#malang 545,{
mes "[Kong]";
@@ -210,17 +214,17 @@ malangdo,219,86,4 script Kong#malang 545,{
if (ep13_yong1 == 0) {
set .@price,1000;
set .@s1$, "1000 zeny";
- set .@s2$, "Have a nice day in Meow Meow Island.";
+ set .@s2$, "Have a nice day in Malangdo.";
set .@no_money$, "It is difficult for free.";
set .@yes_money$, "Have a nice trip.";
mes "[Kong]";
- mes "The fee of ship is only 1000 zeny, where you want to go?";
+ mes "The fee of ship is only 1000 zeny, where do you want to go?";
next;
} else if (ep13_yong1 < 60) {
set .@price,999;
set .@s1$,"999 zeny";
- set .@s2$, "Have a full of fortune day in Meow Meow Island...";
- set .@no_money$, "It is difficult even though you have a relationship with fleet.";
+ set .@s2$, "Have a full of fortune day in Malangdo...";
+ set .@no_money$, "It is difficult even though you have a relationship with the fleet.";
set .@yes_money$, "Thanks, have a wonderful trip.";
mes "[Kong]";
mes "You have a connection with our fleet. Apply special price 999 zeny. Where do you want to go?";
@@ -228,21 +232,21 @@ malangdo,219,86,4 script Kong#malang 545,{
} else if (ep13_yong1 > 59 && ep13_yong1 < 80) {
set .@price,500;
set .@s1$,"500 zeny";
- set .@s2$, "There are full of fortune and jackpot in Meow Meow Island.";
+ set .@s2$, "There are full of fortune and jackpot in Malangdo.";
set .@no_money$, "Oh my god. You don't have 500 zeny? It is difficult for free.";
- set .@yes_money$, "Have nice trip and come again.";
+ set .@yes_money$, "Have a nice trip and come again.";
mes "[Kong]";
- mes "Wow~ You contributed our fleet a lot. Alright!! Special discount price 500 zeny. Where do you want to go?";
+ mes "Wow~ You contributed to our fleet a lot. Alright!! Special discount price 500 zeny. Where do you want to go?";
next;
} else {
set .@price,0;
- set .@s1$,"Free for hero of fleet!!";
- set .@s2$, "No one objects the hero of fleet to stay in Meow Meow Island...";
+ set .@s1$,"Free for the hero of our fleet!!";
+ set .@s2$, "No one objects to the hero of our fleet staying in Malangdo...";
mes "[Kong]";
- mes "Ah... You are the hero of cat's fleet and it is the legend.";
+ mes "Ah... You are the legendary hero of our cat's fleet.";
next;
mes "[Kong]";
- mes "We can't charge from hero of fleet. Where is your destination?";
+ mes "We can't charge the hero of our fleet. What is your destination?";
next;
}
set .@i, select("- Izlude destination --- "+.@s1$+":- Alberta destination --- "+.@s1$+":- Stay on Malangdo");
@@ -281,37 +285,37 @@ malangdo,147,117,3 script Innkeeper#malang 554,{
switch(select("Umm... can I rest here?:Psst... can I save here?:Leave.")) {
case 1:
mes "[Innkeeper]";
- mes "You can use hammock as you want but give me ^FF00005 pieces of Malang Sp Can^000000, then will make you stress out.";
+ mes "You can use the hammock as you want, but give me ^FF00005 Malangdo Canned Specialties^000000. Then you can relax.";
next;
- switch(select("Give the can.:No need.")) {
+ switch(select("Give the cans.:No need.")) {
case 1:
if (countitem(12636) > 4) {
delitem 12636,5; //Malang_Sp_Can
percentheal 100,100;
specialeffect2 EF_HEALSP;
mes "[Innkeeper]";
- mes "Take a relaxation.";
+ mes "Now relax.";
emotion e_kis;
next;
warp "malangdo",140,121;
close;
}
mes "[Innkeeper]";
- mes "It looks like lack of cans.";
+ mes "It looks like a lack of cans.";
close;
case 2:
mes "[Innkeeper]";
- mes "You are strong man than appearance.";
+ mes "You are stronger than your appearance.";
close;
}
case 2:
mes "[Innkeeper]";
- mes "Storation is done. We should keep company haha.";
+ mes "Location saved. We should keep company, haha~";
savepoint "malangdo",142,118;
close;
case 3:
mes "[Innkeeper]";
- mes "A busy moment make you hurry and laziness makes you lazy.";
+ mes "A busy moment makes you hurry and laziness makes you lazy.";
next;
mes "- Wonder if there is work time. -";
close;
@@ -358,28 +362,28 @@ OnTouch:
malangdo,216,168,3 script Cat Trainer#mal1 558,0,8,{
emotion e_awsm;
mes "[Cat Trainer]";
- mes "Phh there is a tail and butt with soft and tender!";
+ mes "Phh there is a tail and butt both soft and tender!";
mes "Can't stand, this is heaven~~!!";
next;
emotion e_gg;
mes "[Cat Trainer]";
- mes "My hidden card ^FF0000<Silvervine Fruit>^000000 can make all cats in Meow Meow Island as my slaves~ haha!";
+ mes "My hidden card, ^FF0000<Silvervine Fruit>^000000, can make all cats in Malangdo my slaves~ haha!";
next;
select("^FF0000<Silvervine Fruit>^000000?");
mes "[Cat Trainer]";
mes "Silvervine Fruit is a rare item!";
mes "I can barely get it.";
- mes "But every cat must love this one with no complaint.";
+ mes "But every cat loves it with no complaints.";
next;
select("Where can I get ^FF0000<Silvervine Fruit>^000000?");
mes "[Cat Trainer]";
- mes "How do you get it that I could have it barely?";
+ mes "How would I know if I could barely find it?";
mes "This can't be taken even with ^3131FFall the zeny in this world^000000!";
next;
emotion e_gg;
mes "[Cat Trainer]";
- mes "Cats in Meow Meow Island is mine...! And it should be done haha~";
- mes "^FF0000<Silvervine Fruit>^000000! I can be a king in Meow Meow Island~ ohhhh!!!";
+ mes "The cats in Malangdo are mine...! As it should be, haha~";
+ mes "^FF0000<Silvervine Fruit>^000000! I can be a king in Malangdo~ ohhhh!!!";
close;
OnTouch:
emotion e_flash;
diff --git a/npc/re/jobs/3-1/warlock.txt b/npc/re/jobs/3-1/warlock.txt
index 363597c10..8a8e1f0ce 100644
--- a/npc/re/jobs/3-1/warlock.txt
+++ b/npc/re/jobs/3-1/warlock.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Muad_Dib, Gepard & L0ne_W0lf
//===== Current Version: =====================================
-//= 1.3
+//= 1.3a
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
@@ -14,12 +14,13 @@
//= 1.1 Fixed some conversion mistakes, replaced numbers with
//= constants, added item names in comments.
//= 1.2 Fixed the problem where NPC are not enabled and chamber
-//= will never open for the second try or use.
+//= will never open for the second try or use.
//= 1.2a Fixed a typo. [Euphy]
//= 1.3 Updated script, optimized. [Euphy]
+//= 1.3a Added temporary coordinate fix #distorted_space_1-1. [Euphy]
//============================================================
-morocc,103,144,0 script #distorted_space_1 139,1,1,{
+- script #distorted_space_ -1,{
OnTouch:
if (job_wl > 1) {
mes " - There is a strange distortion here - ";
@@ -65,7 +66,11 @@ OnTouch:
}
end;
}
-splendide,141,284,0 duplicate(#distorted_space_1) #distorted_space_2 139,1,1
+morocc,103,144,0 duplicate(#distorted_space_) #distorted_space_1 139,1,1
+splendide,141,284,0 duplicate(#distorted_space_) #distorted_space_2 139,1,1
+
+// This is a temporary fix until new official coordinates are found.
+morocc,98,144,0 duplicate(#distorted_space_) #distorted_space_1-1 139,1,1
function script F_Warlock {
mes "[Assistant]";
diff --git a/npc/re/merchants/card_separation.txt b/npc/re/merchants/card_separation.txt
new file mode 100644
index 000000000..a81aeb746
--- /dev/null
+++ b/npc/re/merchants/card_separation.txt
@@ -0,0 +1,279 @@
+//===== rAthena Script =======================================
+//= Card Separation System
+//===== By: ==================================================
+//= Muad_Dib
+//===== Current Version: =====================================
+//= 1.0
+//===== Compatible With: =====================================
+//= rAthena SVN
+//===== Description: =========================================
+//= [Official Conversion]
+//= Separates cards from equipment.
+//===== Additional Comments: =================================
+//= 1.0 First Version. [Euphy]
+//============================================================
+
+malangdo,215,166,4 script Jeremy#mal 553,{
+ disable_items;
+ if (checkweight(1201,1) == 0) {
+ mes "You have too many kinds of objects. Let's try to continue after reducing those objects.";
+ close;
+ }
+ if (MaxWeight - Weight < 10000) {
+ mes "Can't continue because you have too many heavy objects. Let's try to continue after reducing the weight.";
+ close;
+ }
+ mes "[Jeremy]";
+ mes "Long time no see~";
+ mes "I have learned a new skill that separates cards from Armor, Shoes, Garment and Headgear. Do you want to try it?";
+ next;
+ mes "[Jeremy]";
+ mes "Generally the fee is 1,000,000 Zeny. During the card separation, you can use ^990000special items that reduce the rate of destroying equipment or cards^000000. We don't charge additional zeny for this.";
+ next;
+ mes "[Jeremy]";
+ mes "There is a possibility of destroying them even using a special item. Also, ^ff0000the refine level might be lost^000000. Do you have any equipment to separate?";
+ next;
+
+ setarray .@equip_name$[0], "Armor", "Shoes", "Garment", "Upper Hat";
+ setarray .@equip_slot[0], EQI_ARMOR,EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP;
+ for(set .@i,0; .@i<getarraysize(.@equip_slot); set .@i,.@i+1) {
+ if (getequipisequiped(.@equip_slot[.@i]))
+ set .@menu$, .@menu$+getequipname(.@equip_slot[.@i])+":";
+ else
+ set .@menu$, .@menu$+"^999999"+.@equip_name$[.@i]+" (empty)^000000:";
+ }
+
+ set .@i, select("Stop the work:How is it possible?:"+.@menu$);
+ switch(.@i) {
+ case 1:
+ mes "[Jeremy]";
+ mes "Whenever you need the work, visit me here.";
+ close;
+ case 2:
+ mes "[Jeremy]";
+ mes "You wonder what is so special. Well, I hate to give only a guide, so let me tell you the story...";
+ next;
+ mes "^000099Jeremy is stretching his shoulders and hands. He might be waiting for someone to talk with him.^000000";
+ next;
+ mes "[Jeremy]";
+ mes "Do you know that Malangdo's specialty is canned food?";
+ next;
+ select("I knew that well. Is it that limited?");
+ mes "[Jeremy]";
+ mes "Hehe... Everyone loves it. But there were some problems before.";
+ next;
+ select("Problems? Is there any faulty fish?");
+ mes "[Jeremy]";
+ mes "No, the fish does not have any problem. The problem is lots of fish oil produced after processing. That is such an industrial waste.";
+ next;
+ mes "[Jeremy]";
+ mes "However, after a revitalizing refining process, this fish oil became valuable to use for old equipment care and industrial lubricant.";
+ next;
+ mes "[Jeremy]";
+ mes "In addition, this oil is so useful to separate relics from equipped weapons that we can't buy Premium Lubricant and Ordinary Lubricant with Zeny.";
+ next;
+ mes "[Jeremy]";
+ mes "Well, don't worry about money. Surely the Premium Lubricant is expensive. If you pay some zeny, I can give you cheaper lubricant.";
+ next;
+ mes "[Jeremy]";
+ mes "I'm not sure about the quality of success. Anyway, this is so cheap, right?";
+ close;
+ default:
+ set .@equip_num, .@equip_slot[.@i-3];
+ if (!getequipisequiped(.@equip_num)) {
+ mes "[Jeremy]";
+ mes "In this part, there is nothing?";
+ close;
+ }
+ break;
+ }
+ setarray .@equip_card[0], getequipcardid(.@equip_num,0),getequipcardid(.@equip_num,1),getequipcardid(.@equip_num,2),getequipcardid(.@equip_num,3);
+ for(set .@i,0; .@i<4; set .@i,.@i+1) {
+ if (.@equip_card[.@i] >= 4700) // Armor Enchant System
+ set .@equip_card[.@i],0;
+ }
+ if (!getarraysize(.@equip_card)) {
+ mes "[Jeremy]";
+ mes "The card is not equipped. Do you want to check again?";
+ close;
+ }
+
+ // Detect MVP cards.
+ set .@mvp_list$,
+ "|4408|4128|4456|4168|4142"+ //Gloom_Under_Night_Card, Golden_Bug_Card, Nidhogg_Shadow_Card, Dark_Lord_Card, Doppelganger_Card
+ "|4134|4137|4386|4407|4357"+ //Dracula_Card, Drake_Card, Detale_Card, Randgris_Card, B_Seyren_Card
+ "|4146|4132|4147|4372|4145"+ //Maya_Card, Mistress_Card, Baphomet_Card, Bacsojin_Card, Berzebub_Card
+ "|4374|4352|4367|4236|4425"+ //Apocalips_H_Card, B_Ygnizem_Card, B_Shecil_Card, Amon_Ra_Card, Atroce_Card
+ "|4359|4123|4144|4135|4143"+ //B_Eremes_Card, Eddga_Card, Osiris_Card, Orc_Load_Card, Orc_Hero_Card
+ "|4263|4131|4430|4276|4419"+ //Incant_Samurai_Card, Moonlight_Flower_Card, Ifrit_Card, Lord_Of_Death_Card, Ktullanux_Card
+ "|4403|4399|4376|4441|4302"+ //Kiel_Card, Thanatos_Card, Lady_Tanee_Card, Fallen_Bishop_Card, Tao_Gunka_Card
+ "|4305|4148|4318|4121|4365"+ //Turtle_General_Card, Pharaoh_Card, Knight_Windstorm_Card, Phreeoni_Card, B_Katrinn_Card
+ "|4363|4324|4361|4330|4342|"; //B_Magaleta_Card, Garm_Card, B_Harword_Card, Dark_Snake_Lord_Card, Rsx_0806_Card
+ if ((.@equip_card[0] && compare(.@mvp_list$,"|"+.@equip_card[0]+"|")) ||
+ (.@equip_card[1] && compare(.@mvp_list$,"|"+.@equip_card[1]+"|")) ||
+ (.@equip_card[2] && compare(.@mvp_list$,"|"+.@equip_card[2]+"|")) ||
+ (.@equip_card[3] && compare(.@mvp_list$,"|"+.@equip_card[3]+"|")))
+ set .@boss_chk,1;
+
+ if (.@boss_chk == 0) {
+ mes "[Jeremy]";
+ mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:";
+ next;
+ set .@menu$,
+ "Next time...:"+
+ ((Zeny >= 1000000)?"Use 1,000,000z (Do not use special item):":"^999999Use 1,000,000z (Insufficient)^000000:")+
+ ((countitem(6441))?"Use Premium Lubricant:":"^999999Premium Lubricant (Insufficient)^000000:")+
+ ((countitem(6440))?"Use Ordinary Lubricant":"^999999Ordinary Lubricant (Insufficient)^000000");
+ switch(select(.@menu$)) {
+ case 1:
+ mes "[Jeremy]";
+ mes "Whenever you need the work, visit me here.";
+ close;
+ case 2:
+ if (Zeny < 1000000) {
+ mes "[Jeremy]";
+ mes "You don't have enough zeny. Please come back with enough fees.";
+ close;
+ }
+ mes "[Jeremy]";
+ mes "This is pretty old equipment. There is a high rate of destroying the cards or equipment during the work. Are you sure you want to continue?";
+ next;
+ if(select("Next time...:Continue") == 1) {
+ mes "[Jeremy]";
+ mes "Whenever you need the work, visit me here.";
+ close;
+ }
+ set .@sf_c_num,150;
+ set .@sf_r_num,150;
+ set .@sf_w_num,150;
+ set Zeny, Zeny - 1000000;
+ break;
+ case 3:
+ if (countitem(6441) == 0) {
+ mes "[Jeremy]";
+ mes "You don't have Premium Lubricant.";
+ close;
+ }
+ mes "[Jeremy]";
+ mes "If you use the Premium Lubricant, the rate of destruction will be decreased highly, but I can't give you a 100% guarantee. Are you sure you want to continue?";
+ next;
+ if(select("Next time...:Continue") == 1) {
+ mes "[Jeremy]";
+ mes "Whenever you need the work, visit me here.";
+ close;
+ }
+ set .@sf_c_num,75;
+ set .@sf_r_num,75;
+ set .@sf_w_num,75;
+ delitem 6441,1; //High_RankLubricant
+ break;
+ case 4:
+ if (countitem(6440) == 0) {
+ mes "[Jeremy]";
+ mes "You don't have Ordinary Lubricant.";
+ close;
+ }
+ mes "[Jeremy]";
+ mes "If you use the Ordinary Lubricant, the rate of destruction will be decreased highly, but I can't give you a 100% guarantee. Are you sure you want to continue?";
+ next;
+ if(select("Next time...:Continue") == 1) {
+ mes "[Jeremy]";
+ mes "Whenever you need the work, visit me here.";
+ close;
+ }
+ set .@sf_c_num,75;
+ set .@sf_r_num,150;
+ set .@sf_w_num,150;
+ delitem 6440,1; //General_Lubricant
+ break;
+ }
+ } else if (.@boss_chk == 1) {
+ mes "[Jeremy]";
+ mes "This equipment contains a precious MVP card. This card can't be separated with lubricant. If you bring the super surfactant ^0000ffSillit Pong^000000, I will be able to work.";
+ next;
+ switch(select("Next time...:I have a Sillit Pong.")) {
+ case 1:
+ mes "[Jeremy]";
+ mes "Whenever you need the work, visit me here.";
+ close;
+ case 2:
+ if (countitem(6443) == 0) {
+ mes "[Jeremy]";
+ mes "You don't have Sillit Pong.";
+ close;
+ }
+ break;
+ }
+ mes "[Jeremy]";
+ mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:";
+ next;
+ switch(select("Next time...:Alright, let's do it!")) {
+ case 1:
+ mes "[Jeremy]";
+ mes "Whenever you need the work, visit me here.";
+ close;
+ case 2:
+ set .@sf_c_num,60;
+ set .@sf_r_num,60;
+ set .@sf_w_num,60;
+ delitem 6443,1; //Sillit_Pong_Bottle
+ break;
+ }
+ }
+
+ set .@equip_id, getequipid(.@equip_num);
+ set .@equip_refine, getequiprefinerycnt(.@equip_num);
+ delequip .@equip_num;
+
+ // Chance of retaining refine level.
+ if (rand(1,.@sf_r_num) >= 61)
+ set .@equip_refine,0;
+
+ // Chance of retaining equipment.
+ if (rand(1,.@sf_w_num) < 61) {
+ set .@equip_safe,1;
+ getitem2 .@equip_id,1,1,.@equip_refine,0,0,0,0,0;
+ }
+
+ // Chance of retaining cards.
+ for(set .@i,0; .@i<4; set .@i,.@i+1) {
+ if (.@equip_card[.@i]) {
+ if (rand(1,.@sf_c_num) < 61)
+ getitem .@equip_card[.@i],1;
+ else
+ set .@card_break,1;
+ }
+ }
+
+ // Display corresponding effect.
+ if (!.@equip_safe && .@card_break)
+ specialeffect2 EF_LORD;
+ else if (.@equip_safe && .@card_break)
+ specialeffect2 EF_SUI_EXPLOSION;
+ else if (!.@equip_safe && !.@card_break)
+ specialeffect2 EF_FIREPILLAR;
+ else
+ specialeffect2 EF_MAXPOWER;
+
+ // Output results.
+ mes "-- Result of Card Separation --";
+ if (.@equip_safe) {
+ mes "Crack has not occured during the card separation process.";
+ mes "^0000FFEquipment separation is normal.^000000";
+ } else {
+ mes "Crack has occured during the card separation process.";
+ mes "Equipment has been damaged. ^ff0000Unrecoverable.^000000";
+ }
+ mes "-------------------";
+ if (!.@card_break) {
+ mes "Erosion of surface has not occured during the card separation process.";
+ mes "^0000ffCard separation has succeeded.^000000";
+ } else {
+ mes "Erosion of surface has occured during the card separation process.";
+ mes "Card has been damaged. ^ff0000Unrecoverable.^000000";
+ }
+ next;
+ mes "[Jeremy]";
+ mes "That is all for the results of the card separation. Please come again.";
+ close;
+}
diff --git a/npc/re/merchants/coin_exchange.txt b/npc/re/merchants/coin_exchange.txt
index 04fa93ce8..92afddca0 100644
--- a/npc/re/merchants/coin_exchange.txt
+++ b/npc/re/merchants/coin_exchange.txt
@@ -824,4 +824,4 @@ malangdo,150,135,5 script Roving Merchant 495,{
callfunc "F_mal_coin",1,"[Roving Merchant]",.@names$[.@i],.@items[.@i],0,200,0;
next;
}
-} \ No newline at end of file
+}
diff --git a/npc/re/merchants/enchan_mal.txt b/npc/re/merchants/enchan_mal.txt
index 36e8487b5..5caa70217 100644
--- a/npc/re/merchants/enchan_mal.txt
+++ b/npc/re/merchants/enchan_mal.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Muad_Dib
//===== Current Version: =====================================
-//= 1.0
+//= 1.0a
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
@@ -12,6 +12,7 @@
//= for Malangdo coins.
//===== Additional Comments: =================================
//= 1.0 First Version. [Euphy]
+//= 1.0a Added 'delequip' command. [Euphy]
//============================================================
malangdo,213,167,4 script Mayomayo#mal 555,{
@@ -567,10 +568,10 @@ L_Socket:
mes "There is something wrong. Please try again.";
close;
}
- if (.@equip_card[3] == 0 && getarg(1) < 4) set .@target,3;
- else if (.@equip_card[2] == 0 && getarg(1) < 3) set .@target,2;
- else if (.@equip_card[1] == 0 && getarg(1) < 2) set .@target,1;
- else if (.@equip_card[0] == 0 && getarg(1) < 1) set .@target,0;
+ if (.@equip_card[3] == 0 && getarg(1) < 4) set .@equip_card[3],.@enchant;
+ else if (.@equip_card[2] == 0 && getarg(1) < 3) set .@equip_card[2],.@enchant;
+ else if (.@equip_card[1] == 0 && getarg(1) < 2) set .@equip_card[1],.@enchant;
+ else if (.@equip_card[0] == 0 && getarg(1) < 1) set .@equip_card[0],.@enchant;
else {
mes "[Mayomayo]";
mes "This equipment is at the end of enchant. I provide enchant for two times maximum.";
@@ -585,24 +586,18 @@ L_Socket:
mes "Oh my god!";
mes "This equipment is destroyed because it could not endure powerful ability. I'm so sorry.";
delitem .@coin[.@coin_select],.@total[.@coin_select];
-
-// dropequipitem EQI_HAND_R
- unequip EQI_HAND_R;
- delitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
+ delequip EQI_HAND_R;
close;
}
specialeffect2 EF_REPAIRWEAPON;
mes "[Mayomayo]";
mes "I have enchanted ^990000slot "+.@socket+"^000000 of this equipment.";
delitem .@coin[.@coin_select],.@total[.@coin_select];
-
-// dropequipitem EQI_HAND_R
- unequip EQI_HAND_R;
- delitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
+ delequip EQI_HAND_R;
// GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] .@equip_card[3]
- set .@equip_card[.@target],.@enchant;
getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
+
close;
} else if (.@select == 2) {
mes "[Mayomayo]";
@@ -632,10 +627,7 @@ L_Socket:
mes "[Mayomayo]";
mes "Initialize the enchant effect from the equipment.";
delitem 6417,1; //Silvervine
-
-// dropequipitem EQI_HAND_R
- unequip EQI_HAND_R;
- delitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
+ delequip EQI_HAND_R;
// GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] .@equip_card[3]
for(set .@i,0; .@i<4; set .@i,.@i+1) {
@@ -643,6 +635,7 @@ L_Socket:
set .@equip_card[.@i],0;
}
getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
+
close;
}
}
diff --git a/npc/re/quests/quests_dicastes.txt b/npc/re/quests/quests_dicastes.txt
index bf5317195..e55ed80a6 100644
--- a/npc/re/quests/quests_dicastes.txt
+++ b/npc/re/quests/quests_dicastes.txt
@@ -308,7 +308,7 @@ OnTouch:
donpcevent "Suspicious Guy#ep133_::OnDisable";
mes "The guy in all black disappeared suddenly.";
mes "Who was that?";
- close2;
+ close;
}
end;
}
@@ -339,7 +339,7 @@ OnEnable:
mes "[Capital City Guard]";
mes "Access to the city is restricted from other races without permits.";
mes "Please go back.";
- close2;
+ close;
}
else if (ep13_3_invite == 5) {
mes "[Capital City Guard]";
@@ -383,7 +383,7 @@ OnEnable:
mes "[Capital City Guard]";
mes "Unknown situation occurred. Case " + strnpcinfo(2);
mes "Please inquiry with a GM.";
- close2;
+ close;
}
dic_fild01,146,281,5 duplicate(Guard#ep133_11) Capital City Guard#1 492
dic_fild01,153,281,3 duplicate(Guard#ep133_11) Capital City Guard#2 450
diff --git a/npc/re/quests/quests_malangdo.txt b/npc/re/quests/quests_malangdo.txt
index 685da8b24..160c3f8a9 100644
--- a/npc/re/quests/quests_malangdo.txt
+++ b/npc/re/quests/quests_malangdo.txt
@@ -3,17 +3,2550 @@
//===== By: ==================================================
//= Muad_Dib
//===== Current Version: =====================================
-//= 1.1
+//= 1.4
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
-//= Quest NPCs related to Malangdo.
+//= Quest NPCs related to Malangdo:
+//== Malangdo Island, Help the Bad Cats in Danger,
+//== Clean the Ship, Help Chef Nyas,
+//== Play with Baby Cats, Archangel Wing Enchants
//===== Additional Comments: =================================
//= 1.0 First version. [Euphy]
-//= 1.1 Added two quests.
+//= 1.1 Added Clean the Ship and Help Chef Nyas.
+//= 1.2 Added Archangel Wing Enchants.
+//= 1.3 Added Play with Baby Cats.
+//= 1.4 Added Malangdo Island.
//============================================================
-// Help the bad cats in danger :: mal_bad_guys
+// Malangdo Island :: ma_tomas
+//============================================================
+mal_in02,28,56,5 script Samuel#mal 495,{
+ mes "[Samuel]";
+ mes "Ah, you mean the ad... well, you mean our village chief?";
+ mes "You'd better not bother him, since he's always busy.";
+ if (ma_tomas == 0)
+ close;
+ next;
+ mes "[Samuel]";
+ mes "^0000FFBut it'd be impossible to talk without bothering him anyway......^000000";
+ mes "He is simply always busy.";
+ next;
+ switch(select("Ad...?:Village chief?")) {
+ case 1:
+ mes "[Samuel]";
+ mes "Ah, there was an admiral of this ship before settling in here~";
+ mes "Shining golden eyes like the sun!!!";
+ mes "Silvery beard fluttering with a rough sea breeze!!!";
+ next;
+ mes "[Samuel]";
+ mes "Kha~ It was nice!!!!";
+ mes "I was fascinated by that attraction and took the ship, Navi!";
+ mes "This thing is called the romance of a guy. Hoo hoo~";
+ emotion e_shy;
+ next;
+ mes "[Samuel]";
+ mes "Well... His cuticle seems to have gone bad a bit with his village chief duty, since he settled in Malangdo. But his eyes are still the same.";
+ close;
+ case 2:
+ mes "[Samuel]";
+ mes "Umm, since it is Malangdo, will it be the Malangdo chief...?!";
+ mes "No, though it will be funny...";
+ mes "Malangdo village... umm... this... this is also not......";
+ mes "Well, this stuff is not that important.";
+ next;
+ mes "[Samuel]";
+ mes "Although there are many differences between admiral and village chief for sure, it feels like it won't be without Admiral Tomas anyhow.";
+ next;
+ mes "[Samuel]";
+ mes "All would think the same, not just me.";
+ mes "He's having a hard time thanks to this.";
+ close;
+ }
+}
+
+mal_in02,22,62,3 script Tomas#mal 556,{
+ if (BaseLevel < 60) {
+ mes "[Tomas, Village Chief]";
+ mes "Ummm... Who are you?";
+ mes "Don't you think it's too early to come here?";
+ close;
+ }
+ if (ma_tomas == 0) {
+ mes "[Tomas, Village Chief]";
+ mes "Samuel!";
+ mes "Are you coming to an end there?";
+ cutin "ma_tomas02",2;
+ next;
+ mes "[Samuel]";
+ mes "Yes, Admiral!";
+ mes "Moved all 3 thousand boxes, including the one I just received, to the storage. The next boxes are expected to be delivered in 5 hours!";
+ emotion e_omg,0,"Samuel#mal";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Samuel!";
+ mes "How many times should I tell you to call me Village Chief, not Admiral!";
+ next;
+ mes "[Samuel]";
+ mes "Sorry! Village Chief!";
+ mes "I will correct myself!";
+ emotion e_omg,0,"Samuel#mal";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Hmm, hmm!";
+ mes "Get them sorted out and arrange them over there. Before the next boxes are here you must finish the work there!";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Sea cucumbers, sea squirts, sea anemones to the right! Seaweed and kelp downstairs, and send anchovies and drums to the gathering place. Let the rest stack assortatively in the corner!";
+ next;
+ mes "[Samuel]";
+ mes "Yes! Village Chief!";
+ mes "Seaweed, Sea cucumbers, sea squirts, sea anemones to the right! Seaweed and glasses downstairs! Send anchovies and drums to the gathering place! Let the rest stack assortatively in the corner!";
+ emotion e_omg,0,"Samuel#mal";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "It it not.";
+ mes "Sea cucumbers, sea squirts, sea anemones to the right. Seaweed and kelp downstairs. Anchovies and drums to the gathering place. Let the rest stack assortatively in the corner.";
+ emotion e_dots;
+ next;
+ mes "[Samuel]";
+ mes "Yes!!";
+ emotion e_omg,0,"Samuel#mal";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Huuu...";
+ mes "It doesn't seem to end.";
+ mes "There are still piles of paperwork to do... I will be in trouble unless I finish them up before the next boxes arrive.";
+ emotion e_sigh;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "So, the amount of the next boxes is 1300....";
+ mes "And the next, the 700 boxes downstairs to load up the ship...";
+ next;
+ switch(select("Try to talk to him.:Stop since he seems busy.")) {
+ case 1:
+ mes "[Tomas, Village Chief]";
+ mes "Hmm, who are you?";
+ mes "You are not familiar. Sorry, but will you come again if it is not that urgent?";
+ cutin "ma_tomas01",2;
+ next;
+ switch(select("It's my first time to Malangdo.:Another cat told me to come over here.:I will come around again later.")) {
+ case 1:
+ mes "[Tomas, Village Chief]";
+ mes "...So I told you your face was not familiar.";
+ emotion e_dots;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Hmm... Sorry, but as I told you before, would you talk to the other cats if it's not that urgent, since I have plenty of work left undone and no time to talk with you.";
+ break;
+ case 2:
+ mes "[Tomas, Village Chief]";
+ mes "...Anyway all are always good to leave me with the work.";
+ mes "Pitiless ones...";
+ emotion e_an;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Umm... Having said that, would you talk to the other cats if it's not that urgent, since I got plenty of work to do left undone and no time to talk with you?";
+ break;
+ case 3:
+ mes "[Tomas, Village Chief]";
+ mes "Sorry for that.";
+ mes "Please come back to me again, though I don't know when I could be free.";
+ close2;
+ cutin "",255;
+ end;
+ }
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "These days I feel I'm pressed with work, although it's good to trust and rely on me as a village chief...";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "It is too much, since they send all visitors to me.";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "You're just in time. Go to the ^0000FFregular meeting^000000 being held now.";
+ mes "The meeting place is ^0000FFat the end of the corridor^000000.";
+ set ma_tomas,1;
+ setquest 11209;
+ close2;
+ cutin "",255;
+ end;
+ case 2:
+ mes "[Tomas, Village Chief]";
+ mes "Sorry for that.";
+ mes "Please come back to me again though I don't know when I could be free.";
+ close2;
+ cutin "",255;
+ end;
+ }
+ } else if (ma_tomas == 1) {
+ mes "[Tomas, Village Chief]";
+ mes "So, the next 1000 boxes to move to the upper side...";
+ cutin "ma_tomas02",2;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "400 boxes to give out as supplies....";
+ mes "And also...";
+ next;
+ mes "[Samuel]";
+ mes "Admiral!";
+ mes "Sea bass, sea jelly, sea sponge are well arranged on the right!";
+ mes "Seaweed and kiwi downstairs! Anchovies and cod to the gathering place! Let the rest stack assortatively in the corner?";
+ emotion e_omg,0,"Samuel#mal";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "....";
+ emotion e_dots;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "....";
+ mes ".....";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "....";
+ mes ".....";
+ mes "......";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "You!!";
+ mes "How many times did I tell you! Mew~";
+ mes "Huh?!";
+ emotion e_an;
+ cutin "ma_tomas03",2;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Sea cucumbers, sea squirts, sea anemones to the right. Seaweed and kelp downstairs. Anchovies and drums to the gathering place. Let the rest stack assortatively in the corner.";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Huh?! If you really want to put Sea bass to the right that much, let yourself stand there all day long! Mew~";
+ emotion e_omg,0,"Samuel#mal";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "I'm busy enough without you. You're getting on my nerves! Mew~";
+ mes "What about getting on the ship over there? Mew!";
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Ooops!!!";
+ mes "!!!!!!";
+ emotion e_omg;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Hmm, hmm...";
+ mes "Well... what are you still doing here?";
+ mes "Go to the regular meeting being held now at the end of the corridor.";
+ mes "Ahem....";
+ emotion e_swt2;
+ cutin "ma_tomas02",2;
+ close2;
+ cutin "",255;
+ end;
+ } else if (ma_tomas == 2) {
+ mes "[Tomas, Village Chief]";
+ mes "Hmm, hmm...";
+ mes "Well... what are you still doing here?";
+ mes "Go to the regular meeting being held now at the end of the corridor.";
+ mes "Ahem....";
+ emotion e_swt2;
+ cutin "ma_tomas02",2;
+ close2;
+ cutin "",255;
+ end;
+ } else if (ma_tomas < 35) {
+ mes "[Tomas, Village Chief]";
+ mes "How is the meeting going on?";
+ mes "It's been a long time since I visited, since I'm busy... Tsk...";
+ emotion e_swt2;
+ cutin "ma_tomas02",2;
+ close2;
+ cutin "",255;
+ end;
+ } else if (ma_tomas == 35) {
+ mes "[Tomas, Village Chief]";
+ mes "Hoh!";
+ mes "There have been such issues!";
+ emotion e_ic;
+ cutin "ma_tomas04",2;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "I felt uneasy since I couldn't take care of you, being so busy.";
+ mes "You already got used to Malangdo well enough by yourself.";
+ emotion e_heh;
+ next;
+ mes "[Tomas, Village Chief]";
+ mes "Then, as village chief and the admiral of the cat association, I'd like you to get along with me as well!";
+ set ma_tomas,100;
+ completequest 11237;
+ getitem 6422,30; //Egrade_Coin
+ close2;
+ cutin "",255;
+ end;
+ }
+ mes "[Tomas, Village Chief]";
+ mes "Ha ha ha!";
+ mes "How are you doing?";
+ mes "Come to me if anything difficult happens.";
+ emotion e_heh;
+ cutin "ma_tomas04",2;
+ close2;
+ cutin "",255;
+ end;
+}
+
+mal_in02,182,61,3 script President of Meeting#mal 421,{
+ if (ma_tomas == 0) {
+ mes "[President of Meeting]";
+ mes "Please be silent, the regular meeting is getting started a moment later~";
+ close;
+ } else if (ma_tomas == 1) {
+ mes "[President of Meeting]";
+ mes "Wow~ wow~ Now we're having an incredible sale... well, no, but a meeting.";
+ mes "Please be silent.";
+ next;
+ mes "[President of Meeting]";
+ mes "Today's main agenda is as always ^ff99ccStar Candy^000000.";
+ mes "Though I have traveled through numerous areas by now, it's my first time hearing ^0000FFsuch a difficult language to learn^000000.";
+ next;
+ mes "[President of Meeting]";
+ mes "What she cannot communicate with at all is becoming a highly growing issue.";
+ next;
+ mes "[President of Meeting]";
+ mes "Please speak if there's any opinion on the next agenda.";
+ next;
+ mes "[President of Meeting]";
+ mes "Umm... Yes. Then, please say first, ^6666ccScottfold^000000.";
+ set ma_tomas,2;
+ changequest 11209,11210;
+ emotion e_paper,0,"Scottfold#mal";
+ close;
+ } else if (ma_tomas == 2) {
+ mes "[President of Meeting]";
+ mes "Umm... Yes. Please speak first, ^6666ccScottfold^000000.";
+ emotion e_paper,0,"Scottfold#mal";
+ close;
+ } else if (ma_tomas == 3) {
+ mes "[President of Meeting]";
+ mes "Please speak, Koon.... next.";
+ emotion e_paper,0,"Koon#mal";
+ close;
+ } else if (ma_tomas == 4) {
+ mes "[President of Meeting]";
+ mes "There will be a presentation by Dr. Devore on his study continuously.";
+ emotion e_paper,0,"Linguist Devore#mal";
+ close;
+ } else if (ma_tomas == 5) {
+ mes "[President of Meeting]";
+ mes "Please speak next, Dr. Mali.";
+ emotion e_paper,0,"Geologist Mali#mal";
+ close;
+ } else if (ma_tomas == 6) {
+ mes "[President of Meeting]";
+ mes "Brie!! I understand the situation, but please be calm and tell us, since it is a meeting after all.";
+ close;
+ } else if (ma_tomas == 7) {
+ mes "[President of Meeting]";
+ mes "Well, let's have a break for a while now.";
+ mes "In time, Samuel brought Seaweed and tuna here.";
+ close;
+ }
+ mes "[President of Meeting]";
+ mes "Huew... It gets you so tired to conduct a meeting.";
+ mes "I used to be called a tireless merchant who ranked 1st in sales...";
+ next;
+ mes "[President of Meeting]";
+ mes "I feel really sick sometimes when the meeting is prolonged.";
+ emotion e_sob;
+ close;
+}
+
+mal_in02,178,66,5 script Scottfold#mal 422,{
+ if (ma_tomas == 0) {
+ mes "[Scottfold]";
+ mes "Attending the meeting is an important thing to do.";
+ mes "It is absolutely right that all responsible cats should attend.";
+ close;
+ } else if (ma_tomas == 1) {
+ mes "[Scottfold]";
+ mes "The meeting is starting soon.";
+ mes "So, shh~~";
+ close;
+ } else if (ma_tomas == 2) {
+ mes "[Scottfold]";
+ mes "Yes, honorable president.";
+ mes "As for the communication with Star Candy, we have Biscuit, don't we?";
+ next;
+ mes "[President of Meeting]";
+ mes "Of course, though she is always with ^0000FFBiscuit, who speaks the official language a bit^000000, it seems to be difficult to have a conversation in depth.";
+ next;
+ mes "[President of Meeting]";
+ mes "Besides, Star Candy is in a very important position that our Malangdo's existance depends upon. Many others think it's necessary to talk about our future direction directly.";
+ next;
+ mes "[President of Meeting]";
+ mes "Then for the next... yes, Koon please speak now.";
+ set ma_tomas,3;
+ changequest 11210,11211;
+ emotion e_paper,0,"Koon#mal";
+ close;
+ }
+ mes "[Scottfold]";
+ mes "Let's quietly listen to the other's presentation.";
+ next;
+ mes "[Scottfold]";
+ mes "...Though I say so, I also feel like saying something, somehow.";
+ mes "So, I always put my hand up first!";
+ close;
+}
+
+mal_in02,177,58,7 script Koon#mal 546,{
+ if (ma_tomas == 0) {
+ mes "[Koon]";
+ mes "Though I'm busy, I always attend this meeting.";
+ mes "I'd like this to be held at times that don't disturb my work.";
+ close;
+ } else if (ma_tomas == 1) {
+ mes "[Koon]";
+ mes "I expect what comes up today.";
+ close;
+ } else if (ma_tomas == 2) {
+ mes "[Koon]";
+ mes "Scottfold is the one who participates enthusiastically.";
+ mes "They say that he'll be the next president of this meeting.";
+ close;
+ } else if (ma_tomas == 3) {
+ mes "[Koon]";
+ mes "Then, how's the study of Dr. Devore going?";
+ next;
+ mes "[President of Meeting]";
+ mes "The language of Starfish is not undertandable even for the linguist, Dr. Devore...";
+ next;
+ mes "[Linguist Devore]";
+ mes "President! As for that matter, I'd like to speak for myself about the study.";
+ next;
+ mes "[President of Meeting]";
+ mes "Yes. Carry on please.";
+ set ma_tomas,4;
+ changequest 11211,11212;
+ emotion e_paper,0,"Linguist Devore#mal";
+ close;
+ }
+ mes "[Koon]";
+ mes "I hope the study of Dr. Devore comes out soon.";
+ mes "I am very interested in the language as well!";
+ close;
+}
+
+mal_in02,174,64,5 script Linguist Devore#mal 549,{
+ if (ma_tomas < 4) {
+ mes "[Linguist Devore]";
+ mes "Most of our cats are especially talented in language.";
+ mes "This has a great effect on the prosperity of our merchants.";
+ next;
+ mes "[Linguist Devore]";
+ mes "Because... it means you can do business in more areas if you know more foreign languages.";
+ close;
+ } else if (ma_tomas == 4) {
+ mes "[Linguist Devore]";
+ mes "Hello everyone.";
+ mes "I am a linguist, Dr. Devore, in charge of the study on the Starfish language.";
+ next;
+ mes "[Linguist Devore]";
+ mes "Let me say the definite conclusion first. Since ^0000FFthe study on the Starfish language^000000 started from the time we settled in Malangdo, there's been no remarkable outcome yet.";
+ emotion e_swt2;
+ next;
+ mes "[Linguist Devore]";
+ mes "Of course it is possible to talk with ^6666ccBiscuit^000000 somehow, but this is not close to the result we expected to solve the situation.";
+ next;
+ mes "[Koon]";
+ mes "Then, how's the study on the book we found last time?";
+ next;
+ mes "[Linguist Devore]";
+ mes "This book we assumed to be written in the Starfish language. But when I asked Biscuit, it turns out that it's a textbook to learn the Starfish language...";
+ next;
+ mes "[Koon]";
+ mes "Isn't it very helpful for studying the Starfish language, then?";
+ next;
+ mes "[Linguist Devore]";
+ mes "I surely thought that, but when I tried the conversation as it teaches, we ended up finding they couldn't understand it at all.";
+ next;
+ mes "[Linguist Devore]";
+ mes "If you see the words on the first page of this book, there's a sentence seeming like short conversation.";
+ next;
+ mes "[Linguist Devore]";
+ mes "It's like this, for the question, ¬¬¬Ñ¬Ü ¬ã¬Ú?, it says, ¬¡¬Ù ¬ã¬ì¬Þ ¬Õ¬à¬Ò¬â¬Ö, ¬Ò¬Ý¬Ñ¬Ô¬à¬Õ¬Ñ¬â¬ñ. ¬¡ ¬£¬Ú¬Ö?";
+ next;
+ mes "[Linguist Devore]";
+ mes "Though I tried talking to Biscuit like this, there was no feedback.";
+ next;
+ mes "[Linguist Devore]";
+ mes "After that, as for this book, the existence of the book itself has been studied on the other side.";
+ next;
+ mes "[President of Meeting]";
+ mes "Ok, we listened well to what Dr. Devore said.";
+ mes "Then, let's wrap up the progress of the language study, and listen to Geologist, Dr. Mali.";
+ set ma_tomas,5;
+ changequest 11212,11213;
+ emotion e_paper,0,"Geologist Mali#mal";
+ close;
+ } else if (ma_tomas < 18) {
+ mes "[Linguist Devore]";
+ mes "Hoo...";
+ mes "The Starfish language is the hardest matter in my studying life.";
+ next;
+ mes "[Linguist Devore]";
+ mes "I should solve the puzzling Starfish language soon.";
+ mes "I'm ashamed to see you all like this as a result.";
+ emotion e_swt2;
+ close;
+ } else if (ma_tomas == 18) {
+ mes "[Linguist Devore]";
+ mes "Right...";
+ mes "This language world is so beautiful and mysterious.";
+ next;
+ mes "[Linguist Devore]";
+ mes "There are mysteries like why the same beings use totally different languages, or why very far kinds use similar languages.";
+ next;
+ mes "[Linguist Devore]";
+ mes "I joined this group because I thought that traveling all around the world was much more helpful to study, not just reading a book at a desk.";
+ next;
+ mes "[Linguist Devore]";
+ mes "But this Starfish is just mysterious.";
+ mes "I cannot understand it at all.";
+ mes "I am rather doubtful to say it's actual 'language'.";
+ emotion e_swt2;
+ next;
+ mes "[Linguist Devore]";
+ mes "I have no clue, though I study it in various ways.";
+ mes "Biscuit got used to our language, rather, and short talk is possible, but we cannot say it is conversation yet.";
+ next;
+ mes "[Linguist Devore]";
+ mes "I feel frustrated and more to study like this, but it should be solved to deal with the other matters.";
+ next;
+ mes "[Linguist Devore]";
+ mes "I don't see what's wrong here!";
+ mes "Myself, who used to be called a master of language!";
+ mes "I've never expected to come across this untouchable stuff!";
+ next;
+ mes "[Linguist Devore]";
+ mes "Wooaaa wooaaa ahhh!!!!";
+ mes "I don't see what's wrong here!";
+ emotion e_omg;
+ next;
+ mes "[Linguist Devore]";
+ mes "Why are they here and what do they want!";
+ mes "I'd be good enough if I could just know it!";
+ set ma_tomas,19;
+ changequest 11225,11226;
+ close;
+ } else if (ma_tomas == 19) {
+ mes "[Linguist Devore]";
+ mes "Wooaaa wooaaa ahhh!!!!";
+ mes "I don't see what's wrong here!";
+ emotion e_omg;
+ next;
+ mes "[Linguist Devore]";
+ mes "Why are they here and what do they want!";
+ mes "I'd be good enough if I could just know it!";
+ close;
+ } else if (ma_tomas == 20) {
+ mes "[Linguist Devore]";
+ mes "What?! What did you say?!";
+ mes "Fluently said!";
+ mes "How come!";
+ emotion e_omg;
+ next;
+ mes "[Linguist Devore]";
+ mes "I can't believe it unless I see it with my own eyes.";
+ mes "It's not right if he spoke only to me like that, isn't it?";
+ next;
+ mes "[Linguist Devore]";
+ mes "Let's go and hear it together!!";
+ set ma_tomas,21;
+ changequest 11227,11228;
+ close;
+ } else if (ma_tomas < 34) {
+ mes "[Linguist Devore]";
+ mes "The study by this time was just making a totally wrong guess!";
+ mes "But before you're disappointed, I'd rather be happy enough to get the answer.";
+ emotion e_no1;
+ next;
+ mes "[Linguist Devore]";
+ mes "Once we get the answer, it's only a matter of time before understanding the Starfish language.";
+ close;
+ } else if (ma_tomas == 34) {
+ mes "[Linguist Devore]";
+ mes "Is it true?!";
+ mes "Did Biscuit say so?!";
+ emotion e_omg;
+ next;
+ mes "[Linguist Devore]";
+ mes "Ah, ah! Thanks to you, "+strcharinfo(0)+"!";
+ mes "I feel so grateful.";
+ next;
+ mes "[Linguist Devore]";
+ mes "I have to meet Biscuit right now and say thank you.";
+ mes "It'd be possible to express my grateful mind, though we cannot understand each other.";
+ next;
+ mes "[Linguist Devore]";
+ mes "Ah, and I really want to tell this happy news to our chief, Tomas.";
+ mes "Please!!";
+ emotion e_hlp;
+ set ma_tomas,35;
+ changequest 11236,11237;
+ getitem 6422,30; //Egrade_Coin
+ close;
+ } else if (ma_tomas == 35) {
+ mes "[Linguist Devore]";
+ mes "Ah, and I really want to tell this happy news to our chief, Tomas.";
+ mes "Please!!";
+ emotion e_hlp;
+ close;
+ }
+ mes "[Linguist Devore]";
+ mes "Ah, ah!!";
+ mes "The study on Starfish is going well.";
+ mes "It could've really been a disaster, if you, "+strcharinfo(0)+", didn't help us.";
+ emotion e_thx;
+ close;
+}
+
+mal_in02,179,57,1 script Geologist Mali#mal 559,{
+ if (ma_tomas < 5) {
+ mes "[Geologist Mali]";
+ mes "Malangdo is named because the ground here is so soft, mew~";
+ mes "It gets hard when you touch it, mew~";
+ emotion e_slur;
+ close;
+ } else if (ma_tomas == 5) {
+ mes "[Geologist Mali]";
+ mes "Mali, mew~";
+ mes "As you all know, there are many places with cracks in the ground, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "It's not that serious or risky a problem yet, mew~";
+ mes "As we cannot predict when Star Candy will move, it's best to repair these first for now, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "But, as always, there is a shortage of labor, mew~";
+ mes "We need many more participants, I think, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "As everyone has their own work to do, I understand that we all must be busy. But I'd like to participate in this repairing, since it's related to our life.";
+ emotion e_hlp;
+ next;
+ mes "[Brie]";
+ mes "Wait!";
+ mes "It's not something to be done only with instant repairs!";
+ mes "My father was seriously injured from the earthquake some time ago!";
+ emotion e_omg,0,"Brie#mal";
+ next;
+ mes "[President of Meeting]";
+ mes "Mr. Brie!! I understand what your situation is, but please clam dowm, since we're having a meeting.";
+ set ma_tomas,6;
+ changequest 11213,11214;
+ emotion e_paper,0,"Brie#mal";
+ close;
+ } else if (ma_tomas < 13) {
+ mes "[Geologist Mali]";
+ mes "You attended to the meeting instead of your father today, Brie.";
+ mes "He's quite unfriendly but devoted to his parents, mew~";
+ emotion e_heh;
+ next;
+ mes "[Geologist Mali]";
+ mes "Mr. Brie was not a member of our group at first, but he joined in after getting the news that his father, Rican, joined in with the new trade course development, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "But Brie seems to have been shocked when Rican was hurt last time, mew~";
+ mes "I should study more to not let this kind of thing happen again, mew~";
+ close;
+ } else if (ma_tomas == 13) {
+ mes "[Geologist Mali]";
+ mes "Malangdo is a really special island, mew~";
+ mes "Literally, it's soft.";
+ next;
+ mes "[Geologist Mali]";
+ mes "Although I visited so many places following the group, I've never seen ground as soft as Malangdo.";
+ mes "If you press the ground by mistake...";
+ mes "it has magic so that you end up continously doing it over and over.";
+ next;
+ mes "[Geologist Mali]";
+ mes "Soft and sticky feeling like this...";
+ mes "Haha~ it gets you addicted to it...";
+ emotion e_shy;
+ next;
+ mes "[Geologist Mali]";
+ mes "Oops!!";
+ mes "I was about to be sunk into this softness, mew~!!!";
+ emotion e_omg;
+ next;
+ mes "[Geologist Mali]";
+ mes "Though it's got the risk of making you lose your mind, it helped the ship Navi not to break, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "By the way, it doesn't have a special element in it, but is made up of common soil, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "Moreover!!";
+ mes "How come it's been ^0000FFcracked with this softness^000000, mew~!";
+ emotion e_omg;
+ next;
+ mes "[Geologist Mali]";
+ mes "If this ^0000FFcrack goes on, the underground support may collapse^000000, mew...";
+ next;
+ mes "[Geologist Mali]";
+ mes "There are many forces in for the repairing of the cracks, it feels like it's not enough, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "So we receive applications for voluntary service, mew~";
+ mes "Though it's voluntary service, it's not free. So, please visit me at any time you want, mew~";
+ next;
+ switch(select("Help repairing.:Finish the talk.")) {
+ case 1:
+ mes "[Geologist Mali]";
+ mes "Khhh!!!";
+ mes "What a beatiful young person in this hard world!!!";
+ mes "Whenever I come across a person like you, I feel this life is still good to live, mew~";
+ emotion e_sob;
+ next;
+ mes "[Geologist Mali]";
+ mes "Please listen to ^6666ccmy assistant, Bob^000000 in detail, mew~";
+ mes "Get out of here and visit the ^6666cca room on your right^000000, mew~";
+ set ma_tomas,14;
+ setquest 11221;
+ close;
+ case 2:
+ mes "[Geologist Mali]";
+ mes "Woohoohoo.";
+ mes "I~will~be~waiting~for~you~~";
+ emotion e_lv2;
+ close;
+ }
+ } else if (ma_tomas == 14) {
+ mes "[Geologist Mali]";
+ mes "Khhh!!!";
+ mes "What a beatiful young person in this hard world!!!";
+ mes "Whenever I come across a person like you, I feel this life is still good to live, mew~";
+ emotion e_sob;
+ next;
+ mes "[Geologist Mali]";
+ mes "Please listen to ^6666ccmy assistant, Bob^000000 in detail, mew~";
+ mes "Get out of here and visit the ^6666cca room on your right^000000, mew~";
+ close;
+ } else if (ma_tomas == 15 || ma_tomas == 16) {
+ mes "[Geologist Mali]";
+ mes "Is the repairing of the cracks going well, mew?";
+ mes "Don't overdo yourself, mew~";
+ mes "It'd be bad if your health gets worse, mew~";
+ close;
+ } else if (ma_tomas == 17) {
+ mes "[Geologist Mali]";
+ mes "Ah! Bob complimented you so much on your great job, mew~";
+ mes "Please help us next time again when you can, mew~";
+ emotion e_no1;
+ next;
+ mes "[Linguist Devore]";
+ mes "I made this, since the Starfish study was well finished and you didn't need to do such hard work like this!";
+ mes "Sob sob!!!";
+ emotion e_sob,0,"Linguist Devore#mal";
+ next;
+ mes "[Geologist Mali]";
+ mes "Ohhh! What are you talking about Dr. Devore, mew~!!!!";
+ mes "I don't think that way at~~all, mew~!!!";
+ emotion e_omg;
+ next;
+ mes "[Geologist Mali]";
+ mes "Everyone knows how you, Dr. Devore, are studying hard, mew~!!!";
+ mes "You do your best, so be more confident, mew~!";
+ set ma_tomas,18;
+ completequest 11224;
+ setquest 11225;
+ setquest 11243;
+ getitem 6422,20; //Egrade_Coin
+ close;
+ } else if (ma_tomas > 99) {
+ if (checkquest(11240) > -1 || checkquest(11241) > -1) {
+ mes "[Geologist Mali]";
+ mes "Please listen to ^6666ccmy assistant, Bob^000000 in detail, mew~.";
+ mes "Get out of here and visit the ^6666cca room on your right^000000, mew~";
+ close;
+ } else if (checkquest(11242) > -1) {
+ mes "[Geologist Mali]";
+ mes "Ah! Bob complimented you so much on your great job, mew~";
+ mes "Please help us next time again when you can, mew~";
+ changequest 11242,11243;
+ getitem 6422,4; //Egrade_Coin
+ close;
+ } else {
+ if (checkquest(11243,PLAYTIME) == 0 || checkquest(11243,PLAYTIME) == 1) {
+ mes "[Geologist Mali]";
+ mes "Don't overdo yourself, mew~";
+ mes "It'd be bad if your health gets worse, mew~";
+ close;
+ }
+ if (checkquest(11243,PLAYTIME) == 2)
+ erasequest 11243;
+ mes "[Geologist Mali]";
+ mes "There is a lot more repairing left to do for today!";
+ mes "It doesn't seem to be an easy thing to solve, mew~";
+ next;
+ switch(select("I will help.:I will stop.")) {
+ case 1:
+ mes "[Geologist Mali]";
+ mes "Please listen to ^6666ccmy assistant, Bob^000000 in detail, mew~";
+ mes "Get out of here and visit the ^6666cca room on your right^000000, mew~";
+ setquest 11240;
+ close;
+ case 2:
+ mes "[Geologist Mali]";
+ mes "Then please take a rest, mew~";
+ mes "I will see you next chance then, mew~";
+ close;
+ }
+ }
+ }
+ mes "[Geologist Mali]";
+ mes "Soft and sticky feeling like this...";
+ mes "Haha~ it gets you addicted to it...";
+ emotion e_slur;
+ close;
+}
+
+mal_in02,140,94,0 script Bob#mal 553,{
+ if (ma_tomas < 14) {
+ mes "[Bob]";
+ mes "You bow-wow! bow! wow! I mew! mew! mew!";
+ mes "I'm into juice from delicious fish, mew~";
+ emotion e_ho;
+ close;
+ } else if (ma_tomas == 14) {
+ // Dialogue in repeatable quest is identical.
+ // Uses a variable to determine the quest mode.
+ set @mal_bob_q,1;
+ L_Quest1:
+ set .@i, @mal_bob_q;
+ set @mal_bob_q,0;
+ mes "[Bob]";
+ mes "You bow-wow! bow! wow! I mew! mew! mew!";
+ mes "I'm into juice from delicious fish, mew~";
+ emotion e_ho;
+ next;
+ mes "[Bob]";
+ mes "Ah ahhh!!!!!!!!!!!";
+ mes "Are you here for voluntary service?!";
+ emotion e_omg;
+ next;
+ if (checkweight(1201,1) == 0) {
+ mes "[Bob]";
+ mes "Ummm... be lightened with your mind and body when doing voluntary service!";
+ mes "You seem to have too much stuff, so get yourself lightened~";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes "[Bob]";
+ mes "Ummm... be lightened with your mind and body when doing voluntary service!";
+ mes "You seem to have a lot of heavy stuff, so get yourself lightened~";
+ close;
+ }
+ switch(select("Yes.:No.")) {
+ case 1:
+ mes "[Bob]";
+ mes "Khhh...";
+ mes "Impressed!!!";
+ mes "I am impressed!!!";
+ mes "The impressive mind is dancing in my heart!!!";
+ emotion e_omg;
+ next;
+ mes "[Bob]";
+ mes "I treated the people like I looked down on them and had a prejudice against human beings!!!";
+ mes "I feel like crying with scales!!!!";
+ mes "Impressed!!!";
+ mes "Impression Pegasus Hurricane!!!";
+ emotion e_omg;
+ next;
+ select("Stop it! Tell me how to repair the cracks.");
+ mes "[Bob]";
+ mes "Ah!";
+ next;
+ mes "[Bob]";
+ mes "Hooo...";
+ mes "I was so impressed that I was rude to someone I met for the first time.";
+ next;
+ mes "[Bob]";
+ mes "Repairing the cracks is rather simple.";
+ mes "Anyone can do it easily with just this ^0000FFFix Kit^000000!";
+ next;
+ mes "[Bob]";
+ mes "Fill in the part with this mixture of gray and white clay, and fix the cracks with a stapler.";
+ mes "And I'll skip explaining how to use the other tools, since you know already.";
+ next;
+ mes "[Bob]";
+ mes "Ah, right...";
+ mes "^0000ffYou may fall into the gap of the crack, unfortunately, so please watch out.^000000";
+ if (.@i == 1) {
+ set ma_tomas,15;
+ changequest 11221,11222;
+ } else
+ changequest 11240,11241;
+ getitem 6434,1; //Fix_Kit
+ close;
+ case 2:
+ mes "[Bob]";
+ mes "Ah, right...";
+ mes "I see...";
+ mes "Disappointed...";
+ mes "Hoohoot shh shh~";
+ emotion e_otl;
+ close;
+ }
+ } else if (ma_tomas == 15) {
+ L_Quest2:
+ if (checkweight(1201,1) == 0) {
+ mes " - Notice !! -";
+ mes " - Since you have too many items - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes " - Notice !! -";
+ mes " - Since your items are too heavy - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ mes "[Bob]";
+ mes "Repairing the cracks is rather simple.";
+ mes "Anyone can do it easily with just this ^0000FFFix Kit^000000!";
+ if (countitem(6434) == 0)
+ getitem 6434,1; //Fix_Kit
+ next;
+ mes "[Bob]";
+ mes "Fill in the part with this mixture of gray and white clay, and fix the cracks with a stapler.";
+ mes "And I'll skip explaining how to use the other tools, since you know already.";
+ next;
+ mes "[Bob]";
+ mes "Ah, right...";
+ mes "^0000ffYou may fall into the gap of the crack, unfortunately, so please watch out.^000000";
+ close;
+ } else if (ma_tomas == 16) {
+ mes "[Bob]";
+ mes "Khhh~~~~~~~~~~~~~~~~~~~~~~";
+ mes "That was perfect!";
+ emotion e_no1;
+ next;
+ mes "[Bob]";
+ mes "The adhesive filled in just right!!";
+ mes "The perfect stapler job!!";
+ mes "The speechless and marvelous finishing skill!!";
+ next;
+ mes "[Bob]";
+ mes "Impressed!";
+ mes "Mysterious!";
+ mes "Shocked!";
+ emotion e_omg;
+ next;
+ mes "[Bob]";
+ mes "You did a great job indeed!!!";
+ mes "I will tell Dr. Mali!";
+ if (countitem(6434) > 0)
+ delitem 6434,1; //Fix_Kit
+ set ma_tomas,17;
+ changequest 11223,11224;
+ close;
+ } else if (ma_tomas > 99) {
+ if (checkquest(11240) > -1) {
+ set @mal_bob_q,2;
+ goto L_Quest1;
+ } else if (checkquest(11241) > -1)
+ goto L_Quest2;
+ }
+ mes "[Bob]";
+ mes "You bow-wow! bow! wow! I mew! mew! mew!";
+ mes "I'm into juice from delicious fish, mew~";
+ emotion e_ho;
+ close;
+}
+
+- script Crack#mal0 -1,{
+ if (.off) end; // Official script uses a 1-second timer to disable cracks. Added to prevent abuse.
+ if (ma_tomas == 15 || checkquest(11241) > -1) {
+ if (countitem(6434) < 1) {
+ mes "- To repair the crack -";
+ mes "- you need a Fix Kit. -";
+ close;
+ }
+ set .@ma_cr1, rand(1,10);
+ if (.@ma_cr1 < 5) {
+ mes "- Ground is a bit cracked. -";
+ mes "- Used a stapler. -";
+ set .off,1;
+ donpcevent "Crackt"+substr(strnpcinfo(2),3,getstrlen(strnpcinfo(2))-1)+"#mal::OnEnable";
+ close;
+ } else if (.@ma_cr1 == 7) {
+ mes "- With the crack opening -";
+ mes "- at the center, -";
+ mes "- the ground gets soft -";
+ mes "- and you are instantly -";
+ mes "- sucked into the ground. -";
+ close2;
+ warp "mal_dun01",0,0;
+ end;
+ } else {
+ while (1) {
+ switch(select("Repair the gap.:Use the stapler.")) {
+ case 1:
+ switch(rand(1,3)) {
+ case 1:
+ mes "- Mix the two colors of -";
+ mes "- adhesives and put it on -";
+ mes "- the crack meticulously. -";
+ break;
+ case 2:
+ mes "- Use a plump sea squirt -";
+ mes "- for the cracked gap.-";
+ break;
+ case 3:
+ mes "- Use a slithery sea cucumber -";
+ mes "- for the cracked gap.-";
+ break;
+ }
+ next;
+ break;
+ case 2:
+ mes "- Used the stapler for the crack -";
+ mes "- and fixed it well. -";
+ next;
+ mes "- It seems the crack -";
+ mes "- is well filled. -";
+ next;
+ if (rand(1,3) == 2) {
+ mes "- Let's get back to report this. -";
+ if (ma_tomas == 15) {
+ set ma_tomas,16;
+ changequest 11222,11223;
+ }
+ if (checkquest(11241) > -1) {
+ changequest 11241,11242;
+ }
+ } else {
+ mes "- Let's find -";
+ mes "- the other cracks. -";
+ }
+ set .off,1;
+ donpcevent "Crackt"+substr(strnpcinfo(2),3,getstrlen(strnpcinfo(2))-1)+"#mal::OnEnable";
+ close;
+ }
+ }
+ }
+ }
+ mes "- I can see the crack. -";
+ mes "- It seems there's still -";
+ mes "- not enough supporters yet. -";
+ close;
+OnEnable:
+ enablenpc strnpcinfo(0);
+ end;
+OnDisable:
+ set .off,0;
+ disablenpc strnpcinfo(0);
+ end;
+}
+malangdo,114,157,0 duplicate(Crack#mal0) Crack#mal1 550
+malangdo,284,237,0 duplicate(Crack#mal0) Crack#mal2 550
+malangdo,134,150,0 duplicate(Crack#mal0) Crack#mal3 550
+malangdo,173,199,0 duplicate(Crack#mal0) Crack#mal4 550
+malangdo,233,197,0 duplicate(Crack#mal0) Crack#mal5 550
+malangdo,137,239,0 duplicate(Crack#mal0) Crack#mal6 550
+malangdo,239,157,0 duplicate(Crack#mal0) Crack#mal7 550
+malangdo,221,155,0 duplicate(Crack#mal0) Crack#mal8 550
+malangdo,217,109,0 duplicate(Crack#mal0) Crack#mal9 550
+malangdo,162,183,0 duplicate(Crack#mal0) Crack#mal10 550
+
+- script Crackt0#mal -1,{
+ end;
+OnInit:
+ disablenpc strnpcinfo(0);
+ end;
+OnEnable:
+ enablenpc strnpcinfo(0);
+ initnpctimer;
+ end;
+OnDisable:
+ stopnpctimer;
+ disablenpc strnpcinfo(0);
+ end;
+OnTimer1000:
+ donpcevent "Crack#mal"+substr(strnpcinfo(1),6,getstrlen(strnpcinfo(1))-1)+"::OnDisable";
+ end;
+OnTimer30000:
+ donpcevent "Crack#mal"+substr(strnpcinfo(1),6,getstrlen(strnpcinfo(1))-1)+"::OnEnable";
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+}
+- duplicate(Crackt0#mal) Crackt1#mal -1
+- duplicate(Crackt0#mal) Crackt2#mal -1
+- duplicate(Crackt0#mal) Crackt3#mal -1
+- duplicate(Crackt0#mal) Crackt4#mal -1
+- duplicate(Crackt0#mal) Crackt5#mal -1
+- duplicate(Crackt0#mal) Crackt6#mal -1
+- duplicate(Crackt0#mal) Crackt7#mal -1
+- duplicate(Crackt0#mal) Crackt8#mal -1
+- duplicate(Crackt0#mal) Crackt9#mal -1
+- duplicate(Crackt0#mal) Crackt10#mal -1
+
+mal_in02,181,55,3 script Brie#mal 545,{
+ if (ma_tomas < 6) {
+ mes "[Brie]";
+ mes "Sorry, but I don't feel like talking with you. Please leave me alone.";
+ close;
+ } else if (ma_tomas == 6) {
+ mes "[Brie]";
+ mes "Sorry, President.";
+ next;
+ mes "[Brie]";
+ mes "Though Star Candy is supporting the ground of Malangdo,";
+ mes "we don't understand its purpose or reason at all.";
+ mes "Should we just expect not to find anything?";
+ next;
+ mes "[President of Meeting]";
+ mes "As Dr. Devore said, it's better to wait for the results, since he's still studying...";
+ next;
+ mes "[Brie]";
+ mes "What would you do if Star Candy left, and you had only waited?";
+ mes "Malangdo may go under. I cannot just wait here like this.";
+ next;
+ mes "[President of Meeting]";
+ mes "But, Brie, we know there's nothing but waiting.";
+ mes "An enormous crack was made when Star Candy tried to make the support stand last time, as she seemed to be shocked and moved too much.";
+ next;
+ mes "[Geologist Mali]";
+ mes "Besides, since ^0000FFStar Candy's location plays the role of pillar for this island, it seems the center would go down as you even set up pillars around her^000000, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "Due to the nature of this large basement space, if the center were to collapse, we can't expect what comes next. Our researchers therefore think we should treat it as carefully as we can, mew~";
+ next;
+ mes "[Brie]";
+ mes "...";
+ next;
+ mes "[President of Meeting]";
+ mes "We know that Rican's injury may affect the trade of Yggdrasil Berry, so don't worry too much.";
+ next;
+ mes "[President of Meeting]";
+ mes "As for that matter, we're going to plan for it by discussing it with our chief, Tomas.";
+ next;
+ mes "[Brie]";
+ mes "Yes...";
+ next;
+ mes "[President of Meeting]";
+ mes "Well, let's have a break for now.";
+ mes "In time, Samuel brought Seaweed and tuna here.";
+ set ma_tomas,7;
+ completequest 11214;
+ setquest 11215;
+ close;
+ } else if (ma_tomas == 7) {
+ mes "[Brie]";
+ mes "What?!";
+ mes "I won't listen if you are nagging.";
+ next;
+ switch(select("About Rican.:I will stop.")) {
+ case 1:
+ mes "[Brie]";
+ mes "As for my father?";
+ mes "He's the master of Yggdrasil Berry in this island.";
+ next;
+ mes "[Brie]";
+ mes "He can only do little things, like pushing the button of the dry machine, until his legs recover from the earthquake.";
+ mes "The amount of Yggdrasil Berry dramatically decreased.";
+ next;
+ mes "[Brie]";
+ mes "I've been harvesting them instead of him, but...";
+ next;
+ mes "[Brie]";
+ mes "Anyhow, I don't know very much about it, since I've just started this. If you want to ask about the Yggdrasil Berry, go to my house in the ^6666ccwest of Malangdo^000000.";
+ next;
+ mes "[Brie]";
+ mes "My father will be staying there saying he's really bored today again...";
+ set ma_tomas,8;
+ changequest 11215,11216;
+ close;
+ case 2:
+ mes "[Brie]";
+ mes "Hoo...";
+ close;
+ }
+ } else if (ma_tomas < 12) {
+ mes "[Brie]";
+ mes "Anyhow, I don't know very much about it, since I've just started this. If you want to ask about the Yggdrasil Berry, go to my house in the ^6666ccwest of Malangdo^000000.";
+ next;
+ mes "[Brie]";
+ mes "My father will be staying there saying he's really bored today again...";
+ close;
+ } else if (ma_tomas == 12) {
+ mes "[Brie]";
+ mes "Dr. Mali, please let me help to repair the cracks!";
+ mes "You called me more often long ago, but why do you say you can't give me the work now?";
+ next;
+ mes "[Geologist Mali]";
+ mes "No, mew~";
+ mes "Brie, you have to help your father, mew~";
+ next;
+ mes "[Brie]";
+ mes "But if this island goes down, all the fuss isn't useful at all!";
+ next;
+ mes "[Geologist Mali]";
+ mes "It's the same as the chicken and egg situation, mew~";
+ mes "If we have any problems selling Yggdrasil Berry, we cannot buy the tools to repair the cracks, mew~";
+ next;
+ mes "[Brie]";
+ mes "...";
+ next;
+ mes "[Geologist Mali]";
+ mes "So, go back home and help your father, mew~";
+ next;
+ mes "[Brie]";
+ mes "Ok, then I'll come back again if his legs have recovered.";
+ next;
+ mes "[Geologist Mali]";
+ mes "Good.";
+ mes "I'll wait for you, mew~";
+ next;
+ mes "[Geologist Mali]";
+ mes "Now as I get him back home, I'm going to find the participants, mew~";
+ mes "Cheers!";
+ set ma_tomas,13;
+ completequest 11220;
+ close;
+ }
+ mes "[Brie]";
+ mes "Hew... I think I changed from being fussy, as I felt nervous.";
+ mes "Now I will think of only the harvest of fussy.";
+ close;
+}
+
+mal_in01,114,169,5 script Rican#mal 547,{
+ if (ma_tomas < 9) {
+ mes "[Rican]";
+ mes "Woo waa hoohoo...";
+ mes "Woowaa ahhh ahh ahh...";
+ mes "I'm impatient... to stay home like this!!";
+ emotion e_yawn;
+ next;
+ mes "[Rican]";
+ mes "When will my legs recover, when?!";
+ mes "They should be better soon, so that I can work like before...";
+ mes "But I can hardly move.";
+ if (ma_tomas < 8)
+ close;
+ next;
+ mes "[Rican]";
+ mes "All I can do is press the button all day long~";
+ mes "This is not exciting at all~";
+ mes "I'm not willing to do anything more and more~ Doobie dooba~";
+ emotion e_yawn;
+ next;
+ select("Excuse me. Is this Rican's house?");
+ mes "[Rican]";
+ mes "Huh?";
+ mes "Who are you!";
+ mes "I am Rican!";
+ mes "It's good to see you, since I'm so bored now...";
+ mes "Tell me what's happening right now! Now!";
+ emotion e_omg;
+ next;
+ select("Ask about Yggdrasil Berry.");
+ mes "[Rican]";
+ mes "Yggdrasil Berry?";
+ mes "You... you know something!";
+ mes "Umm, hahaha!";
+ mes "Only a few cats know about Yggdrasil Berry!";
+ emotion e_flash;
+ next;
+ mes "[Rican]";
+ mes "Well, before I traded them with human beings like you, Yggdrasil Berry was not thought to be a very remarkable fruit.";
+ next;
+ mes "[Rican]";
+ mes "It used to be spread out here and there in my old town. It doesn't have a good taste and causes indigestion, mew~";
+ mes "Cats need to eat fishes, naturally.";
+ emotion e_slur;
+ next;
+ mes "[Rican]";
+ mes "But if human beings eat this, it gets you fully recharged.";
+ next;
+ mes "[Rican]";
+ mes "At first, I'd never thought it could be sold at all!";
+ next;
+ mes "[Rican]";
+ mes "Khhh~";
+ mes "It was just awesome at that time...";
+ next;
+ mes "[Rican]";
+ mes "Very long ago...";
+ mes "Our group left the town for a new course to trade.";
+ emotion e_shy;
+ next;
+ mes "[Rican]";
+ mes "Actually, we dominated the areas around our town, and it was like a challenge to find unexplored areas.";
+ next;
+ mes "[Rican]";
+ mes "But discovering the unknown is the romance of a man, isn't it?";
+ emotion e_awsm;
+ next;
+ mes "[Rican]";
+ mes "Well, the beginning was quite nice, anyway.";
+ mes "After a month or two floating on the sea...";
+ next;
+ mes "[Rican]";
+ mes "The sea has enough fishes in it, but it made me bored. I wanted to eat seasoning, like radish with chicken the most.";
+ emotion e_rice;
+ next;
+ mes "[Rican]";
+ mes "Though we drifted for a very long time, we couldn't land on any island. Rather, we met storms.";
+ next;
+ mes "[Rican]";
+ mes "It was my first time seeing such a harsh tornado.";
+ mes "At that time I was out of my mind and thought I would die.";
+ next;
+ mes "[Rican]";
+ mes "I don't know the about the other ships, but this ship Navi luckily landed here in this island.";
+ next;
+ mes "[Rican]";
+ mes "Khhh khhh!";
+ mes "Can you believe it?";
+ mes "^0000FFThat enormous ship just flied, vroom~~ like an airship and was dropped here in the middle of this island!^000000";
+ emotion e_omg;
+ next;
+ mes "[Rican]";
+ mes "Anyhow, I survived, but most of the goods in the ship were swept and we were left with only Yggdrasil Berry.";
+ next;
+ mes "[Rican]";
+ mes "Huh? Why did we load them, if we don't eat them?";
+ mes "It... it's the secret...";
+ emotion e_swt;
+ next;
+ mes "[Rican]";
+ mes "Well, it's not important. As we sent reconnaissance groups there, we found out that there's a land where the other kind lives, not like us.";
+ mes "That was the land of you, human beings.";
+ next;
+ mes "[Rican]";
+ mes "Regardless of the process, we found the new area to trade as we had first intended... we still have a small problem of not knowing how to get back to our howmetown yet...";
+ next;
+ mes "[Rican]";
+ mes "We cats started selling with powerful viability.";
+ mes "But we had only Yggdrasil Berry, right?";
+ mes "We sold it with no high expectations, but could sell like hot cakes.";
+ next;
+ mes "[Rican]";
+ mes "As rumors went, it was sold at very high prices among human beings and had a remarkable effect on them.";
+ mes "So we finally settled down to sell Yggdrasil Berry with growing profits.";
+ next;
+ mes "[Rican]";
+ mes "But we are selling the dried kind, which is ^0000FFa bit different from what human being originally know, and less effective, and hard to eat raw^000000.";
+ next;
+ mes "[Rican]";
+ mes "Since it disappears as we prepare, it's definately the best for our group.";
+ emotion e_pat;
+ next;
+ mes "[Rican]";
+ mes "By the way, as I got injured in this important season, it harms my credibility if I don't meet the deadline to deliver the amount ordered!";
+ mes "Trading is credibility!!!";
+ emotion e_omg;
+ next;
+ mes "[Rican]";
+ mes "For this reason, would you like to help me?";
+ mes "Though my son is helping me, the amount we can prepare is not enough.";
+ next;
+ switch(select("I'll help him.:I won't.")) {
+ case 1:
+ mes "[Rican]";
+ mes "Khhh!";
+ mes "I had a good impression of you from the first time!";
+ next;
+ mes "[Rican]";
+ mes "Harvesting Yggdrasil Berry is very easy.";
+ mes "You can get it when you just dig the ground, mew~";
+ emotion e_omg,1;
+ next;
+ select("?!");
+ mes "[Rican]";
+ mes "Huh?";
+ mes "Doesn't it originally come from the ground?";
+ emotion e_omg,1;
+ next;
+ select("Doesn't it grow on trees?");
+ mes "[Rican]";
+ mes "Well, the Yggdrasil Berry in Midgard could do so.";
+ mes "But ^6666ccwe dig our Yggdrasil Berry here from the ground^000000.";
+ emotion e_omg,1;
+ next;
+ mes "[Rican]";
+ mes "You can get it on Malangdo Island easily. Bring me about 30.";
+ mes "Ah! Keep the secret to my son for sure~";
+ mes "Then please^ff99cc!!!^000000 please^ff99cc!!!^000000 please~~~";
+ emotion e_kis;
+ set ma_tomas,9;
+ changequest 11216,11217;
+ close;
+ case 2:
+ mes "[Rican]";
+ mes "Oh? Then it's okay, if you can't help it.";
+ mes "My injured leg feels so bad... -groaning-";
+ close;
+ }
+ } else if (ma_tomas == 9) {
+ if (countitem(6435) < 30) {
+ mes "[Rican]";
+ mes "You can get it on Malangdo Island easily. Bring me about 30.";
+ mes "Ah! Keep the secret to my son for sure~";
+ mes "Then please^ff99cc!!!^000000 please^ff99cc!!!^000000 please~~~";
+ emotion e_kis;
+ close;
+ }
+ mes "[Rican]";
+ mes "Oh, oh!!";
+ mes "This fresh smell!!!";
+ mes "Haaa~ How fresh, good job!";
+ mes "You're good at harvesting Yggdrasil Berry?";
+ next;
+ mes "[Rican]";
+ mes "Then would you put it in the machine in front of me?";
+ set ma_tomas,10;
+ changequest 11217,11218;
+ close;
+ } else if (ma_tomas == 10) {
+ mes "[Rican]";
+ mes "Oh, oh!!";
+ mes "This fresh smell!!!";
+ mes "Haaa~ How fresh, good job!";
+ mes "You're good at harvesting Yggdrasil Berry?";
+ next;
+ mes "[Rican]";
+ mes "Then would you put it in the machine in front of me?";
+ close;
+ } else if (ma_tomas == 11) {
+ if (checkweight(1201,1) == 0) {
+ mes " - Notice !! -";
+ mes " - Since you have too many items - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes " - Notice !! -";
+ mes " - Since your items are too heavy - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ mes "[Rican]";
+ mes "Hoo hoo~ I feel at ease thanks to your help.";
+ mes "I had doubted if it was too much suddenly, but it turned out just right!";
+ next;
+ mes "[Rican]";
+ mes "By the way, no news from my son yet, as he said he went to a meeting.";
+ mes "I hope he's not bothering Dr. Mali again...";
+ next;
+ mes "[Rican]";
+ mes "He seems to have visited Dr. Mali more often since my legs got injured.";
+ mes "The study will get longer if he does so...";
+ next;
+ mes "[Rican]";
+ mes "If you see my son, please tell him to get back soon~";
+ mes "And this is for you to buy something delicious with, since you did hard work.";
+ set ma_tomas,12;
+ getitem 6422,20; //Egrade_Coin
+ changequest 11219,11220;
+ setquest 11239;
+ close;
+ } else if (ma_tomas == 12) {
+ mes "[Rican]";
+ mes "He seems to have visited Dr. Mali more often since my legs got injured.";
+ mes "The study will get longer if he does so...";
+ mes "If you see my son, please tell him to get back soon~";
+ close;
+ } else if (ma_tomas > 99) {
+ if (checkquest(11238,PLAYTIME) == 0 || checkquest(11238,PLAYTIME) == 1) {
+ if (countitem(6435) < 30) {
+ mes "[Rican]";
+ mes "You need exactly 30 to get a set!";
+ close;
+ }
+ mes "[Rican]";
+ mes "Very reliable!";
+ mes "Don't you want to do your business with Yggdrasil Berry?";
+ delitem 6435,30; //Fresh_Fruit
+ erasequest 11238;
+ setquest 11239;
+ getitem 6422,5; //Egrade_Coin
+ close;
+ } else if (checkquest(11239,PLAYTIME) == 0 || checkquest(11239,PLAYTIME) == 1) {
+ mes "[Rican]";
+ mes "Would you like to take a rest for a while?";
+ mes "It hasn't been a day yet since you last worked~";
+ close;
+ } else {
+ if (checkquest(11239,PLAYTIME) == 2)
+ erasequest 11239;
+ mes "[Rican]";
+ mes "Hehe~";
+ mes "You came here to help me again?";
+ mes "You're so faithful!";
+ next;
+ switch(select("I'll help.:I won't.")) {
+ case 1:
+ mes "[Rican]";
+ mes "It's the same task to do as before.";
+ mes "30 Yggdrasil Berry. You can easily find it in Malangdo!!";
+ mes "Ah! Keep the secret to my son for sure~";
+ mes "Then please^ff99cc!!!^000000 please^ff99cc!!!^000000 please~~~";
+ emotion e_kis;
+ setquest 11238;
+ close;
+ case 2:
+ mes "[Rican]";
+ mes "Yeah? Then play around here, since you are visiting~";
+ close;
+ }
+ }
+ }
+ mes "[Rican]";
+ mes "Woo waa hoohoo...";
+ mes "Woowaa ahhh ahh ahh...";
+ mes "I'm impatient... to stay home like this!!";
+ next;
+ mes "[Rican]";
+ mes "All I can do is press the button all day long~";
+ mes "This is not exciting at all~";
+ mes "I'm not willing to do anything more and more~ Doobie dooba~";
+ close;
+}
+
+mal_in01,116,168,0 script Dry Machine#mal 563,{
+ if (ma_tomas == 10) {
+ if (countitem(6435) < 30) {
+ mes "[Rican]";
+ mes "You need exactly 30 to get a set!";
+ close;
+ }
+ switch(select("Put the fruits in.:Don't.")) {
+ case 1:
+ mes "[Rican]";
+ mes "I'll press the button by myself!!!";
+ emotion e_omg,0,"Rican#mal";
+ next;
+ mes "- The machine starts operating -";
+ mes "- when he presses the button. -";
+ delitem 6435,30; //Fresh_Fruit
+ set ma_tomas,11;
+ changequest 11218,11219;
+ close;
+ case 2:
+ mes "[Rican]";
+ mes "Ah... you won't put it in?";
+ close;
+ }
+ }
+ mes "- Drrrk Drrrk -";
+ close;
+}
+
+- script Suspicious Sand Pile#0 -1,{
+ if (.off) end; // Official script uses a 1-second timer to disable sand piles. Added to prevent abuse.
+ if (checkweight(1201,1) == 0) {
+ mes " - Notice !! -";
+ mes " - Since you have too many items - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes " - Notice !! -";
+ mes " - Since your items are too heavy - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ if (ma_tomas == 9 || checkquest(11238) > -1) {
+ if (rand(1,5) == 4) {
+ mes "- As I put my hand in the sand -";
+ mes "- a fresh smell comes out. -";
+ getitem 6435,1; //Fresh_Fruit
+ } else {
+ mes "- As I put my hand in the sand -";
+ mes "- I feel like I'm touching -";
+ mes "- something bad. -";
+ mes "- Ah, ah! Feels bad... -";
+ emotion e_omg,1;
+ }
+ set .off,1;
+ donpcevent "Water Sand"+strnpcinfo(2)+"#mal::OnEnable";
+ close;
+ }
+ mes "- Seeems suspicious. -";
+ mes "- But it's just sand... -";
+ close;
+OnEnable:
+ enablenpc strnpcinfo(0);
+ end;
+OnDisable:
+ set .off,0;
+ disablenpc strnpcinfo(0);
+ end;
+}
+malangdo,221,139,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#1 557
+malangdo,208,174,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#2 557
+malangdo,191,223,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#3 557
+malangdo,150,195,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#4 557
+malangdo,116,196,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#5 557
+malangdo,178,145,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#6 557
+malangdo,142,120,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#7 557
+malangdo,136,122,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#8 557
+malangdo,152,143,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#9 557
+malangdo,242,175,0 duplicate(Suspicious Sand Pile#0) Suspicious Sand Pile#10 557
+
+- script Water Sand0#mal -1,{
+OnInit:
+ disablenpc strnpcinfo(0);
+ end;
+OnEnable:
+ enablenpc strnpcinfo(0);
+ initnpctimer;
+ end;
+OnDisable:
+ stopnpctimer;
+ disablenpc strnpcinfo(0);
+ end;
+OnTimer1000:
+ donpcevent "Suspicious Sand Pile#"+substr(strnpcinfo(1),10,getstrlen(strnpcinfo(1))-1)+"::OnDisable";
+ end;
+OnTimer30000:
+ donpcevent "Suspicious Sand Pile#"+substr(strnpcinfo(1),10,getstrlen(strnpcinfo(1))-1)+"::OnEnable";
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+}
+- duplicate(Water Sand0#mal) Water Sand1#mal -1
+- duplicate(Water Sand0#mal) Water Sand2#mal -1
+- duplicate(Water Sand0#mal) Water Sand3#mal -1
+- duplicate(Water Sand0#mal) Water Sand4#mal -1
+- duplicate(Water Sand0#mal) Water Sand5#mal -1
+- duplicate(Water Sand0#mal) Water Sand6#mal -1
+- duplicate(Water Sand0#mal) Water Sand7#mal -1
+- duplicate(Water Sand0#mal) Water Sand8#mal -1
+- duplicate(Water Sand0#mal) Water Sand9#mal -1
+- duplicate(Water Sand0#mal) Water Sand10#mal -1
+
+mal_dun01,136,120,6 script Linguist Devore#mald 549,{
+ end;
+OnInit:
+ disablenpc "Linguist Devore#mald";
+ end;
+OnEnable:
+ enablenpc "Linguist Devore#mald";
+ initnpctimer;
+ end;
+OnDisable:
+ stopnpctimer;
+ disablenpc "Linguist Devore#mald";
+ end;
+OnTimer100000:
+ donpcevent "Linguist Devore#mald::OnDisable";
+ end;
+}
+
+mal_dun01,136,122,3 script Biscuit#mal 551,{
+ if (ma_tomas < 20) {
+ mes "- There's something strange. -";
+ mes "- It feels like somehow - ";
+ mes "- you shouldn't make eye contact. -";
+ close;
+ } else if (ma_tomas == 20) {
+ mes "[Biscuit]";
+ mes "Star Candy sacrifices herself like this, but those fellows are setting the pillars around her for themselves only.";
+ mes "Hewww!!!";
+ emotion e_ag;
+ next;
+ mes "[Biscuit]";
+ mes "They talk to her, but ignore me when I talk to her.";
+ mes "I don't like them at all!!!";
+ emotion e_ag;
+ next;
+ mes "- Unlike the words of Dr. Devore, Biscuit appears fluent in speaking. -";
+ next;
+ mes "- I think it's better to let Dr. Devore know this soon. -";
+ close;
+ } else if (ma_tomas == 21) {
+ mes "[Biscuit]";
+ mes "Umm?";
+ mes "What's this?";
+ mes "Do you have anything to tell me?";
+ next;
+ mes "[Biscuit]";
+ mes "Well, that fellow is often the one ignoring my words.";
+ mes "He wavers with words to say and makes me uncomfortable.";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Did you hear? Dr. Devore?";
+ donpcevent "Linguist Devore#mald::OnEnable";
+ next;
+ mes "[Linguist Devore]";
+ mes "Ummm? What do you mean?";
+ mes "I cannot hear anything.";
+ emotion e_what,0,"Linguist Devore#mald";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Huh? Biscuit said 'Well, that fellow is often the one ignoring my words. He wavers with words to say and makes me uncomfortable.'?";
+ next;
+ mes "[Linguist Devore]";
+ mes "What? What are you taling about?";
+ mes "I cannot hear anything.";
+ emotion e_what,0,"Linguist Devore#mald";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Huh?";
+ emotion e_what,1;
+ next;
+ mes "[Linguist Devore]";
+ mes "Ah?!";
+ mes "Ah?!?!?!?!?!?";
+ mes "Ah!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+ emotion e_omg,0,"Linguist Devore#mald";
+ next;
+ mes "[Linguist Devore]";
+ mes "If... if that's the cause!";
+ mes "We may have totally misunderstood!";
+ emotion e_omg,0,"Linguist Devore#mald";
+ next;
+ mes "[Linguist Devore]";
+ mes "Oh my, we couldn't have known, since we live here only with ourselves.";
+ next;
+ mes "[Linguist Devore]";
+ mes "Each living thing has its own area for audibility and vocalization. But we and Biscuit were in slightly different areas!";
+ emotion e_omg,0,"Linguist Devore#mald";
+ next;
+ mes "[Linguist Devore]";
+ mes "In such conditions, we cannot hear any language properly!";
+ mes "This was a matter of sound rather than language...";
+ next;
+ mes "[Linguist Devore]";
+ mes "Hu~hu... Despite of many years of study, we couldn't discover this reason...";
+ next;
+ mes "[Linguist Devore]";
+ mes "It's not the time to do this!";
+ mes "I should change the way of studying right now.";
+ next;
+ mes "[Linguist Devore]";
+ mes "I'll get back to the meeting and report this.";
+ mes "Then please take care of the next things!";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Wait, Dr. Devore, what on earth is next...?";
+ mes "What should I do...?";
+ emotion e_dots,1;
+ next;
+ mes "[Linguist Devore]";
+ mes "Hahaha~ You are the kind who can have conversations with Biscuit. Please try to talk with him.";
+ mes "It'll be helpful for my study, no matter what you talk about with him.";
+ next;
+ mes "[Biscuit]";
+ mes "Hey... Don't look down on me!";
+ emotion e_ag;
+ donpcevent "Linguist Devore#mald::OnDisable";
+ set ma_tomas,22;
+ completequest 11228;
+ setquest 11229;
+ close;
+ } else if (ma_tomas == 22 || ma_tomas == 23 || ma_tomas == 24) {
+ mes "[Biscuit]";
+ mes "...What are you looking at...";
+ next;
+ while(1) {
+ switch(select("Ask about Star Candy.:Ask about Biscuit.:Ask about Malangdo.")) {
+ case 1:
+ mes "[Biscuit]";
+ mes "Star Candy?";
+ mes "Tsk tsk!";
+ mes "It's no go, the lowly fellows.";
+ emotion e_ag;
+ next;
+ mes "[Biscuit]";
+ mes "You shouldn've recognized the previous and mysterious feeling from Star Candy!";
+ mes "She's the one who's really gorgeous.";
+ next;
+ mes "[Biscuit]";
+ mes "How gorgeous she is that... umm...";
+ mes "Just gorgeous.";
+ mes "She is so gorgeous... but I don't know how to explaing it...";
+ emotion e_swt2;
+ next;
+ mes "[Biscuit]";
+ mes "Khummm...";
+ mes "That's why the kinds speaking with sound are irritating.";
+ emotion e_ag;
+ next;
+ select("Speaking with sound?");
+ mes "[Biscuit]";
+ mes "The kind who got highly evolved like us talk using our minds, not sound.";
+ mes "As you think in your mind, it goes to the others right away, something like this?";
+ next;
+ mes "[Biscuit]";
+ mes "In other places, it used to be called ultrasonic waves, or telepathy.";
+ next;
+ mes "[Biscuit]";
+ mes "So we haven't needed any more explanation or flowery words...";
+ mes "Woo, it's bothering me so much!";
+ if (ma_tomas == 22)
+ set ma_tomas,23;
+ if (ma_tomas == 25)
+ close;
+ next;
+ case 2:
+ mes "[Biscuit]";
+ mes "Me?";
+ mes "I'm an assistant to Star Candy, a new star in the Starfish race with multi-faceted talents!";
+ emotion e_flash;
+ next;
+ mes "[Biscuit]";
+ mes "Ah, ah...";
+ mes "When I was her assistant at first, I used to be called a genius, handsome assistant, and so on...";
+ mes "I felt like a shining road of light had come up to me...";
+ next;
+ mes "[Biscuit]";
+ mes "But if the elderly see this, they'll dry me out in the sun...";
+ mes "It was a life like a flame... Sob sob sob sob";
+ emotion e_sob;
+ if (ma_tomas == 23)
+ set ma_tomas,24;
+ if (ma_tomas == 25)
+ close;
+ next;
+ case 3:
+ mes "[Biscuit]";
+ mes "This island is where the gorgeous Star Candy can take a rest.";
+ mes "The surface is soft and with the high moisture inside, it's the best place for Starfishes.";
+ next;
+ mes "[Biscuit]";
+ mes "Now, those cats already occupied it as they wanted.";
+ mes "It's a problem because Star Candy is too kind...";
+ if (ma_tomas == 24) {
+ set ma_tomas,25;
+ changequest 11229,11230;
+ }
+ if (ma_tomas == 25)
+ close;
+ next;
+ }
+ }
+ } else if (ma_tomas == 25) {
+ mes "[Biscuit]";
+ mes "Hey, you haven't gone back?";
+ mes "Get some jellies for Star Candy to eat if you have time.";
+ next;
+ switch(select("Okay.:Why me?")) {
+ case 1:
+ mes "[Biscuit]";
+ mes "You can get the jellies around here.";
+ mes "It's not that difficult, and you should come back before Star Candy's meal time!";
+ mes "About 30 jellies would be okay for a meal.";
+ set ma_tomas,26;
+ changequest 11230,11231;
+ close;
+ case 2:
+ mes "[Biscuit]";
+ mes "Why you?";
+ mes "I'm busy enough to assist her and the cat fellows who can't hear my voice, that's why I should ask you.";
+ next;
+ mes "[Biscuit]";
+ mes "How rude...";
+ emotion e_ag;
+ next;
+ mes "[Biscuit]";
+ mes "You're not my subordinate, so I can't order you by force. But if Star Candy can't have her meal on time, you have to remember that this island will collapse completely.";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "...It's not a request, but a threat...";
+ emotion e_dots,1;
+ close;
+ }
+ } else if (ma_tomas == 26) {
+ // Dialogue in repeatable quest is identical.
+ // Uses a variable to determine the quest mode.
+ set @mal_bob_q,1;
+ L_Quest:
+ set .@i, @mal_bob_q;
+ set @mal_bob_q,0;
+ if (countitem(12624) < 30) {
+ mes "[Biscuit]";
+ mes "It's not enough at all~";
+ mes "I need at least 30 Delicious Jelly.";
+ close;
+ }
+ mes "[Biscuit]";
+ mes "You got them well.";
+ mes "There won't be any problem to prepare her meal.";
+ delitem 12624,30; //Delicious_Jelly
+ if (.@i == 1) {
+ set ma_tomas,27;
+ changequest 11231,11232;
+ } else {
+ erasequest 11244;
+ setquest 11245;
+ getitem 6422,5; //Egrade_Coin
+ }
+ next;
+ mes "[Biscuit]";
+ mes "Though the jelly looks strange, it tastes good...";
+ mes "Star Candy seems to like it a lot as well.";
+ next;
+ mes "[Biscuit]";
+ mes "Have your meal, Star Candy~";
+ mes "Uhhh, why don't you eat it?";
+ mes "You have no appetite?";
+ close;
+ } else if (ma_tomas == 27) {
+ mes "[Biscuit]";
+ mes "Hooo.. it's natural that you have no appetite...";
+ next;
+ mes "[Biscuit]";
+ mes "How come precious Star Candy supports the ground in the basement like this, and it's so dry, though it's in a subterranean cave of an island!";
+ next;
+ mes "[Biscuit]";
+ mes "Moreover, the slithery thing is bothering Star Candy.";
+ mes "You cannot avoid the stress.";
+ next;
+ select("Slithery thing?");
+ mes "[Biscuit]";
+ mes "Hmm? What is such a thing like that.";
+ mes "The slithery thing.";
+ mes "With its ugly looks, it bothers Star Candy continuously.";
+ next;
+ mes "[Biscuit]";
+ mes "It tries to come up to the island especially when it's storming like today. I hid here a while. Those cats came and made her bad like this.";
+ next;
+ mes "[Biscuit]";
+ mes "Thanks to Star Candy, her skin is...";
+ mes "......";
+ next;
+ mes "[Biscuit]";
+ mes "Woooaaappp!";
+ mes "What's this!!!";
+ mes "Her skin is!!!!";
+ mes "She got an abscess on her skin that used to shine like a jewel!!!!";
+ emotion e_omg;
+ next;
+ mes "[Biscuit]";
+ mes "She got in trouble with her dried skin, since she's here!";
+ mes "For our Starfishes, the lack of water means horrible things that lead to death!";
+ next;
+ mes "[Biscuit]";
+ mes "Ah, ah! She's so kind that she sacrifices herself to save such things. Sob sob.";
+ emotion e_sob;
+ next;
+ mes "[Biscuit]";
+ mes "Ah, ah...";
+ mes "I can't leave to take care of her, isn't there anybody to help~";
+ next;
+ mes "[Biscuit]";
+ mes "Isn't there anybody to helpppppp~";
+ next;
+ mes "[Biscuit]";
+ mes "Hey, you there...";
+ mes "Even as I ask like this, will you just ignore me and stand there?";
+ next;
+ select("I'll help.:It's unavoidable, so I'll help.:I'll admit this is my destiny, so I'll and help.:I'll do anything I can for Star Candy.");
+ mes "[Biscuit]";
+ mes "Good attitude!";
+ mes "Hoo hoo~";
+ next;
+ mes "[Biscuit]";
+ mes "Then please find the brush to wash her and get a basket to move water here.";
+ mes "Maybe they're stacked in the storage.";
+ set ma_tomas,28;
+ changequest 11232,11233;
+ close;
+ } else if (ma_tomas == 28) {
+ if (countitem(6433) && countitem(6432)) {
+ mes "[Biscuit]";
+ mes "Oh!";
+ mes "You brought the tools successfully.";
+ mes "Now you can wash the dry skin in the counter-clockwise direction!";
+ mes "Right, then from her left leg...!";
+ set ma_tomas,29;
+ changequest 11233,11234;
+ close;
+ } else if (countitem(6433) && countitem(6431)) {
+ mes "[Biscuit]";
+ mes "Oh!";
+ mes "You brought the tools successfully.";
+ mes "Now you can fetch sea water from outside.";
+ next;
+ mes "[Biscuit]";
+ mes "There's a spot I remember as first rate, in the east of Malangdo.";
+ mes "It's not right to wash her with the water collected in this cave!";
+ next;
+ mes "[Biscuit]";
+ mes "Be careful not to spill the water, as it's heavy to carry.";
+ close;
+ } else {
+ mes "[Biscuit]";
+ mes "Ummm... It will be hard if you don't have the proper tools...";
+ mes "Though it doesn't matter for someone small like me.";
+ next;
+ mes "[Biscuit]";
+ mes "For such enormous skin as Star Candy's, it's full of barnacles, oysters, and mussels!!!";
+ emotion e_omg;
+ close;
+ }
+ } else if (ma_tomas < 33) {
+ mes "[Biscuit]";
+ mes "Oh!";
+ mes "You brought the tools successfully.";
+ mes "Now you can wash the dry skin in the counter-clockwise direction!";
+ mes "Right, then from her left leg...!";
+ close;
+ } else if (ma_tomas == 33) {
+ if (checkweight(1201,1) == 0) {
+ mes " - Notice !! -";
+ mes " - Since you have too many items - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes " - Notice !! -";
+ mes " - Since your items are too heavy - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ mes "[Biscuit]";
+ mes "Well done!";
+ mes "Now I see that her beautiful face has recovered.";
+ emotion e_awsm;
+ next;
+ mes "[Biscuit]";
+ mes "The skin will go bad if you don't clean it every day.";
+ mes "There's a saying... cleansing your skin is much more important than using makeup.";
+ emotion e_no1;
+ next;
+ mes "[Biscuit]";
+ mes "You did a good job.";
+ mes "You helped me even though I asked suddenly like this...";
+ mes "To be honest, I thought you'd just leave.";
+ next;
+ mes "[Biscuit]";
+ mes "It's a kind of reward. Say my words to Dr. Dvor... or Devore, whatever the cat's name is.";
+ next;
+ mes "[Biscuit]";
+ mes "There's no need to wait until the study finishes. We can talk through you, and it's better to talk about the current situation...";
+ next;
+ mes "[Biscuit]";
+ mes "This is not for you... and all of you, either. It's rather for Star Candy to get rest as soon as possible, you know!";
+ emotion e_pif;
+ set ma_tomas,34;
+ erasequest 11235;
+ setquest 11236;
+ getitem 6422,100; //Egrade_Coin
+ getitem 12636,20; //Malang_Sp_Can
+ close;
+ } else if (ma_tomas > 99) {
+ if (checkquest(11244) > -1) {
+ set @mal_bob_q,2;
+ goto L_Quest;
+ } else if (checkquest(11245,PLAYTIME) == 0 || checkquest(11245,PLAYTIME) == 1) {
+ mes "[Biscuit]";
+ mes "I'll call you when I need you, so don't worry!";
+ close;
+ } else {
+ if (checkquest(11245,PLAYTIME) == 2)
+ erasequest 11245;
+ mes "[Biscuit]";
+ mes "It's the time for Star Candy to have a meal.";
+ mes "Get some jellies.";
+ next;
+ switch(select("I'll help.:I'll stop.")) {
+ case 1:
+ mes "[Biscuit]";
+ mes "You can get the jellies around here.";
+ mes "It's not that difficult, and you should come back before Star Candy's meal time!";
+ mes "About 30 jellies would be ok for a meal.";
+ setquest 11244;
+ close;
+ case 2:
+ mes "[Biscuit]";
+ mes "What, are you talking about you let our Star Candy feel hungry?!";
+ close;
+ }
+ }
+ }
+ mes "[Biscuit]";
+ mes "Star Candy is really good.";
+ mes "She never loses her smile, even though it's so hard to stand...";
+ close;
+}
+
+mal_in02,102,94,3 script Cleaning Staff#mal 544,2,2,{
+OnTouch:
+ if (checkweight(1201,1) == 0) {
+ mes " - Notice !! -";
+ mes " - Since you have too many items - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes " - Notice !! -";
+ mes " - Since your items are too heavy - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ mes "[Cleaning Staff]";
+ mes "All yours. There are various cleaning tools here.";
+ next;
+ switch(select("Bucket:Cleaning Brush:Stop.")) {
+ case 1:
+ mes "[Cleaning Staff]";
+ mes "You mean the Bucket!";
+ mes "Here we go~";
+ next;
+ mes "[Cleaning Staff]";
+ mes "Please give the cleaning tool back to any merchant.";
+ mes "Thanks for coming~";
+ getitem 6431,1; //Bucket
+ close;
+ case 2:
+ mes "[Cleaning Staff]";
+ mes "You mean the Cleaning Brush!";
+ mes "Here we go~";
+ next;
+ mes "[Cleaning Staff]";
+ mes "Please give the cleaning tool back to any merchant.";
+ mes "Thanks for coming~";
+ getitem 6433,1; //Clean_Brush
+ close;
+ case 3:
+ mes "[Cleaning Staff]";
+ mes "Thanks for coming~";
+ close;
+ }
+ close;
+}
+
+malangdo,246,184,0 script 1st Rate Point 111,{
+ if (checkweight(1201,1) == 0) {
+ mes " - Notice !! -";
+ mes " - Since you have too many items - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes " - Notice !! -";
+ mes " - Since your items are too heavy - ";
+ mes " - you cannot get the item. - ";
+ mes " - Let your body lighten - ";
+ mes " - and try this again. - ";
+ close;
+ }
+ if (countitem(6431) == 0) {
+ mes "- To get water -";
+ mes "- you need a ^0000FFBucket^000000. -";
+ close;
+ }
+ mes "- The water seems so pure. -";
+ next;
+ switch(select("Get water.:Stop.")) {
+ case 1:
+ mes "- The bucket gets remarkably -";
+ mes "- heavy as water fills it up. -";
+ specialeffect EF_POTION8;
+ delitem 6431,1; //Bucket
+ getitem 6432,1; //Full_Bucket
+ close;
+ case 2:
+ mes "- Didn't get water. -";
+ close;
+ }
+}
+
+mal_dun01,133,125,5 script Star Candy#mal 552,{
+ if (ma_tomas == 19) {
+ mes "[Star Candy]";
+ mes "....";
+ mes ".....";
+ mes "......";
+ next;
+ mes "[Biscuit]";
+ mes "Rude! How come you talk to precious Star Candy!";
+ next;
+ mes "[Biscuit]";
+ mes "You look different from the fellows that usually comes...";
+ mes "You also look strange, though.";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "?!";
+ mes "You can talk!";
+ emotion e_omg,1;
+ next;
+ mes "[Biscuit]";
+ mes "What?";
+ mes "You've never seen me talking?";
+ mes "What's the matter with you?";
+ next;
+ mes "[Biscuit]";
+ mes "Since I can talk with you, you seem better than those other foolish ones.";
+ mes "Though I learned to speak in their language, they don't understand.";
+ next;
+ mes "[Biscuit]";
+ mes "Our precious Star Candy humbly supports them, and they treat her like this.";
+ mes "They don't know how to express thanks!";
+ emotion e_ag,0,"Biscuit#mal";
+ next;
+ select("Support?");
+ mes "[Biscuit]";
+ mes "Anyway!";
+ mes "It's no use to treat them well.";
+ mes "They don't know how hard Star Candy is trying.";
+ next;
+ mes "[Biscuit]";
+ mes "This island used to be hers, but for the short time while she avoided storms and got here, those cats were suddenly dropped on the island.";
+ next;
+ mes "[Biscuit]";
+ mes "Since the ground here is so soft, Star Candy was stuck in between, and the situation is now like this.";
+ next;
+ mes "[Biscuit]";
+ mes "Actually, she can get out regardless of those bad things, but she supports the ground worrying that someone will get hurt.";
+ next;
+ mes "[Biscuit]";
+ mes "Ah, ah...";
+ mes "What a beatiful mind...";
+ next;
+ mes "[Biscuit]";
+ mes "Once she moved a bit when she felt uncomfortable, and saw them in panic. She hasn't moved at all since then. I'm worried if she's not well.";
+ next;
+ mes "[Biscuit]";
+ mes "Star Candy sacrifices herself like this, but those fellows are setting the pillars around her for themselves only.";
+ mes "Hewww!!!";
+ emotion e_ag,0,"Biscuit#mal";
+ next;
+ mes "[Biscuit]";
+ mes "They talk to her, but ignore me when I talk to her.";
+ mes "I don't like them at all!!!";
+ next;
+ mes "- Unlike the words of Dr. Devore, Biscuit appears fluent in speaking. -";
+ next;
+ mes "- I think it's better to let Dr. Devore know this soon. -";
+ set ma_tomas,20;
+ changequest 11226,11227;
+ close;
+ }
+ mes "[Star Candy]";
+ mes "....";
+ mes ".....";
+ mes "......";
+ close;
+}
+
+- script #skin_mal -1,{
+ set .@index, atoi(strnpcinfo(2));
+ switch(.@index) {
+ case 29: set .@str$,"dry"; break;
+ case 30: set .@str$,"prickly"; break;
+ case 31: set .@str$,"chapped"; break;
+ case 32: set .@str$,"hard"; break;
+ default:
+ mes "An error has occurred.";
+ close;
+ }
+ if (ma_tomas != .@index) {
+ mes "- I feel sorry for the skin -";
+ mes "- to be so "+.@str$+". -";
+ close;
+ }
+ if (!countitem(6433) || !countitem(6432)) {
+ mes "- You need -";
+ mes "- a cleaning brush -";
+ mes "- and a full bucket. -";
+ close;
+ }
+ mes "- Poured water on the "+.@str$+" skin. -";
+ delitem 6432,1; //Full_Bucket
+ getitem 6431,1; //Bucket
+ next;
+ if (rand(1,2) == 1)
+ set .@menu$,"Brush.:Stop.:";
+ else
+ set .@menu$,":Stop.:Brush.";
+ switch(select(.@menu$)) {
+ case 1:
+ case 3:
+ mes "- Poured water on -";
+ mes "- the "+.@str$+" skin -";
+ mes "- and brushed it hard. -";
+ specialeffect EF_BUBBLE;
+ if (rand(1,3) > 1)
+ close;
+ next;
+ mes "- The "+.@str$+" skin turned -";
+ mes "- soft and moisturized. -";
+ switch(rand(1,50)) {
+ case 7:
+ next;
+ mes "[Star Candy]";
+ mes "Hoo hoo hoot~";
+ mes "That tickles.";
+ break;
+ case 21:
+ next;
+ mes "[Star Candy]";
+ mes "You're a really good human being.";
+ break;
+ case 29:
+ next;
+ mes "[Star Candy]";
+ mes "Since I couldn't move, it was the most difficult thing to stand.";
+ break;
+ case 30:
+ next;
+ mes "[Star Candy]";
+ mes "Ah~ Feels good~";
+ mes "I felt itchy for so long.";
+ break;
+ case 49:
+ next;
+ mes "[Star Candy]";
+ mes "Thanks so much.";
+ break;
+ default:
+ set ma_tomas, ma_tomas+1;
+ if (.@index == 32)
+ changequest 11234,11235;
+ close;
+ }
+ cutin "ma_starcandy",2;
+ set ma_tomas, ma_tomas+1;
+ if (.@index == 32)
+ changequest 11234,11235;
+ close2;
+ cutin "",255;
+ end;
+ case 2:
+ mes "- All the water -";
+ mes "- sank into the ground. -";
+ close;
+ }
+}
+mal_dun01,143,137,0 duplicate(#skin_mal) Dry Skin#29 111
+mal_dun01,131,150,0 duplicate(#skin_mal) Prickly Skin#30 111
+mal_dun01,116,144,0 duplicate(#skin_mal) Chapped Skin#31 111
+mal_dun01,120,129,0 duplicate(#skin_mal) Hard Skin#32 111
+
+malangdo,190,167,7 script Portali#mal 546,{
+ if (ma_tomas < 100) {
+ mes "[Portali]";
+ mes "I have no business for a immature fellow!";
+ close;
+ }
+ mes "[Portali]";
+ mes "Hmmm...";
+ mes "You smell like cats even though you're a human being...";
+ next;
+ mes "[Portali]";
+ mes "But... Would you like to go back to my hometown?";
+ mes "I'll let you go to the land of Midgard with the new skill I found!";
+ mes "It's not free. I'll need canned food!";
+ next;
+ switch(select("Go.:Don't go.:Prices?")) {
+ case 1:
+ if (countitem(12636) < 4) {
+ mes "[Portali]";
+ mes "Where are you going without canned food...?";
+ close;
+ }
+ switch(select("Rune-Midgarts:Schwaltzvalt Republic:Arunafeltz Kingdom")) {
+ case 1:
+ switch(select("Prontera:Morroc:Alberta:Al De Baran:Payon:Geffen")) {
+ case 1: callsub L_Warp,"Prontera",4,"prontera",155,111;
+ case 2: callsub L_Warp,"Morroc",4,"morocc",159,255;
+ case 3: callsub L_Warp,"Alberta",4,"alberta",95,66;
+ case 4: callsub L_Warp,"Al De Baran",4,"aldebaran",126,120;
+ case 5: callsub L_Warp,"Payon",4,"payon",198,135;
+ case 6: callsub L_Warp,"Geffen",4,"geffen",120,100;
+ }
+ case 2:
+ switch(select("Einbroch:Lighthalzen:Yuno:Hugel")) {
+ case 1: callsub L_Warp,"Einbroch",6,"einbroch",229,196;
+ case 2: callsub L_Warp,"Lighthalzen",6,"lighthalzen",214,150;
+ case 3: callsub L_Warp,"Yuno",6,"yuno",157,220;
+ case 4: callsub L_Warp,"Hugel",6,"hugel",95,121;
+ }
+ case 3:
+ switch(select("Rachel:Veins")) {
+ case 1: callsub L_Warp,"Rachel",5,"rachel",138,113;
+ case 2: callsub L_Warp,"Veins",5,"veins",212,144;
+ }
+ }
+ case 2:
+ mes "[Portali]";
+ mes "Okay...";
+ close;
+ case 3:
+ mes "[Portali]";
+ mes "3 for Rune-Midgarts!";
+ mes "6 for Schwaltzvalt, 5 for Arunafeltz.";
+ mes "Schwaltzvalt is the nation of prohibited magic, and Arunafeltz seems to have a curse!";
+ close;
+ }
+ end;
+L_Warp:
+ if (countitem(12636) < getarg(1)) {
+ mes "[Portali]";
+ mes "Where are you going without canned food...?";
+ close;
+ }
+ mes "[Portali]";
+ mes "Then to "+getarg(0)+"~";
+ delitem 12636,getarg(1); //Malang_Sp_Can
+ close2;
+ warp getarg(2),getarg(3),getarg(4);
+ end;
+}
+
+// Malangdo Island :: mal_ppl
+//============================================================
+malangdo,137,200,6 script Pipielle 549,{
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 1000) {
+ mes "You have too many items, please try again after reducing your weight.";
+ close;
+ }
+ if (BaseLevel < 60) {
+ mes "[Pipielle]";
+ mes "Wow, this is nice weather. Do you like this kind of weather, too? But I need to do my work now.";
+ next;
+ mes "[Pipielle]";
+ mes "I would ask for your help, if you were a stronger advanturer...";
+ next;
+ mes "^770099This cat is working on something, but she asks for help above LV60.^000000";
+ close;
+ }
+ set .@fish_ss1$, "What are you doing??";
+ if (countitem(6451) > 29)
+ set .@fish_ss2$, "I caught a lot of strange fishes!";
+ else
+ set .@fish_ss2$, "Remaining " + (30-countitem(6451)) + " of ^bbbbbbUnidentified Fish are required.^000000";
+ if (ma_tomas == 100)
+ set .@fish_ss3$, "I met an Admiral Tomas...";
+ mes "[Pipielle]";
+ mes "Would you come here and open your bag for me?";
+ next;
+ switch(select(.@fish_ss1$,.@fish_ss2$,.@fish_ss3$)) {
+ case 1:
+ mes "[Pipielle]";
+ mes "There are many beautiful fishes around here. So I feel my heart beating as I stand here.";
+ next;
+ select("Of course, after seeing such a delicious thing!");
+ mes "[Pipielle]";
+ mes "How come you only know about eating?! My heart doesn't beat up because I see something delicious. Don't treat me the same as the others.";
+ next;
+ mes "[Pipielle]";
+ mes "I used to study from a scholar from Uno who was human. And I am good at the human language as well. Don't treat me like the others.";
+ next;
+ mes "[Pipielle]";
+ mes "I am a scholar who researches fish here. It's a little funny that a cat researches fish, but it's true.";
+ next;
+ select("Were you originally a scholar?");
+ mes "[Pipielle]";
+ mes "Originally I used to be the mate of admiral Tomas. But our ship never went back to sea after we arrived here.";
+ next;
+ mes "[Pipielle]";
+ mes "The mate of a ship that never voyages is lonely.";
+ next;
+ mes "[Pipielle]";
+ mes "The scholar from Uno came here for research, and he thought it was amazing that cats spoke the human language. Therefore he started to teach me.";
+ next;
+ select("But now everyone speaks the human language.");
+ mes "[Pipielle]";
+ mes "Oh yes, there were only a few cats who spoke the human language. That's why he treated me special.";
+ next;
+ mes "[Pipielle]";
+ mes "Anyway, now I collect specimens to be an ichthyologist. I hope you can help me.";
+ next;
+ if(select("How can I help you?:I would say no.") == 2) {
+ mes "[Pipielle]";
+ mes "Oh, okay. If you change your mind, please come again.";
+ close;
+ }
+ mes "[Pipielle]";
+ mes "There is a Pouring who's eating all the fishes in the Octopus and Culvert dungeons.";
+ next;
+ mes "[Pipielle]";
+ mes "It didn't use to live there, but might have come here for the winter. Could you collect the specimens of unidentified fish after geting rid of it?";
+ next;
+ mes "[Pipielle]";
+ mes "You can get identified fishes from Pouring, so please collect about 30 pieces.";
+ close;
+ case 2:
+ if (countitem(6451) > 29) {
+ //saveppl Unknown_Fish
+ delitem 6451,30; //Unknown_Fish
+ mes "[Pipielle]";
+ mes "Oh, thank you! I will take these specimens.";
+ next;
+ mes "[Pipielle]";
+ mes "I want to give you something, but the last one is out of stock now so I will just write your name here.";
+ next;
+ mes "[Pipielle]";
+ mes "I can give you good news even from a distance, but it's only possible if I am really lucky...";
+ close;
+ }
+ mes "[Pipielle]";
+ mes "I'm sorry, but please collect 30 pieces of unidentified fish specimens.";
+ close;
+ case 3:
+ mes "[Pipielle]";
+ mes "Oh, you met admiral Tomas... how was it?";
+ next;
+ if(select("He looks gentle:He looks terrible") == 2) {
+ mes "[Pipielle]";
+ mes "Hmm...";
+ mes "Frankly speaking, I was a real fan of Admiral Tomas. Can you take responsibility for your word?";
+ next;
+ if(select("Just kidding!:Oh yes, he was really terrible!") == 2) {
+ mes "[Pipielle]";
+ mes "Is he?";
+ mes "Okay, it really depends on personal taste...";
+ close;
+ }
+ }
+ mes "[Pipielle]";
+ mes "Is he?";
+ mes "I knew you would say so.";
+ next;
+ mes "[Pipielle]";
+ mes "Admiral Tomas is a legendary figure who has led all of us in voyaging to this island. I think it was the happiest moment in my life.";
+ next;
+ mes "[Pipielle]";
+ mes "Please help him a lot. There are not many people to trust. This is my personal request.";
+ next;
+ mes "[Pipielle]";
+ mes "And this is a small gift for looking after admiral Tomas.";
+ set ma_tomas,101;
+ getitem 6422,200; //Egrade_Coin
+ mes "^0000ffReceived 200 E Class Coins.^000000";
+ close;
+ }
+}
+
+// Help the Bad Cats in Danger :: mal_bad_guys
//============================================================
malangdo,175,206,3 script Gobonge#ml 561,{
if (checkweight(1201,1) == 0) {
@@ -698,131 +3231,6 @@ malangdo,3,1,3 script Guidance for quest#ml 543,{
}
*/
-// Pipielle :: mal_ppl
-//============================================================
-malangdo,137,200,6 script Pipielle 549,{
- if (checkweight(1201,1) == 0 || MaxWeight - Weight < 1000) {
- mes "You have too many items, please try again after reducing your weight.";
- close;
- }
- if (BaseLevel < 60) {
- mes "[Pipielle]";
- mes "Wow this is nice weather, do you like this kind of weather too? I like it too but I need to my work now.";
- next;
- mes "[Pipielle]";
- mes "I would ask for your help if you were a stronger advanturer...";
- next;
- mes "^770099This cat is working on something, she asks for help above LV60.^000000";
- close;
- }
- set .@fish_ss1$, "What are you doing??";
- if (countitem(6451) > 29)
- set .@fish_ss2$, "I caught a lot of strange fishes!";
- else
- set .@fish_ss2$, "Remaining " + (30-countitem(6451)) + " of ^bbbbbbUnidentified Fish are required.^000000";
- if (ma_tomas == 100)
- set .@fish_ss3$, "I met an Admiral Thomas...";
- mes "[Pipielle]";
- mes "Would you come here and open your bag for me?";
- next;
- switch(select(.@fish_ss1$,.@fish_ss2$,.@fish_ss3$)) {
- case 1:
- mes "[Pipielle]";
- mes "There are many beautiful fishes around here. So I feel my heard beating when I standing here.";
- next;
- select("Of course, my heart will beat up too if I see delicious thing!");
- mes "[Pipielle]";
- mes "How come you only know about eating!! My heart don't beat up because of I see the delicious thing. Don't treat me the same as others.";
- next;
- mes "[Pipielle]";
- mes "I used to study from scholar from uno same as human. And I am good at human language as well. Don't treat me same as others.";
- next;
- mes "[Pipielle]";
- mes "I am a scholar who researches fish in here. It's little funny that cat research fish but it's true.";
- next;
- select("Are you originally a scholar?");
- mes "[Pipielle]";
- mes "Originally I used to mate of admiral Thomas. But our ship never to back to sea after we has arrived here.";
- next;
- mes "[Pipielle]";
- mes "The mate from ship that never voyage is lonely.";
- next;
- mes "[Pipielle]";
- mes "The scholar from Uno came here for research and he thought it is amazing thing that cat speaks human language. Therefore he started teach me.";
- next;
- select("But now everyone speaks human language.");
- mes "[Pipielle]";
- mes "Oh yes, there were only little cat speaks human language. That's why he treated me special.";
- next;
- mes "[Pipielle]";
- mes "Anyways, now I collect specimens to be ichthyologist. I hope you can help me.";
- next;
- if(select("How can I help you?:I would say no.") == 2) {
- mes "[Pipielle]";
- mes "Oh, okay. If you change your mind, please come again.";
- close;
- }
- mes "[Pipielle]";
- mes "There is a Pouring who's eating all fishes in Octopus and Culvert dungeon.";
- next;
- mes "[Pipielle]";
- mes "It used to not live there, but he might came here for winter, so could you collect the specimens unidentified fish after get rid of it.";
- next;
- mes "[Pipielle]";
- mes "You can get identified fishes from Pouring, so please collect about 30 pieces.";
- close;
- case 2:
- if (countitem(6451) > 29) {
- //saveppl Unknown_Fish
- delitem 6451,30; //Unknown_Fish
- mes "[Pipielle]";
- mes "Oh, thank you! I will take these specimens.";
- next;
- mes "[Pipielle]";
- mes "I want to give you something, but last one is out of stock now so I will just write your name here.";
- next;
- mes "[Pipielle]";
- mes "I can give you good new even from far distance, but it's only possible if I am really lucky...";
- close;
- }
- mes "[Pipielle]";
- mes "I'm sorry, but please collect 30 pieces of unidentified fishes specimens.";
- close;
- case 3:
- mes "[Pipielle]";
- mes "Oh, you have met admiral Thomas... how was it?";
- next;
- if(select("He looks gentle:He looks terrible") == 2) {
- mes "[Pipielle]";
- mes "Hmm...";
- mes "Frankly speaking, I was a real fan of Admiral Thomas. Can you take a responsibility of your word?";
- next;
- if(select("Just kidding!:Oh yes, he was really terrible!") == 2) {
- mes "[Pipielle]";
- mes "Is he?";
- mes "Okay, it really depends on personal taste...";
- close;
- }
- }
- mes "[Pipielle]";
- mes "Is he?";
- mes "I knew you would say so.";
- next;
- mes "[Pipielle]";
- mes "Admiral Thomas is a legendary figure who has voyaged to this island with leading all of us. I think it was the most happiest moment in my life.";
- next;
- mes "[Pipielle]";
- mes "Please help him a lot. There are not many people to trust. This is my personal request.";
- next;
- mes "[Pipielle]";
- mes "And this is small gift for ask you to look after admiral Thomas.";
- set ma_tomas,101;
- getitem 6422,200; //Egrade_Coin
- mes "^0000ffReceived 200 E Class Coins.^000000";
- close;
- }
-}
-
// Clean the Ship :: mal_day_qook
//============================================================
mal_in02,76,63,7 script Cleanyang 544,{
@@ -1456,7 +3864,7 @@ malangdo,133,134,0 script Strange Pile of Sand#7 557,{
mes "We already collected buried cat's ship biscuit.";
close;
}
- mes "- Look so strange. -";
+ mes "- Looks so strange. -";
mes "- That's it... -";
close;
}
@@ -1492,7 +3900,7 @@ malangdo,232,131,0 script #UnderStairs8 844,{
close;
}
mes "Out of people's hand under the stairs.";
- mes "Sometimes, I look around there when I search lost toys.";
+ mes "Sometimes, I look around there when I search for lost toys.";
close;
}
@@ -1903,4 +4311,2055 @@ mal_in02,187,58,3 script Chef Nyas 548,{
mes "If you don't have any business, don't touch vegetable and go away.";
close;
}
-} \ No newline at end of file
+}
+
+// Play with Baby Cats :: mal_nyadventurer
+//============================================================
+malangdo,165,223,4 script Expert Cat#nya_01 561,{
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 4000) {
+ mes "- You have too many items to proceed in this quest. -";
+ close;
+ }
+ if (BaseLevel < 60) {
+ mes "[Rato]";
+ mes "Seems like a visitor.";
+ mes "How does this island look?";
+ mes "It is hard to believe, but this ground is very soft, so we named this island Malangdo.";
+ next;
+ mes "[Rato]";
+ mes "If you were a more professional adventurer, I'd ask you one thing...";
+ mes "Well, I won't do it.";
+ close;
+ }
+ if (nyadven == 0) {
+ mes "[Rato]";
+ mes "Hey there.";
+ mes "I am Rato, do you have a moment?";
+ next;
+ switch(select("Yeah, sure I do.:I'm sorry, but I'm busy right now.")) {
+ case 1:
+ mes "[Rato]";
+ mes "Well, nothing special, but could you do me a favor?";
+ mes "Did you see the kids gathered on your way here?";
+ next;
+ select("Kids?");
+ mes "[Rato]";
+ mes "Yes yes, baby kids.";
+ mes "They are the youngest kids among the merchants and crews.";
+ mes "They feel anxious that they might not be able to go back home.";
+ next;
+ mes "[Rato]";
+ mes "And they are getting bored of living on this small island.";
+ mes "They already tasted sea and adventure...";
+ next;
+ mes "[Rato]";
+ mes "They used to play with making things, but seem tired of that also...";
+ mes "If it's okay, would you play with them for a while?";
+ next;
+ switch(select("Uh, sure...:I don't have enough time for that.")) {
+ case 1:
+ mes "[Rato]";
+ mes "Oh, thank you!";
+ mes "Then, where are they?";
+ mes "Maybe near Beginning Compass...?";
+ next;
+ mes "[Rato]";
+ mes "They are so active that I am not sure where they are now.";
+ break;
+ case 2:
+ mes "[Rato]";
+ mes "Oh, really?";
+ mes "It's okay even though you cannot do this right now.";
+ break;
+ }
+ mes "If you meet them, please spend time with them.";
+ next;
+ mes "[Rato]";
+ mes "The youngest one is Charo, with gold fur.";
+ mes "Roku has black fur, and Rosy has white fur.";
+ mes "Please take care of them.";
+ set nyadven,1;
+ setquest 7242;
+ close;
+ case 2:
+ mes "[Rato]";
+ mes "Oh, really?";
+ mes "I am sorry for disturbing you.";
+ close;
+ }
+ } else if (nyadven == 1) {
+ mes "[Rato]";
+ mes "The youngest one is Charo, with gold fur.";
+ mes "Roku has black fur, and Rosy has white fur.";
+ next;
+ mes "[Rato]";
+ mes "We can look forward to the moment we can go back home if these children grow up nicely.";
+ mes "For that reason, please take care of them.";
+ close2;
+ } else if (nyadven < 13) {
+ mes "[Rato]";
+ mes "Do kids disturb you too much?";
+ mes "What... adventurer group? Did you play with toys from the adventurer group?";
+ next;
+ mes "[Rato]";
+ mes "I really worried about them the first time we were shipwrecked to this island...";
+ mes "They thought the first voyage was huge adventure...";
+ next;
+ mes "[Rato]";
+ mes "They look excited, like they got a fever.";
+ mes "It seems like yesterday that I made toys for them and soothed them...";
+ next;
+ mes "Rato seems to be in brown study.";
+ close;
+ } else if (nyadven == 13) {
+ if (countitem(6430) < 6) {
+ mes "You didn't bring the pieces of the painting.";
+ mes "Please take it with you.";
+ close;
+ }
+ mes "[Rato]";
+ mes "What's going on?";
+ mes "It should be very hard to take care of the kids even though I asked you, isn't it?";
+ mes "I am sorry, I should take care of them...";
+ next;
+ mes "You hand Rato a piece of painting.";
+ next;
+ mes "[Rato]";
+ mes "Oh, this is a piece of painting?";
+ mes "Ah!!!";
+ mes "Has this painting been torn up already?";
+ next;
+ mes "[Rato]";
+ mes "Did they say this is a gift for me?";
+ mes "Huhhuh, a piece of painting?";
+ mes "HAHAHAHAHA!";
+ next;
+ mes "[Rato]";
+ mes "Okay, I will patch up this painting by myself.";
+ mes "They are still the same.";
+ mes "I think I should worry about myself first...";
+ next;
+ mes "[Rato]";
+ mes "It's very kind of you to play with the kids.";
+ mes "This is for you.";
+ delitem 6430,6; //Picture_Piece
+ set nyadven,14;
+ getitem 6422,100; //Egrade_Coin
+ completequest 7259;
+ next;
+ mes "[Rato]";
+ mes "I owe you a big favor!";
+ mes "Let's drink today!";
+ mes "Miaow~";
+ close;
+ } else {
+ mes "[Rato]";
+ mes "Hey, how's it going? If you have time please look at it.";
+ next;
+ switch(select("Look at a picture.:Don't look at a picture.")) {
+ case 1:
+ mes "[Rato]";
+ mes "Yes, they drew this picture full of happiness.";
+ next;
+ cutin "mal_nyapic",4;
+ mes "Appreciate the picture in the frame.";
+ close2;
+ cutin "",255;
+ end;
+ case 2:
+ mes "[Rato]";
+ mes "Why don't you look at such a nice picture?";
+ mes "I'm disapointed.";
+ close;
+ }
+ }
+}
+
+malangdo,211,203,4 script [Meow Team] Charo#nya_11 560,{
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 4000) {
+ mes "- You have too many items to proceed in this quest. -";
+ close;
+ }
+ if (nyadven == 0) {
+ mes "There are gathered cats who seems younger than other crews.";
+ mes "They are having a serious conversation about the weird machine in front of them.";
+ close;
+ } else if (nyadven == 1) {
+ mes "There are gathered cats who seems younger than other crews.";
+ mes "They are having a serious conversation about the weird machine in front of them.";
+ mes "They are looks like kids who Rato told me.";
+ next;
+ switch(select("Just watch them without a word.:Busy right now.")) {
+ case 1:
+ mes "You try to listen to the conversation without disturbing them.";
+ next;
+ mes "[Charo]";
+ mes "When will it be fixed? When it will be done?";
+ mes "Isn't this the last one?";
+ next;
+ mes "[Rosy]";
+ mes "Um... you don't even get tried of it?";
+ mes "Anyway, we are in trouble.";
+ mes "The glass bead is broken.";
+ next;
+ mes "[Roku]";
+ mes "Don't we have an extra glass bead?";
+ next;
+ mes "[Rosy]";
+ mes "No, we don't have any.";
+ mes "We can't fix this without it, right?";
+ next;
+ mes "The cats look your way at the same time.";
+ next;
+ switch(select("I have a spare Glass Bead!:Why are you guys staring at me?")) {
+ case 1:
+ if (countitem(746) == 0) {
+ mes "[Roku]";
+ mes "There is no glass bead.";
+ mes "Don't lie to us.";
+ close;
+ }
+ mes "[Charo]";
+ mes "Really? Oh, really?";
+ mes "It's a bead! And a shining glass bead as well!";
+ next;
+ mes "[Rosy]";
+ mes "Hmm. This is enough to replace it.";
+ mes "Like this...";
+ next;
+ mes "[Roku]";
+ mes "And then here, this?";
+ mes "Done.";
+ next;
+ mes "[Charo]";
+ mes "Exciting!!!";
+ mes "Okay, adventurer! We'll give you the right to use this machine!";
+ mes "Try this whenever you want to!!";
+ next;
+ mes "[Charo]";
+ mes "Advanturer! This is a delicious can.";
+ mes "You can get whatever you want with cans in this island. It is tradable.";
+ mes "Rosy, Roku and I collected them.";
+ next;
+ mes "[Charo]";
+ mes "And adventurer!";
+ mes "If you were a real adventurer,";
+ mes "you would clear all Nyadventures";
+ mes "made by the Meow Bravery Team!";
+ mes "Challenge it whenever you want to!";
+ delitem 746,1; //Glass_Bead
+ set nyadven,2;
+ getitem 12636,30; //Malang_Sp_Can
+ close;
+ case 2:
+ mes "[Rosy]";
+ mes "We are just looking at you as you stand there.";
+ close;
+ }
+ case 2:
+ mes "I'll come again later.";
+ close;
+ }
+ } else if (nyadven == 2) {
+ mes "[Charo]";
+ mes "We fixed the Duruduru compass, we only need a visitor now...";
+ mes "Hey, do you want to be a visitor?";
+ emotion e_gasp;
+ next;
+ select("A visitor?");
+ mes "[Charo]";
+ mes "This is an adventure course made by the Meow adventure team.";
+ mes "Especially we have added studying course this time.";
+ mes "It's simple to solve, you only need to find compass in this island according to order.";
+ next;
+ switch(select("I'll give it a try.:Quit.")) {
+ case 1:
+ mes "[Charo]";
+ mes "Here is your Adventure Card.";
+ mes "This is the Duruduru Compass which we fixed with the glass bead you gave us.";
+ mes "And this is the Beginning Compass.";
+ next;
+ mes "[Charo]";
+ mes "The game will start if you put the Adventure Card in here!";
+ mes "This machine is for testing essential ingredients of adventure.";
+ next;
+ mes "[Charo]";
+ mes "Don't forget the destination for successful adventure.";
+ mes "And you should find a way to get to your destination as fast as possible.";
+ next;
+ mes "[Charo]";
+ mes "You will be good, as you are a good person for giving us the glass bead.";
+ next;
+ mes "Got Adventure Card from the yellow cat Charo.";
+ mes "It seems to work if I put this card in the slot in the Beginning Compass.";
+ set nyadven,3;
+ getitem 6428,1; //Bravery_Card_A
+ changequest 7242,7243;
+ next;
+ mes "[Charo]";
+ mes "The game will start if you scratch Adventure Card to the Beginning Compass!";
+ mes "The Beginning Compass will let you know where you should go.";
+ next;
+ mes "[Charo]";
+ mes "^4d4dffIf you go through all the compasses, you will see Meowbell from the ship Navi at last!";
+ mes "Ring the New bell!^000000";
+ close;
+ case 2:
+ mes "[Charo]";
+ mes "Ah... you are not going to do it...";
+ mes "Um...";
+ mes "Sob~";
+ mes "Meow~";
+ next;
+ mes "[Rosy]";
+ mes "Hey, adventurer. Don't make kids cry!";
+ close;
+ }
+ } else if (nyadven == 3) {
+ if (nyadven02 == 28) {
+ mes "[Charo]";
+ mes "Oh? Isn't this failed stamp from Bubi?";
+ mes "I'm really disappointed.";
+ mes "Try again~ you can make it!";
+ set nyadven02,0;
+ if (checkquest(7257) > -1)
+ erasequest 7257;
+ close;
+ }
+ mes "[Charo]";
+ mes "The game will start if you scratch Adventure Card to the Beginning Compass!";
+ mes "The Beginning Compass will let you know where you should go.";
+ next;
+ mes "[Charo]";
+ mes "^4d4dffIf you go through all the compasses, you will see Meowbell from the ship Navi at last!";
+ mes "Ring the New bell!^000000";
+ close;
+ } else if (nyadven == 4) {
+ if (countitem(6428) == 0) {
+ mes "[Charo]";
+ mes "Where is your Adventure Card?";
+ mes "You should bring it with you.";
+ mes "You can't be serious that you threw it away with your other trash!!";
+ close;
+ }
+ mes "[Charo]";
+ mes "I heard it!";
+ mes "I heard sound of Meowbell!";
+ mes "You are great!";
+ mes "The next will be a big case!";
+ next;
+ select("The next?");
+ mes "[Charo]";
+ mes "You are member of the Meow Bravery Team while you have the card with you.";
+ mes "We need an adventurer like you anyways, since this is a big case.";
+ next;
+ mes "[Charo]";
+ mes "It's for the cuff.";
+ mes "It seems a bomb is planted in this island.";
+ mes "The detective has went for this case already.";
+ next;
+ mes "[Charo]";
+ mes "You should go there too!";
+ next;
+ switch(select("Why do I have to go there?:What an adventure! I'll take it!")) {
+ case 1:
+ mes "[Charo]";
+ mes "This is a big case!";
+ mes "And this island could explode!";
+ mes "Oh, you might shut your eyes to the fact.";
+ mes "Give the Adventure Card back!";
+ delitem 6428,1; //Bravery_Card_A
+ set nyadven,5;
+ erasequest 7243;
+ close;
+ case 2:
+ mes "[Charo]";
+ mes "You have great capabilities as an adventurer!";
+ mes "Please help detective and his friend who got in trouble and also save this island!";
+ next;
+ mes "[Charo]";
+ mes "But be sure this should be done undercover!";
+ mes "Therefore you need to take this certification.";
+ mes "It shouldn't happen that the detective misunderstands you as an enemy!";
+ next;
+ mes "- Changed Adventure Card A into Adventure Card B. -";
+ delitem 6428,1; //Bravery_Card_A
+ set nyadven,6;
+ getitem 6429,1; //Bravery_Card_B
+ setquest 7246;
+ erasequest 7243;
+ next;
+ mes "[Charo]";
+ mes "The great detective and his friend will be around the ship Navi.";
+ close;
+ }
+ } else if (nyadven == 5) {
+ mes "[Charo]";
+ mes "Do you feel a disposition to help the detective and his friend?";
+ mes "Don't you?";
+ next;
+ switch(select("Yes I do.:No I don't.")) {
+ case 1:
+ mes "[Charo]";
+ mes "You have great capabilities as an adventurer!";
+ mes "Please help detective and his friend who got in trouble and also save this island!";
+ next;
+ mes "[Charo]";
+ mes "But be sure this should be done undercover!";
+ mes "Therefore you need to take this certification.";
+ mes "It shouldn't happen that the detective misunderstands you as an enemy!";
+ next;
+ mes "- Changed Adventure Card A into Adventure Card B. -";
+ set nyadven,6;
+ getitem 6429,1; //Bravery_Card_B
+ setquest 7246;
+ next;
+ mes "[Charo]";
+ mes "The great detective and his friend will be acound ship Navi.";
+ close;
+ case 2:
+ mes "[Charo]";
+ mes "Oh my god, the great detective and the ship Navi...";
+ close;
+ }
+ } else if (nyadven > 5 && nyadven < 12) {
+ mes "[Charo]";
+ mes "The great detective and his friend will be around the ship Navi.";
+ close;
+ } else if (nyadven == 12) {
+ mes "[Charo]";
+ mes "I have been waiting for you...~";
+ mes "Oh, I am short of breath from coming here in a hurry.";
+ mes "Hmph... Meow...";
+ next;
+ mes "[Charo]";
+ mes "Don't you have anything to show me?";
+ mes "Let me see it quickly!";
+ mes "Take it out!";
+ next;
+ if (countitem(6430) < 6) {
+ mes "[Charo]";
+ mes "What? You don't have it?";
+ mes "It can't be true.";
+ mes "Surely you took this with you...";
+ next;
+ mes "[Rosy]";
+ mes "How come it happened?";
+ mes "This painting is very important for us.";
+ mes "Please give it back to us.";
+ close;
+ }
+ mes "[Charo]";
+ mes "Yes, this is it!";
+ mes "This is our...";
+ mes "But, how do we put the broken pieces together?";
+ next;
+ mes "[Rosy]";
+ mes "We need a board and glue as well to put it together.";
+ mes "That's too troublesome to just give it away!";
+ next;
+ mes "[Roku]";
+ mes "Rato, looks like he is happy.";
+ mes "He will understand.";
+ next;
+ mes "[Charo]";
+ mes "Really...?";
+ mes "There is no Meow team and us without Rato.";
+ mes "I feel a little bad to give only pieces of painting but...";
+ next;
+ mes "[Charo]";
+ mes "We have no other way!";
+ mes "Rato treated this by himself!";
+ mes "No, it's better to ask Rato to put this back together.";
+ next;
+ mes "[Rosy]";
+ mes "Good idea.";
+ mes "That's really a good idea.";
+ mes "I was getting tired of it.";
+ next;
+ mes "[Charo]";
+ mes "You are a member of the Meow Bravery Team.";
+ mes "Please give these pieces of painting to Rato.";
+ mes "And tell him to treat it preciously as our treasure...";
+ next;
+ mes "[Charo]";
+ mes "We couldn't make the Bravery Team without Rato.";
+ mes "Please.";
+ mes "Tell him we didn't forget our home island.";
+ set nyadven,13;
+ changequest 7258,7259;
+ close;
+ } else if (nyadven == 13) {
+ mes "[Charo]";
+ mes "Please give this pating to Rato.";
+ mes "We drawed this painting to show Rato.";
+ mes "Please.";
+ close;
+ } else {
+ switch(rand(3)) {
+ case 0:
+ mes "[Charo]";
+ mes "Here you are! Our emeritus member of the new Bravery Team!";
+ mes "Where did you go for adventure today?";
+ mes "Are these adventure stories?!";
+ mes "If not, then...";
+ next;
+ mes "[Charo]";
+ mes "You might have come here for the compass race like huge tuna from our Meow Bravery Team!!";
+ mes "Meow!";
+ close;
+ case 1:
+ mes "[Charo]";
+ mes "Well, Homnya and Nyangson are too difficult for me.";
+ mes "...?";
+ mes "I meant the book is difficult for me.";
+ close;
+ case 2:
+ mes "[Charo]";
+ mes "Do you know how much Rato loves the painting which you have found?";
+ mes "He put framed the painting on the wall!";
+ mes "Meow~";
+ next;
+ mes "[Charo]";
+ mes "I miss my hometown.";
+ mes "But Malangdo is also my hometown as well.";
+ mes "I am okay with us all together in here~";
+ close;
+ }
+ }
+}
+
+malangdo,214,204,3 script [Meow Team] Rosy#nya_09 559,{
+ if (nyadven < 2) {
+ mes "A young cat with white fur tries so hard with the weird machine.";
+ mes "The machine might be broken.";
+ close;
+ } else if (nyadven == 2) {
+ mes "[Rosy]";
+ mes "Um? The adventurer who brought us the glass bead?";
+ mes "I really thank you for that.";
+ mes "We could fix the compass with that glass bead.";
+ close;
+ } else if (nyadven == 3) {
+ mes "[Rosy]";
+ mes "Adventure Card? Will you do the Duruduru race?";
+ mes "It's hard to say it's fun even though we made it.";
+ next;
+ mes "[Charo]";
+ mes "Oh, it's fun! Perfectly fun!";
+ mes "I have remodeled it this time!!";
+ mes "It will be really fun!!";
+ next;
+ mes "[Roku]";
+ mes "Yes. It's fun, as Charo said.";
+ mes "Maybe.";
+ mes "...";
+ mes "It is.";
+ close;
+ } else {
+ mes "[Rosy]";
+ mes "Meow...";
+ mes "I feel sleepy today.";
+ mes "I've had sore throat these day because I talked too much...";
+ next;
+ mes "[Rosy]";
+ mes "Don't you agree with me, friend?";
+ mes "...?";
+ mes "Oh, I didn't even realize...";
+ next;
+ mes "[Rosy]";
+ mes "Forget about it!";
+ mes "Doesn't this machine ever break?";
+ close;
+ }
+}
+
+malangdo,215,201,3 script [Meow Team] Roku#nya_10 553,{
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 4000) {
+ mes "- You have too many items to proceed in this quest. -";
+ close;
+ }
+ if (nyadven < 2) {
+ mes "A young black cat helps a busy white cat.";
+ mes "Maybe the machine is broken.";
+ close;
+ } else if (nyadven == 2) {
+ mes "[Roku]";
+ mes "Oh? You are the one who gave us the glass bead.";
+ mes "Thanks a lot.";
+ mes "I am happy, too, because Charo looks happy.";
+ close;
+ } else if (nyadven == 3) {
+ mes "[Roku]";
+ mes "Charo likes it.";
+ mes "It will be fun.";
+ close;
+ } else if (nyadven == 4) {
+ mes "[Roku]";
+ mes "Charo has been waiting for so long.";
+ mes "To Charo...";
+ close;
+ }
+ mes "[Roku]";
+ mes "Do you have something to tell me?";
+ next;
+ switch(select("Report results of the race.:Challenge the race.:Nothing.")) {
+ case 1:
+ if (countitem(6428) == 0) {
+ mes "[Roku]";
+ mes "Bubi, no confirmation stamps and card.";
+ mes "You will be in trouble if you are like this.";
+ close;
+ }
+ if (nyadven02 == 27) {
+ mes "[Roku]";
+ mes "Good job.";
+ mes "You are very smart.";
+ mes "This is a gift for you.";
+ mes "Please come tomorrow again.";
+ next;
+ mes "[Roku]";
+ mes "Charo likes you so much.";
+ mes "He will be happy if you come.";
+ delitem 6428,1; //Bravery_Card_A
+ set nyadven02,29;
+ getitem 6422,3; //Egrade_Coin
+ getexp 20000,20000;
+ erasequest 7244;
+ erasequest 7245;
+ close;
+ } else if (nyadven02 == 28) {
+ mes "[Roku]";
+ mes "Failed...";
+ mes "...is it too difficult for you?";
+ mes "But the race is available only once a day.";
+ delitem 6428,1; //Bravery_Card_A
+ erasequest 7244;
+ erasequest 7245;
+ next;
+ switch(select("Give me one more chance!:Okay.I will try tomorrow.")) {
+ case 1:
+ if (countitem(12636) == 0) {
+ mes "[Roku]";
+ mes "Um... Um... Well...";
+ mes "If you bring a Malangdo Can,";
+ mes "I will give you one more chance.";
+ close;
+ }
+ mes "[Roku]";
+ mes "Okay. Do you want to exchange 1 Malangdo Can for a Adventure Card?";
+ next;
+ switch(select("Exchange for Adventure Card A.:Stop it.")) {
+ case 1:
+ if (countitem(6428)) {
+ mes "[Roku]";
+ mes "You have it already?";
+ close;
+ }
+ mes "[Roku]";
+ mes "Here is your Adventure Card.";
+ mes "Beginning Compass, start!";
+ delitem 12636,1; //Malang_Sp_Can
+ getitem 6428,1; //Bravery_Card_A
+ set nyadven02,0;
+ if (checkquest(7257) > -1)
+ erasequest 7257;
+ close;
+ case 2:
+ mes "[Roku]";
+ mes "Okay, come again tomorrow.";
+ close;
+ }
+ case 2:
+ mes "[Roku]";
+ mes "Okay, come again tomorrow.";
+ close;
+ }
+ } else if (nyadven02 == 29) {
+ mes "[Roku]";
+ mes "You have reported the result for today already.";
+ mes "Right?";
+ close;
+ } else if (nyadven02 < 27) {
+ mes "[Roku]";
+ mes "You are too hasty.";
+ mes "You didn't even finish the race.";
+ mes "It's still going.";
+ close;
+ } else {
+ mes "[Roku]";
+ mes "The result is little weird, but...";
+ mes "This is neither a complete race nor incomplete race.";
+ next;
+ mes "[Roku]";
+ mes "Is this because of the machine?";
+ mes "Let's make void for this race.";
+ delitem 6428,1; //Bravery_Card_A
+ set nyadven02,0;
+ erasequest 7244;
+ erasequest 7245;
+ close;
+ }
+ case 2:
+ if (nyadven02 == 28) {
+ mes "[Roku]";
+ mes "You have failed?";
+ mes "Do you want to try again?";
+ mes "I will delete the report of the failed result.";
+ } else {
+ if (checkquest(7257,PLAYTIME) == 0 || checkquest(7257,PLAYTIME) == 1) {
+ mes "[Roku]";
+ mes "No, not yet.";
+ mes "Duruduru race is only once for a day.";
+ mes "If we do it more often, the machine will break.";
+ close;
+ }
+ mes "[Roku]";
+ mes "I know that you will try the Duruduru race.";
+ mes "I deleted your last report.";
+ }
+ if (checkquest(7257) > -1)
+ erasequest 7257;
+ next;
+ mes "[Roku]";
+ mes "You need a Adventure Card to challenge again.";
+ mes "Do you want to exchange 1 Malangdo Can for a Adventure Card?";
+ next;
+ switch(select("Buy Adventure Card.:Just stop it.")) {
+ case 1:
+ if (countitem(6428)) {
+ mes "[Roku]";
+ mes "You have it already?";
+ close;
+ }
+ if (countitem(12636) == 0) {
+ mes "[Roku]";
+ mes "There is nothing for free.";
+ mes "You need a Malangdo Can.";
+ close;
+ }
+ mes "[Roku]";
+ mes "Here is your Adventure Card.";
+ mes "Beginning Compass, start!";
+ delitem 12636,1; //Malang_Sp_Can
+ getitem 6428,1; //Bravery_Card_A
+ set nyadven02,0;
+ close;
+ case 2:
+ mes "[Roku]";
+ mes "Okay.";
+ close;
+ }
+ case 3:
+ mes "[Roku]";
+ mes "You are the weird one.";
+ close;
+ }
+}
+
+malangdo,212,204,0 script Beginning Compass#nya_02 844,{
+ if (countitem(6428) == 0) {
+ mes "There is a strange machine.";
+ mes "The kids said this was the ride called Duruduru compass of the Meow Bravery Team.";
+ close;
+ }
+ if (nyadven02 < 11) {
+ mes "An iron pot contains a map of Malangdo with a card inserter.";
+ mes "After inserting your card, a red button and the map inside the pot light up.";
+ mes "It seems to start after pressing the button.";
+ next;
+ switch(select("Start it right now.:Start it later.")) {
+ case 1:
+ mes "The card has come out with lights on the map after pressing the button.";
+ if (rand(20) < 10) {
+ callsub L_Viewpoint,1,1;
+ mes "The game has started already!";
+ set nyadven02,11;
+ setquest 7244;
+ close;
+ } else {
+ callsub L_Viewpoint,2,1;
+ mes "The game has started already!";
+ set nyadven02,21;
+ setquest 7245;
+ close;
+ }
+ case 2:
+ mes "Challenge it a little later.";
+ close;
+ }
+ } else if (nyadven02 >= 11 && nyadven02 <= 15) {
+ callsub L_Viewpoint,1,(nyadven02-10);
+ close;
+ } else if (nyadven02 >= 21 && nyadven02 <= 25) {
+ callsub L_Viewpoint,2,(nyadven02-20);
+ close;
+ } else if (nyadven02 == 16 || nyadven02 == 26) {
+ mes "The destination displays with pressing the button after inserting the card.";
+ mes "It's above the deck in the middle of the island!";
+ close;
+ }
+ mes "Beginning Compass among the Duruduru compass.";
+ mes "The Duruduru race starts from this compass.";
+ close;
+
+// callsub L_Viewpoint,<order number>,<start index>;
+L_Viewpoint:
+ switch(getarg(0)) {
+ case 1: // Order 1: Red, Blue, Yellow, Green, White
+ setarray .@Colors$[1],"^FF0000","^0000FF","^FFFF00","^00FF00","^cccccc";
+ setarray .@Text$[1],"Red","Blue","Yellow","Green","White";
+ if (getarg(1) <= 1)
+ viewpoint 1,213,89,0,0xFF0000;
+ if (getarg(1) <= 2)
+ viewpoint 1,128,103,1,0x0000FF;
+ if (getarg(1) <= 3)
+ viewpoint 1,73,253,2,0xFFFF00;
+ if (getarg(1) <= 4)
+ viewpoint 1,153,146,3,0x00FF00;
+ viewpoint 1,111,178,4,0xcccccc;
+ break;
+ case 2: // Order 2: Yellow, Blue, White, Green, Red
+ setarray .@Colors$[1],"^FFFF00","^0000FF","^cccccc","^00FF00","^FF0000";
+ setarray .@Text$[1],"Yellow","Blue","White","Green","Red";
+ if (getarg(1) <= 1)
+ viewpoint 1,73,253,0,0xFFFF00;
+ if (getarg(1) <= 2)
+ viewpoint 1,128,103,1,0x0000FF;
+ if (getarg(1) <= 3)
+ viewpoint 1,111,178,2,0xcccccc;
+ if (getarg(1) <= 4)
+ viewpoint 1,153,146,3,0x00FF00;
+ viewpoint 1,213,89,4,0xFF0000;
+ break;
+ }
+ for(set .@i,1; .@i<=5; set .@i,.@i+1)
+ set .@str$, .@str$+((.@i >= getarg(1))?.@Colors$[.@i]:"")+.@Text$[.@i]+" ";
+ if (getarg(1) > 1)
+ mes "After inserting the card and pressing the red button, the path to the destination lit up.";
+ mes "The order will be "+.@str$+"^000000.";
+ return;
+}
+
+- script #malangdo_compass -1,{
+ if (countitem(6428) == 0) {
+ mes "There is a strange machine.";
+ mes "This is the Duruduru compass from the Meow Bravery Team.";
+ close;
+ }
+ set .@index, atoi(strnpcinfo(2));
+ switch(.@index) {
+ case 1:
+ setarray .@var[0],11,25;
+ set .@color$,"red";
+ break;
+ case 2:
+ setarray .@var[0],12,22;
+ set .@color$,"blue";
+ break;
+ case 3:
+ setarray .@var[0],13,21;
+ set .@color$,"gold";
+ break;
+ case 4:
+ setarray .@var[0],14,24;
+ set .@color$,"green";
+ break;
+ case 5:
+ setarray .@var[0],15,23;
+ set .@color$,"white";
+ break;
+ }
+ mes "Delicate "+.@color$+" lights surround the "+strnpcinfo(1)+".";
+ if (nyadven02 < 11) {
+ mes "After inserting the card and pressing the button, characters appear on the screen.";
+ next;
+ mes "^00FF00This is a card that didn't start the game yet. Please go back to the Beginning Compass.^000000";
+ close;
+ } else if (nyadven02 == .@var[0] || nyadven02 == .@var[1]) {
+ mes "After inserting the card and pressing the button, characters appear on the screen.";
+ next;
+ mes "Welcome to the exciting number world!";
+ mes "Enter the exact answer after reading the question!";
+ next;
+ while(1) {
+ switch(.@index) {
+ case 1:
+ set .@nori_a, rand(1,999);
+ set .@nori_b, rand(1,999);
+ set .@nori_c, .@nori_a+.@nori_b;
+ mes .@nori_a+" + "+.@nori_b+" = ??";
+ break;
+ case 2:
+ set .@nori_a, rand(1,9);
+ set .@nori_b, rand(1,9);
+ set .@nori_c, .@nori_a*.@nori_b;
+ mes .@nori_a+" x "+.@nori_b+" = ??";
+ break;
+ case 3:
+ set .@nori_a, rand(600,999);
+ set .@nori_b, rand(1,599);
+ set .@nori_c, .@nori_a-.@nori_b;
+ mes .@nori_a+" - "+.@nori_b+" = ??";
+ break;
+ case 4:
+ set .@nori_a, rand(1,99);
+ set .@nori_b, rand(1,9);
+ set .@nori_d, rand(1,9);
+ set .@nori_c, .@nori_a+(.@nori_b*.@nori_d);
+ mes .@nori_a+" + "+.@nori_b+" x "+.@nori_d+" = ??";
+ break;
+ case 5:
+ set .@nori_a, rand(1,9);
+ set .@nori_c, .@nori_a+(.@nori_a*.@nori_a);
+ mes .@nori_a+" + "+.@nori_a+" x "+.@nori_a+" = ??";
+ break;
+ }
+ next;
+ input .@input;
+ if (.@input == .@nori_c) {
+ mes "The card slides out with a sound after entering the number.";
+ mes "^4d4dffYou have passed the "+strnpcinfo(1)+"! Run to the next destination!^000000";
+ mes "You should run for the next destination.";
+ set nyadven02, nyadven02+1;
+ close;
+ }
+ mes "You've got wrong answer!";
+ mes "You can not pass here without exact answer!";
+ mes "Enter exact answer after read question!";
+ next;
+ }
+ } else if (nyadven02 == 16 || nyadven02 == 26) {
+ mes "After inserting the card and pressing the button, characters appear on the screen.";
+ next;
+ mes "The compass needle turns around in the middle of map.";
+ mes "You should run for the next destination.";
+ viewpoint 2,1,1,0,0xFFFFFF;
+ viewpoint 2,1,1,1,0xFFFFFF;
+ viewpoint 2,1,1,2,0xFFFFFF;
+ viewpoint 2,1,1,3,0xFFFFFF;
+ viewpoint 2,1,1,4,0xFFFFFF;
+ viewpoint 1,162,177,5,0xcccccc;
+ close;
+ } else if ((nyadven02 >= 11 && nyadven02 <= 15) || (nyadven02 >= 21 && nyadven02 <= 25)) {
+ mes "After inserting the card and pressing the button, characters appear on the screen.";
+ next;
+ mes "^FF0000You are going the wrong way! The paths in the card and compass don't line up!^000000";
+ close;
+ }
+ close;
+}
+malangdo,213,89,0 duplicate(#malangdo_compass) Red Flame Compass#1 844
+malangdo,128,103,0 duplicate(#malangdo_compass) Blue Flame Compass#2 844
+malangdo,73,253,0 duplicate(#malangdo_compass) Gold Flame Compass#3 844
+malangdo,153,146,0 duplicate(#malangdo_compass) Forest Compass#4 844
+malangdo,111,178,0 duplicate(#malangdo_compass) Cloud Compass#5 844
+
+malangdo,175,163,0 script Meowbell#nya_12 844,{
+ if (countitem(6428) == 0) {
+ mes "There is a fancy bell which doesn't fit in with the ship.";
+ mes "This bell is used in a game by the Meow Bravery Team.";
+ viewpoint 2,1,1,0,0xFFFFFF;
+ viewpoint 2,1,1,1,0xFFFFFF;
+ viewpoint 2,1,1,2,0xFFFFFF;
+ viewpoint 2,1,1,3,0xFFFFFF;
+ viewpoint 2,1,1,4,0xFFFFFF;
+ viewpoint 2,1,1,5,0xFFFFFF;
+ close;
+ }
+ if (nyadven02 == 16)
+ set .@quest,7244;
+ else if (nyadven02 == 26)
+ set .@quest,7245;
+ else {
+ mes "There is a one more little bell beside the huge notice bell in the deck.";
+ mes "This is the Meowbell from the Meow Bravery Team.";
+ next;
+ mes "This is last bell to ring if you have the card for the game.";
+ mes "Nothing to say for now.";
+ close;
+ }
+ mes "This is the Meowbell.";
+ mes "You insert your card into the middle slot.";
+ viewpoint 2,1,1,0,0xFFFFFF;
+ viewpoint 2,1,1,1,0xFFFFFF;
+ viewpoint 2,1,1,2,0xFFFFFF;
+ viewpoint 2,1,1,3,0xFFFFFF;
+ viewpoint 2,1,1,4,0xFFFFFF;
+ viewpoint 2,1,1,5,0xFFFFFF;
+ if (checkquest(.@quest,PLAYTIME) == 0 || checkquest(.@quest,PLAYTIME) == 1) {
+ mes "Knock Meowbell!!";
+ set nyadven02,27;
+ changequest .@quest,7257;
+ next;
+ if (nyadven == 3) {
+ mes "[Deckhand Bubi]";
+ mes "Oh, I'm suprised.";
+ mes "You rang the Meowbell in a short time.";
+ mes "I think you have the talent to be an adventurer.";
+ next;
+ mes "[Deckhand Bubi]";
+ mes "People say...";
+ mes "The purpose of this Duruduru game";
+ mes "is to find and go to a destination quickly and accurately.";
+ next;
+ mes "[Deckhand Bubi]";
+ mes "Go to Charo with that Adventure Card.";
+ mes "I will give you a confirmation stamp for success.";
+ set nyadven,4;
+ close;
+ } else {
+ mes "[Deckhand Bubi]";
+ mes "Oh, you've really gotten used to it.";
+ mes "You succeeded again.";
+ mes "I've put my paw stamp here.";
+ mes "Run to Rato now.";
+ close;
+ }
+ } else {
+ mes "-- Beep --";
+ mes "The card has out with a warning sound.";
+ set nyadven02,28;
+ changequest .@quest,7257;
+ next;
+ mes "[Deckhand Bubi]";
+ mes "You didn't ring the Meowbell within time.";
+ mes "Well, it's out of my hands now.";
+ mes "I will give you the fail stamp!!";
+ close;
+ }
+}
+
+malangdo,176,165,3 script Deckhand Bubi#nya_16 544,{
+ mes "[Bubi]";
+ mes "Hey, human adventurer, what are you here for?";
+ mes "Yeah~ this is a beautiful view.";
+ next;
+ mes "[Bubi]";
+ mes "Are you one of the people who came here to ring the Meowbell?";
+ mes "I am not a member of the Meow Team, but I can give you the confirmation stamp.";
+ next;
+ mes "[Bubi]";
+ mes "Um, my work?";
+ mes "Oh, that is only for when I am not on a voyage.";
+ mes "I am free these days.";
+ close;
+}
+
+malangdo,172,178,7 script Cat Detective#nya_14 560,{
+ cutin "mal_homnya_n",2;
+ if (nyadven < 6) {
+ mes "[Cat Detective]";
+ mes "Um? What is the matter?";
+ mes "Hey, here is a suspicious guy.";
+ next;
+ mes "[Cat Detective]";
+ mes "I can surely tell he is drunk by the smell of liquid.";
+ mes "I am so sad that I can not.";
+ next;
+ mes "[Friend of Detective]";
+ mes "Oh, I am so sorry to hear that you have such genius analytical skills!";
+ mes "He is not drunk...";
+ next;
+ mes "[Cat Detective]";
+ mes "Drunks always smell of liquid.";
+ mes "But he is not, therefore he is not drunk, friend.";
+ next;
+ select("Then what is your identity?");
+ cutin "mal_homnya_s",2;
+ mes "[Cat Detective]";
+ mes "Well... You are everything except drunk!!!";
+ next;
+ mes "The voice of the cats sounded shaky.";
+ close2;
+ } else if (nyadven == 6) {
+ mes "[Cat Detective]";
+ mes "What did I say?";
+ mes "Didn't I tell you that someone will come here soon?";
+ next;
+ mes "[Friend of Detective]";
+ mes "Great.";
+ mes "I can only admire your deduction.";
+ next;
+ mes "[Detective Homnya]";
+ mes "Haha, Nyangson, this is nothing for me.";
+ mes "Before that, let's listen to the stories from the visitor first.";
+ next;
+ switch(select("Charo? Rosy?:Are you guys detectives?")) {
+ case 1:
+ cutin "mal_homnya_s",2;
+ mes "[Homnya]";
+ mes "No... Who are they?";
+ mes "Nyangson, do you know them?";
+ next;
+ mes "[Nyangson]";
+ mes "I... I don't know either?";
+ mes "I don't know Charo and Rosy!";
+ next;
+ mes "[Homnya]";
+ mes "Yes. Yes.";
+ mes "We are the detective and friend!";
+ next;
+ break;
+ case 2:
+ mes "[Homnya]";
+ mes "Yes, I am the detective, Homnya.";
+ mes "And this is my friend, Nyangson. He reports my cases.";
+ next;
+ break;
+ }
+ mes "[Homnya]";
+ mes "Anyways, that's not important for now!";
+ mes "We should focus on current situation.";
+ next;
+ mes "[Nyangson]";
+ mes "Yes, that's right, friend.";
+ mes "We think........";
+ next;
+ mes "[Homnya]";
+ mes "Yes! This is a bomb for sure!";
+ mes "I am so sorry, I have only analytical and detective skills but don't have the skill to dispose of a bomb!";
+ next;
+ cutin "mal_homnya_s",2;
+ mes "[Nyangson]";
+ mes "What do you mean by that?";
+ mes "It doesn't make any sense!";
+ next;
+ mes "[Homnya]";
+ mes "Yes, we shout when it changed from the peak of hope into the peak of sorrow.";
+ mes "Peak!";
+ mes "Meow!";
+ next;
+ mes "I don't get the meaning of this, but they seem to be in hurry.";
+ next;
+ switch(select("Continue to humor them.:Stop playing around.")) {
+ case 1:
+ cutin "mal_homnya_n",2;
+ mes "[Homnya]";
+ mes "Oh, if you give us a hand, I will take it. How do you think about it, friend?";
+ next;
+ mes "[Nyangson]";
+ mes "I don't really care about it. What I want to do is only to report this case.";
+ mes "One of the cases will be open to the public among the most strange and weird cases ever.";
+ next;
+ mes "[Homnya]";
+ mes "I knew this visitor had the skill to dispose of a bomb.";
+ mes "He is totally prepared to escape from danger.";
+ next;
+ mes "[Nyangson]";
+ mes "Oh, I heard of it. I heard they use fly wings and butterfly wings as well.";
+ mes "I've never thought I could meet a person who used these thing for real.";
+ next;
+ mes "[Homnya]";
+ mes "Yes, I believe this visitor will solve our mystery.";
+ mes "Then please stop this damn machine!";
+ next;
+ mes "[Nyangson]";
+ mes "Yes, the damn machine!";
+ mes "It is loud and useless!";
+ mes "And it will be blown up.";
+ next;
+ mes "[Homnya]";
+ mes "Well, stop this machine!!!";
+ set nyadven,7;
+ changequest 7246,7247;
+ close2;
+ break;
+ case 2:
+ cutin "mal_homnya_s",2;
+ mes "[Homnya]";
+ mes "Please don't...";
+ mes "Please act according to the script.";
+ next;
+ mes "[Nyangson]";
+ mes "Charo. Where is the script?";
+ mes "No, Homnya. My friend...";
+ next;
+ mes "Two young cats are sweating a lot.";
+ close2;
+ break;
+ }
+ } else if (nyadven == 7) {
+ mes "[Homnya]";
+ mes "Stop this noisy machine!";
+ mes "This is the moment that your memory can be coming through!";
+ next;
+ mes "[Nyangson]";
+ mes "Yes. Yes.";
+ mes "This is the sort of training where you dispose of and breach all the traps.";
+ mes "Yes, this is.";
+ close2;
+ } else if (nyadven == 8) {
+ mes "[Homnya]";
+ mes "It was a scary moment.";
+ mes "This machine is still fine anyways!";
+ mes "Stop it again.";
+ next;
+ mes "[Homnya]";
+ mes "Yes, you need Adventure Card B to operate this machine.";
+ mes "Do you want to buy a new one?";
+ next;
+ mes "[Nyangson]";
+ mes "It costs one Malangdo Can.";
+ next;
+ switch(select("Buy Adventure Card.:Do not buy.")) {
+ case 1:
+ if (countitem(12636) == 0) {
+ mes "[Homnya]";
+ mes "I said I can exchange Adventure Card with one Malango Can~";
+ close2;
+ break;
+ }
+ mes "[Homnya]";
+ mes "See, this is a scary machine.";
+ mes "Here is your Adventure Card.";
+ mes "Stop this machine this time.";
+ delitem 12636,1; //Malang_Sp_Can
+ set nyadven,7;
+ getitem 6429,1; //Bravery_Card_B
+ close2;
+ break;
+ case 2:
+ mes "[Homnya]";
+ mes "What?";
+ mes "But you came here to buy a Adventure Card.";
+ mes "......";
+ next;
+ mes "[Nyangson]";
+ mes "If you buy a Adventure Card there won't be any bloodshed...";
+ close2;
+ break;
+ }
+ } else if (nyadven == 9) {
+ mes "[Homnya]";
+ mes "Hey, there is good news for you.";
+ mes "I received pretty good news while you struggled with that machine.";
+ next;
+ mes "[Nyangson]";
+ mes "Hello, capable friend, what did you find?";
+ mes "Is this something like hidden treasure?";
+ next;
+ mes "[Homnya]";
+ mes "Hidden treasure?";
+ mes "Very similar!";
+ mes "It will be hidden in serveral places inside the cabin.";
+ mes "You should find them!";
+ next;
+ switch(select("I feel tired of it now.:Oh, yes!")) {
+ case 1:
+ mes "[Homnya]";
+ mes "Oh, really?";
+ mes "If you feel tired then it's okay.";
+ mes "Please come again, if you want.";
+ next;
+ mes "[Nyangson]";
+ mes "Please come again~.";
+ close2;
+ break;
+ case 2:
+ mes "[Homnya]";
+ mes "I knew you would do this!";
+ mes "I have the right eye for people.";
+ mes "The place is inside of the ship Navi.";
+ next;
+ mes "[Nyangson]";
+ mes "It will be fine because it isn't really a large place.";
+ mes "I look forward to your active work!";
+ set nyadven,10;
+ setquest 7250;
+ close2;
+ break;
+ }
+ } else if (nyadven == 10) {
+ mes "[Homnya]";
+ mes "Please find the pieces of the treasure.";
+ mes "The tresure is hidden inside of the ship Navi according to our information.";
+ next;
+ mes "[Nyangson]";
+ mes "Come here right after you find treasure!";
+ close2;
+ } else if (nyadven == 11) {
+ if (countitem(6430) > 5) {
+ mes "[Homnya]";
+ mes "You've found all the treasure.";
+ mes "Yes, exactly.";
+ mes "You might thought this painting was just a normal painting.";
+ next;
+ mes "[Homnya]";
+ mes "But...!";
+ mes "If we do this...!";
+ next;
+ mes "[Nyangson]";
+ mes "Oh, this is....... the one from that moment...";
+ mes "This is the one when we left our hometown.";
+ next;
+ mes "[Homnya]";
+ mes "It's time to give it back to the brave new team!";
+ mes "Let's give it back!";
+ mes "Meow~";
+ next;
+ mes "Charo and Rosy who make up as Homnya and Nyangson";
+ mes "checked the pieces of painting and give it back again.";
+ mes "They look excited.";
+ next;
+ mes "[Homnya]";
+ mes "Please give it back to the Meow Bravery Team~";
+ mes "For everyone~ Meow~";
+ mes "These are real treasures!";
+ set nyadven,12;
+ erasequest 7250;
+ erasequest 7251;
+ erasequest 7252;
+ erasequest 7253;
+ erasequest 7254;
+ erasequest 7255;
+ erasequest 7256;
+ setquest 7258;
+ close2;
+ } else {
+ mes "[Homnya]";
+ mes "Well? It's strange. There should be 6 pieces of treasure.";
+ mes "It's missing pieces...";
+ mes "Is this fake? I will throw it out!";
+ next;
+ mes "[Nyangson]";
+ mes "Go get the treasure again!";
+ delitem 6430,countitem(6430); //Picture_Piece
+ erasequest 7251;
+ erasequest 7252;
+ erasequest 7253;
+ erasequest 7254;
+ erasequest 7255;
+ erasequest 7256;
+ set nyadven,10;
+ setquest 7250;
+ close2;
+ }
+ } else if (nyadven == 12 || nyadven == 13) {
+ mes "[Homnya]";
+ mes "Please give these treasures you've found to the Meow Bravery Team.";
+ mes "You will know how precious these treasures are when you give these to them~";
+ next;
+ mes "[Nyangson]";
+ mes "Yes, you will realize.";
+ mes "It's good to take a break for little bit but now we don't have any spare time.";
+ close2;
+ } else {
+ if (countitem(6429) > 0) {
+ mes "[Homnya]";
+ mes "Stop this noisy machine!";
+ mes "Insert your Adventure Card, and take a look at the reaction of the machine carefully. Then do the proper action!";
+ next;
+ mes "[Nyangson]";
+ mes "That's right~";
+ close2;
+ }
+ mes "[Homnya]";
+ mes "Hey Nyangson.";
+ mes "Here comes the hero.";
+ mes "He seems to be here for fixing this naughty machine.";
+ next;
+ mes "[Nyangson]";
+ mes "I always admire your keen insight.";
+ mes "He looks like that for sure.";
+ mes "Then he will buy Adventure Card with Malangdo Can?";
+ next;
+ mes "[Homnya]";
+ mes "You are getting better";
+ mes "I always keep eyes on your keen insight.";
+ mes "You are my true friend.";
+ next;
+ switch(select("How's the condition of Bang?:Ignore it.")) {
+ case 1:
+ if (checkquest(7249,PLAYTIME) == 0 || checkquest(7249,PLAYTIME) == 1) {
+ mes "[Homnya]";
+ mes "it's so motivated but it's not the time yet.";
+ mes "Not yet even though naughty machine is noisy.";
+ mes "Please come again.";
+ next;
+ mes "[Nyangson]";
+ mes "We also have break time.....";
+ close2;
+ } else {
+ if (checkquest(7249,PLAYTIME) == 2)
+ erasequest 7249;
+ mes "[Homnya]";
+ mes "Can you hear how noisy this one is?";
+ mes "It sounds like a runaway foal!";
+ next;
+ mes "[Nyangson]";
+ mes "He needs an Adventure Card to stop it.";
+ mes "Well, do you want to try?";
+ next;
+ switch(select("Buy Adventure Card B.:Don't buy it.")) {
+ case 1:
+ if (countitem(12636) == 0) {
+ mes "[Homnya]";
+ mes "How many Malangdo Cans for an Adventure Card?";
+ next;
+ mes "[Nyangson]";
+ mes "Only one can, dear.";
+ mes "Meow~";
+ close2;
+ break;
+ }
+ mes "[Homnya]";
+ mes "Yes, please try it without blowing it up.";
+ mes "Solve it fast!";
+ next;
+ mes "[Nyangson]";
+ mes "Please do it.";
+ delitem 12636,1; //Malang_Sp_Can
+ getitem 6429,1; //Bravery_Card_B
+ close2;
+ break;
+ case 2:
+ cutin "mal_homnya_s",2;
+ mes "[Homnya]";
+ mes "Ah... Hey... You can't do that!";
+ mes "Hey, don't go!";
+ mes "Please stop this, Nyangson!";
+ next;
+ mes "[Nyangson]";
+ mes "This and that one are all noisy!";
+ mes "Please!";
+ next;
+ mes "The two young cats are sweating a lot.";
+ close2;
+ break;
+ }
+ }
+ break;
+ case 2:
+ cutin "mal_homnya_s",2;
+ mes "[Homnya]";
+ mes "Ah... Hey... You can't do that!";
+ mes "Hey, don't go!";
+ mes "Please stop this, Nyangson!";
+ next;
+ mes "[Nyangson]";
+ mes "This and that one are all noisy!";
+ mes "Please!";
+ next;
+ mes "The two young cats are sweating a lot.";
+ close2;
+ break;
+ }
+ }
+ cutin "",255;
+ end;
+}
+
+malangdo,173,177,7 script Friend of Detective#mal 559,{
+ cutin "mal_homnya_n",2;
+ mes "[Nyangson]";
+ mes "I am a friend of Detective Homnya, Nyangson.";
+ mes "Please ask Homnya if you have questions.";
+ next;
+ mes "[Homnya]";
+ mes "Yes, he only goes 'yes, my friend' beside me!";
+ mes "Ask me!";
+ close2;
+ cutin "",255;
+ end;
+}
+
+malangdo,174,175,0 script Noisy Machine#nya_13 844,{
+ if (nyadven < 7) {
+ mes "There is a strange machine.";
+ mes "It has a Red, Blue, Yellow, and Green luminous body with buttons to react,";
+ mes "while spinning with noisy sounds.";
+ next;
+ mes "It looks more unstable as it spins faster.";
+ close;
+ }
+ if (checkquest(7249,PLAYTIME) == 0 || checkquest(7249,PLAYTIME) == 1) {
+ mes "[Homnya]";
+ mes "It's so motivated, but it's not time yet.";
+ mes "Not yet, even though the machine is so noisy.";
+ mes "Please come again.";
+ next;
+ mes "[Nyangson]";
+ mes "We also have break time...";
+ close;
+ }
+ if (countitem(6429) == 0) {
+ mes "[Homnya]";
+ mes "You can't try this without Adventure Card B.";
+ mes "Please bring it with you.";
+ close;
+ }
+ mes "There is a strange machine.";
+ mes "It has a Red, Blue, Yellow, and Green luminous body with buttons to react,";
+ mes "while spinning with noisy sounds.";
+ next;
+ mes "It looks more unstable as it spins faster.";
+ next;
+ cutin "mal_homnya_n",2;
+ mes "[Homnya]";
+ mes "Stop this machine by inserting the card into it!";
+ next;
+ mes "[Nyangson]";
+ mes "Go ahead!";
+ next;
+ cutin "",255;
+ if(select("Insert card.:Stop it.") == 2) {
+ mes "[Homnya]";
+ mes "Um? You aren't going to do this?";
+ mes "Really?";
+ mes "Even though this machine can blow up the whole island?!";
+ next;
+ mes "[Nyangson]";
+ mes "Does he know it's never going to blow up?";
+ next;
+ mes "The two young cats are sweating a lot.";
+ close;
+ }
+ mes "After inserting the card, discs on top of the machine spin faster...";
+ mes "The lights begin to flicker faster too.";
+ next;
+ callsub L_ShowLights,2;
+ callsub L_ShowLights,4;
+ callsub L_ShowLights,6;
+ callsub L_ShowLights,8;
+ cutin "mal_homnya_n",2;
+ mes "[Homnya]";
+ mes "Oh, great!";
+ mes "The banging has stopped!";
+ mes "You have a good memory!";
+ mes "Please take this small gift.";
+ next;
+ mes "[Nyangson]";
+ mes "You can get it after you have been through all the difficulties from the Meow Advanture Team.";
+ mes "And we are not sure if this machine will try to blow up agian, so please come again tomorrow.";
+ if (nyadven == 7) {
+ set nyadven,9;
+ erasequest 7247;
+ }
+ delitem 6429,1; //Bravery_Card_B
+ setquest 7249;
+ getitem 6422,3; //Egrade_Coin
+ getexp 20000,20000;
+ next;
+ if (nyadven == 9) {
+ mes "[Homnya]";
+ mes "Hey, there is good news for you.";
+ mes "I received pretty good news while you struggled with that machine.";
+ next;
+ mes "[Nyangson]";
+ mes "Hello, capable friend, what did you find?";
+ mes "Is this something like hidden treasure?";
+ next;
+ mes "[Homnya]";
+ mes "Hidden treasure?";
+ mes "Very similar!";
+ mes "It will be hidden in serveral places inside the cabin.";
+ mes "You should find them!";
+ next;
+ switch(select("I feel tired of it now.:Oh, yes!")) {
+ case 1:
+ mes "[Homnya]";
+ mes "Oh, really?";
+ mes "If you feel tired then it's okay.";
+ mes "Please come again, if you want.";
+ next;
+ mes "[Nyangson]";
+ mes "Please come again~.";
+ close2;
+ break;
+ case 2:
+ mes "[Homnya]";
+ mes "I knew you would do this!";
+ mes "I have the right eye for people.";
+ mes "The place is inside of the ship Navi.";
+ next;
+ mes "[Nyangson]";
+ mes "It will be fine because it isn't really a large place.";
+ mes "I look forward to your active work!";
+ set nyadven,10;
+ setquest 7250;
+ close2;
+ break;
+ }
+ } else {
+ mes "[Homnya]";
+ mes "Then I am looking forward to tomorrow!";
+ close2;
+ }
+ cutin "",255;
+ end;
+
+// callsub L_ShowLights,<number of lights>;
+L_ShowLights:
+ mes "Luminous";
+ mes "The order of buttons are:";
+ mes "[Red] [Green] [Blue] [Yellow]";
+ mes "And below this, more buttons:";
+ mes "[Green] [Red] [Yellow] [Blue]";
+ mes "In that order.";
+ next;
+ mes "Luminous";
+ setarray .@Color$[0],"Red","Blue","Yellow","Green";
+ setarray .@Cutin$[0],"nya_red","nya_blue","nya_yellow","nya_green";
+ for(set .@i,0; .@i<getarg(0); set .@i,.@i+1) {
+ set .@rand, rand(4);
+ set .@Lamp[.@i],.@rand;
+ mes .@Color$[.@rand];
+ if (.@i+1 == getarg(0))
+ mes "Shines according to this order.";
+ cutin .@Cutin$[.@rand],4;
+ progressbar "0xFFFF00",1;
+ }
+ cutin "nya_off",4;
+ mes "The buttons below are shining now.";
+ mes "Stop the machine by pressing the right button within time.";
+ next;
+ set .@pass,0;
+ setarray .@Count$[0],"first","second","third","fourth","fifth","sixth","seventh","eighth";
+ for(set .@i,0; .@i<getarg(0); set .@i,.@i+1) {
+ mes "Which color button do you want to press "+.@Count$[.@i]+"?";
+ next;
+ // Red <-> Green, Blue <-> Yellow
+ set .@j, select("Red:Blue:Yellow:Green");
+ if (.@Lamp[.@i] == 4-.@j)
+ set .@pass,.@pass+1;
+ }
+ if (.@pass < getarg(0)) {
+ mes "The speed of spinning is getting faster after pressing the buttons.";
+ mes "After all...";
+ specialeffect EF_BEGINSPELL6;
+ emotion e_gasp,0,"Cat Detective#nya_14";
+ emotion e_gasp,0,"Friend of Detective#mal";
+ next;
+ cutin "mal_homnya_s",2;
+ mes "[Homnya]";
+ mes "Watch out!!!";
+ mes " ";
+ mes "[Nyangson]";
+ mes "It's blowing up!";
+ specialeffect EF_FIREHIT;
+ specialeffect EF_FIRESPLASHHIT;
+ next;
+ cutin "",255;
+ mes "Adventure Card B burned off";
+ mes "with a huge explosion.";
+ delitem 6429,1; //Bravery_Card_B
+ if (nyadven == 7)
+ set nyadven,8;
+ close;
+ }
+ mes "The speed of the spinning discs gets slower after pressing the buttons.";
+ mes "The luminous shines once and stops also.";
+ cutin "nya_off",4;
+ next;
+ if (getarg(0) < 8) {
+ mes "[Homnya]";
+ mes "Don't reduce your tension!";
+ mes "It's not over yet!";
+ next;
+ mes "The machine starts again.";
+ mes "And the luminous shines also, as if it keeps asking you for the right answer.";
+ next;
+ }
+ return;
+}
+
+// callfunc "F_Mal_Picture",<quest ID>,<chance to kick?>,<description 1>,<description 2>,<description 3>;
+// Returns:
+// 1 - Player kicked.
+// 2 - nyadven is not 10.
+// 3 - Player has already found the picture piece.
+// null - Success.
+function script F_Mal_Picture {
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 4000) {
+ mes "- You have too many items to proceed in this quest. -";
+ close;
+ }
+ if (getarg(1) && rand(2))
+ return 1;
+ else if (nyadven != 10)
+ return 2;
+ else if (checkquest(getarg(0)) > -1)
+ return 3;
+ else {
+ mes getarg(2);
+ mes getarg(3);
+ next;
+ mes getarg(4);
+ mes "You found a piece of the painting.";
+ setquest getarg(0);
+ getitem 6430,1; //Picture_Piece
+ next;
+ if (checkquest(7251) > -1 && checkquest(7252) > -1 && checkquest(7253) > -1 && checkquest(7254) > -1 && checkquest(7255) > -1 && checkquest(7256) > -1) {
+ mes "It looks like you can put these pieces of paintings together.";
+ mes "If I found all the pieces, I should go back to Homnya.";
+ set nyadven,11;
+ close;
+ }
+ mes "I think this is the treasure Homnya and Nyangson mentioned.";
+ mes "Let's find more pieces.";
+ close;
+ }
+}
+
+mal_in02,187,45,0 script Box#nya01 844,{
+ switch(callfunc(
+ "F_Mal_Picture",
+ 7251,1,
+ "There is an uncommon box in the corner of the cabin.",
+ "It seems to tell me that it has a teasure inside.",
+ "I can see a piece of paper sticking out."
+ )) {
+ case 1:
+ mes "[Neat Crew]";
+ mes "What are you doing here?!";
+ mes "Don't touch that box any more!";
+ mes "There will be more bugs if you keep hiding snacks in there!";
+ mes "Get out!";
+ close2;
+ warp "mal_in02",138,60;
+ end;
+ case 2:
+ mes "A box in the corner of the cabin.";
+ close;
+ case 3:
+ mes "This is a box which used to contain a piece of the painting.";
+ close;
+ }
+}
+
+mal_in02,170,75,0 script Book#nya02 844,{
+ switch(callfunc(
+ "F_Mal_Picture",
+ 7252,1,
+ "The books are organized according to order on the bookshelf.",
+ "I try to take 1 book off carefully.",
+ "I can see something sticking out among the books."
+ )) {
+ case 1:
+ mes "[Neat Crew]";
+ mes "Ah, do not touch it!";
+ mes "Why do you keep messing it up after I clean up the room?!";
+ mes "Get out!";
+ close2;
+ warp "mal_in02",138,60;
+ end;
+ case 2:
+ mes "The books are organized according to order on the bookshelf.";
+ close;
+ case 3:
+ mes "This is a book which used to contain a piece of the painting.";
+ close;
+ }
+}
+
+mal_in02,133,98,0 script Dirty Bed#nya03 844,{
+ switch(callfunc(
+ "F_Mal_Picture",
+ 7253,1,
+ "This is a normal cabin for the crew.",
+ "My eyes kept straying over to old bed in corner of the room.",
+ "Something is hanging with furs below the bed."
+ )) {
+ case 1:
+ mes "[Scary Crew]";
+ mes "What are you doing here?";
+ mes "Do not disturb me, and go away.";
+ mes "Get out!";
+ close2;
+ warp "mal_in02",100,60;
+ end;
+ case 2:
+ mes "It's dirty and smells like fish.";
+ mes "There are a lot of furs from cats.";
+ close;
+ case 3:
+ mes "This is dirty bed where a piece of the painting was hidden.";
+ mes "There are a lot of furs from cats.";
+ close;
+ }
+}
+
+mal_in02,31,57,0 script Seashell#nya04 844,{
+ switch(callfunc(
+ "F_Mal_Picture",
+ 7254,0,
+ "This cabin is large and clean, and it seems to for the captain.",
+ "My eyes kept straying over to the seashell and conch for decoration in the corner of the room.",
+ "There is a rolled up paper in the conch."
+ )) {
+ case 2:
+ mes "There is a seashell decoration on a clean display cupboard.";
+ close;
+ case 3:
+ mes "This is the seashell where a piece of the painting was hidden.";
+ close;
+ }
+}
+
+mal_in02,114,56,0 script Ship Pillar#nya05 844,{
+ switch(callfunc(
+ "F_Mal_Picture",
+ 7255,1,
+ "This is one of pillars to bear out the ship.",
+ "It has many nail marks as it has been through many cats.",
+ "There is a folded piece of paper in the crack of the wooden wall."
+ )) {
+ case 1:
+ mes "[Picky Crew]";
+ mes "Is that you who scratched all the pillars in here?!";
+ mes "Meow~~~~!!";
+ mes "Get off from that pillar!";
+ close2;
+ warp "malangdo",170,160;
+ end;
+ case 2:
+ mes "I can see the trace of a scratch.";
+ mes "Pillars made from trees are originally good to hang, but scratched by nails.";
+ close;
+ case 3:
+ mes "I can see the crack where a piece of the painting was hidden.";
+ close;
+ }
+}
+
+mal_in02,139,30,0 script Ventilation Window#nya06 844,{
+ switch(callfunc(
+ "F_Mal_Picture",
+ 7256,0,
+ "This cabin is for the normal crew.",
+ "There are many ventilation windows on the floor in this room.",
+ "One of the windows opens with a clink, revealing a piece of paper."
+ )) {
+ case 2:
+ mes "There are windows for ventilation on the floor.";
+ mes "A cold wind comes from these windows.";
+ mes "Why are ventilation windows set up on the floor?";
+ close;
+ case 3:
+ mes "There are windows for ventilation on the floor.";
+ mes "A piece of the painting was hung in there.";
+ mes "Why are ventilation windows set up on the floor?";
+ close;
+ }
+}
+
+mal_in02,166,74,4 script Neat Crew#nyaong01 555,{
+ mes "[Neat Crew]";
+ mes "Please clean up your stuff by yourself.";
+ mes "Especially you guys getting dirty after we came to this island!";
+ mes "Please throw the trash into the trash can.";
+ next;
+ mes "[Neat Crew]";
+ mes "And you plucked every crop.";
+ mes "Hmph. Please, let's leave it in its natural state.";
+ next;
+ mes "[Neat Crew]";
+ mes "What are you looking at?";
+ mes "Will you mess up here too?";
+ mes "Meow?!";
+ close;
+}
+
+mal_in02,132,95,5 script Scary Crew#nyaong02 561,{
+ mes "[Scary Crew]";
+ mes "I try to be nice these days, and kids just take liberties with me.";
+ mes "Will you too?";
+ next;
+ mes "[Scary Crew]";
+ mes "They just come in and out, even the other person's room...";
+ mes "It causes harm for sure.";
+ close;
+}
+
+mal_in02,109,62,4 script Picky Crew#nyaong03 545,{
+ mes "[Picky Crew]";
+ mes "Do not run in the hall!";
+ mes "My fur falls out because of someone who";
+ mes "scratches everywhere!";
+ close;
+}
+
+// Archangel Wing Enchants :: enc_angel
+//============================================================
+malangdo,234,153,6 script Notice Board#mal 837,{
+ mes "^0000FFThere's a hastily written message on this bulletin board.^000000";
+ next;
+ mes "A fallen angel within will unlock a hidden enchantment to Archangel Wings.";
+ close;
+}
+
+mal_in01,15,16,3 script Fallen Angel#mal 403,{
+ disable_items;
+ if (checkweight(1201,1) == 0) {
+ mes "You are carrying too many items, please reduce them and come back!";
+ close;
+ }
+ if (MaxWeight - Weight < 10000) {
+ mes "You have overweight, please reduce it and come back!";
+ close;
+ }
+ if (getequipid(EQI_GARMENT) == 2573) {
+ if (Zeny >= 1000000)
+ set .@menu$, "Enchant Archangel Wing";
+ else
+ set .@menu$, "^999999You do not have enough zeny!^000000";
+ } else
+ set .@menu$, "^999999You have not equipped the Archangel Wing!^000000";
+ mes "[Fallen Angel]";
+ mes "You seem like a poor guy!";
+ next;
+ mes "[Fallen Angel]";
+ mes "If you have an Archangel Wing, I will enchant my capability into the useless 4th slot. Would you like me to do so?";
+ next;
+ switch(select("What is that?:"+.@menu$+":Enchant Initialization")) {
+ case 1:
+ switch(select("Stop speaking:What are you going to do?")) {
+ case 1:
+ mes "[Fallen Angel]";
+ mes "What did you say?";
+ close;
+ case 2:
+ mes "[Fallen Angel]";
+ mes "I can enchant my capability into your Archangel Wing if you pay 1,000,000 zeny. But you can't enchant it again without resetting it.";
+ next;
+ mes "[Fallen Angel]";
+ mes "The enchantment is dangerous, so ^ff0000the wing might be damaged^000000! Nevertheless, my good blessing will retain the ^0000ffcard and refine level^0000ff!";
+ close;
+ }
+ case 2:
+ if (Zeny < 1000000) {
+ mes "[Fallen Angel]";
+ mes "I can't do it if you can't pay!";
+ close;
+ }
+ mes "[Fallen Angel]";
+ mes "There are 2 important notices. First, the enchantment requires ^0000ff1,000,000 zeny^000000.";
+ next;
+ mes "[Fallen Angel]";
+ mes "Second, ^ff0000although the rate is not high, the Archangel Wing might be damaged^000000! This is very unlucky!";
+ mes "If you can accept these conditions, I will enchant the wing for you.";
+ next;
+ if(select("Let me consider...:I accept, let's enchant!") == 1) {
+ mes "[Fallen Angel]";
+ mes "Ok! Take your time to consider!";
+ close;
+ }
+ specialeffect2 EF_REPAIRWEAPON;
+ progressbar "ffff00",2;
+ if (getequipisequiped(EQI_GARMENT) == 0) {
+ mes "[Fallen Angel]";
+ mes "The Archangel Wing has been taken out!";
+ close;
+ }
+ if (getequipid(EQI_GARMENT) != 2573) {
+ mes "[Fallen Angel]";
+ mes "Don't take off the item!";
+ close;
+ }
+ if (getequipcardid(EQI_GARMENT,3)) {
+ mes "[Fallen Angel]";
+ mes "This Archangel Wing is enchanted! Please initialize it or bring another Archangel Wing for me!";
+ close;
+ }
+ set .@equip_refine, getequiprefinerycnt(EQI_GARMENT);
+ setarray .@equip_card[0], getequipcardid(EQI_GARMENT,0),getequipcardid(EQI_GARMENT,1),getequipcardid(EQI_GARMENT,2);
+
+ set .@i, rand(1,900);
+ if (.@i < 2) set .@enchant,4848; //Immuned1
+ else if (.@i < 3) set .@enchant,4849; //Cranial1
+ else if (.@i < 4) set .@enchant,4852; //Heal_Amount5
+ else if (.@i < 9) set .@enchant,4853; //S_Str
+ else if (.@i < 14) set .@enchant,4854; //S_Agi
+ else if (.@i < 19) set .@enchant,4855; //S_Vital
+ else if (.@i < 24) set .@enchant,4856; //S_Int
+ else if (.@i < 29) set .@enchant,4857; //S_Dex
+ else if (.@i < 34) set .@enchant,4858; //S_Luck
+ else if (.@i < 39) set .@enchant,4851; //Heal_Amount4
+ else if (.@i < 49) set .@enchant,4850; //Heal_Amount3
+ else if (.@i < 74) set .@enchant,4760; //Matk1
+ else if (.@i < 84) set .@enchant,4761; //Matk2
+ else if (.@i < 109) set .@enchant,4817; //Sharp2
+ else if (.@i < 119) set .@enchant,4816; //Sharp3
+ else if (.@i < 144) set .@enchant,4814; //Spell2
+ else if (.@i < 154) set .@enchant,4813; //Spell3
+ else if (.@i < 179) set .@enchant,4833; //Expert_Archer2
+ else if (.@i < 189) set .@enchant,4834; //Expert_Archer3
+ else if (.@i < 214) set .@enchant,4810; //Fighting_Spirit2
+ else if (.@i < 224) set .@enchant,4809; //Fighting_Spirit3
+ else if (.@i < 259) set .@enchant,4701; //Strength2
+ else if (.@i < 294) set .@enchant,4731; //Agility2
+ else if (.@i < 329) set .@enchant,4721; //Dexterity2
+ else if (.@i < 364) set .@enchant,4741; //Vitality2
+ else if (.@i < 399) set .@enchant,4751; //Luck2
+ else if (.@i < 434) set .@enchant,4711; //Inteligence2
+ else if (.@i < 504) set .@enchant,4700; //Strength1
+ else if (.@i < 574) set .@enchant,4730; //Agility1
+ else if (.@i < 644) set .@enchant,4720; //Dexterity1
+ else if (.@i < 714) set .@enchant,4740; //Vitality1
+ else if (.@i < 784) set .@enchant,4750; //Luck1
+ else if (.@i < 854) set .@enchant,4710; //Inteligence1
+ else set .@enchant,0;
+
+ set Zeny, Zeny - 1000000;
+ delequip EQI_GARMENT;
+ if (.@enchant == 0) {
+ mes "[Fallen Angel]";
+ mes "Be merciful to the survivor,";
+ mes "Send flowers to the dead.";
+ next;
+ mes "[Fallen Angel]";
+ mes "Help for justice,";
+ mes "Elimination of evil.";
+ next;
+ mes "[Fallen Angel]";
+ mes "But the important point is... the Archangel Wing is damaged!";
+ close;
+ }
+ getitem2 2573,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@enchant; //Archangel_Wing
+ if (.@i < 4)
+ announce strcharinfo(0)+" has enchanted Archangel Wing with amazing capability!",bc_all,0xFF0000,FW_NORMAL,10;
+ mes "[Fallen Angel]";
+ mes "Take it!";
+ mes "I believe that you will become the dominator of the new world!";
+ close;
+ case 3:
+ mes "[Fallen Angel]";
+ mes "Initialization requires ^0000ff3 units of Silvervine Fruit^000000. The wing will not be damaged except for the enchanted capability.";
+ next;
+ if(select("Let me consider...:Ok, I want initialize it.") == 1) {
+ mes "[Fallen Angel]";
+ mes "Ok! Take your time to consider!";
+ close;
+ }
+ specialeffect2 EF_REPAIRWEAPON;
+ progressbar "ffff00",2;
+ if (getequipisequiped(EQI_GARMENT) == 0) {
+ mes "[Fallen Angel]";
+ mes "The Archangel Wing has been taken out!";
+ close;
+ }
+ if (getequipid(EQI_GARMENT) != 2573) {
+ mes "[Fallen Angel]";
+ mes "Oh... you have unequipped the Archangel Wing!";
+ close;
+ }
+ if (countitem(6417) < 3) {
+ mes "[Fallen Angel]";
+ mes "I can't do it if you can't pay!";
+ close;
+ }
+ if (getequipcardid(EQI_GARMENT,3) < 4700) { // Armor Enchant System
+ mes "[Fallen Angel]";
+ mes "This equipment has not been enchanted, please check it again!";
+ close;
+ }
+ set .@equip_refine, getequiprefinerycnt(EQI_GARMENT);
+ setarray .@equip_card[0], getequipcardid(EQI_GARMENT,0),getequipcardid(EQI_GARMENT,1),getequipcardid(EQI_GARMENT,2);
+ delequip EQI_GARMENT;
+ getitem2 2573,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],0; //Archangel_Wing
+ mes "[Fallen Angel]";
+ mes "Take it!";
+ close;
+ }
+}
diff --git a/sql-files/item_db.sql b/sql-files/item_db.sql
index 9b0c8fff4..7271e9d0d 100644
--- a/sql-files/item_db.sql
+++ b/sql-files/item_db.sql
@@ -4796,7 +4796,7 @@ REPLACE INTO `item_db` VALUES (12216,'Inc_Agi_10_Scroll','LV10 Agil Scroll',2,2,
REPLACE INTO `item_db` VALUES (12217,'Aspersio_5_Scroll','LV5 Aspersio Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'if(countitem(523)>0) { skilleffect "PR_ASPERSIO",0; sc_start SC_ASPERSIO,180000,5; delitem 523,1; }',NULL,NULL);
REPLACE INTO `item_db` VALUES (12218,'Assumptio_5_Scroll','LV5 Assumptio Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'skilleffect "HP_ASSUMPTIO",0; sc_start SC_ASSUMPTIO,100000,5;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12219,'Wind_Walk_10_Scroll','LV10 Wind Walker Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'skilleffect "SN_WINDWALK",0; sc_start SC_WINDWALK,250000,5;',NULL,NULL);
-REPLACE INTO `item_db` VALUES (12220,'Adrenaline_Scroll','LV5 Adrenaline Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'if(getiteminfo(getequipid(EQI_HAND_R),14)==6||getiteminfo(getequipid(EQI_HAND_R),14)==7) { skilleffect "BS_ADRENALINE",0; sc_start SC_ADRENALINE,150000,5; }',NULL,NULL);
+REPLACE INTO `item_db` VALUES (12220,'Adrenaline_Scroll','LV5 Adrenaline Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'set .@type,getiteminfo(getequipid(EQI_HAND_R),11); if (.@type==6||.@type==7||.@type==8) { skilleffect "BS_ADRENALINE",0; sc_start SC_ADRENALINE,150000,5; }',NULL,NULL);
REPLACE INTO `item_db` VALUES (12221,'Megaphone_','Megaphone',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'input @megaphone$; announce strcharinfo(0) + ": " + @megaphone$,bc_all,0xFF0000; end;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12225,'Sweet_Candy_Striper','Sweet Candy Cane',2,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'pet 1245;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12226,'Examination1','Examination 1',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_SpeedUp0,5400000,0; percentheal 100,100; sc_start SC_STRFOOD,5400000,10; sc_start SC_DEXFOOD,5400000,5; sc_start SC_ATKPOTION,5400000,22; sc_start SC_MATKFOOD,5400000,15;',NULL,NULL);
@@ -4805,7 +4805,7 @@ REPLACE INTO `item_db` VALUES (12228,'Examination3','Examination 3',0,20,NULL,50
REPLACE INTO `item_db` VALUES (12229,'Examination4','Examination 4',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_SpeedUp0,5400000,0; percentheal 100,100; sc_start SC_STRFOOD,5400000,3; sc_start SC_AGIFOOD,5400000,5; sc_start SC_VITFOOD,5400000,10; sc_start SC_MATKFOOD,5400000,52;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12230,'Examination5','Examination 5',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_SpeedUp0,5400000,0; percentheal 100,100; sc_start SC_INTFOOD,5400000,3; sc_start SC_DEXFOOD,5400000,12; sc_start SC_ATKPOTION,5400000,20; sc_start SC_MATKFOOD,5400000,20;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12231,'Examination6','Examination 6',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 100,100; sc_start SC_SpeedUp0,5400000,0; sc_start SC_STRFOOD,5400000,6; sc_start SC_DEXFOOD,5400000,6; sc_start SC_AGIFOOD,5400000,6; sc_start SC_INTFOOD,5400000,6; sc_start SC_VITFOOD,5400000,6; sc_start SC_LUKFOOD,5400000,6; sc_start SC_ATKPOTION,5400000,24; sc_start SC_MATKFOOD,5400000,24;',NULL,NULL);
-REPLACE INTO `item_db` VALUES (12232,'Gingerbread','Ginger Bread',2,20,NULL,150,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db` VALUES (12232,'Gingerbread','Ginger Bread',2,20,NULL,150,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_ASPDPOTION1,900000,0; sc_start SC_SpeedUp0,900000,0;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12233,'Kvass','Kvass',0,20,NULL,200,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 100,100;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12234,'Cacao99','Fierce Cacao 99%',0,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 25,0;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12235,'Strawberry_Choco','Chocolate Strawberry',2,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 0,5; skilleffect "AL_BLESSING",0; sc_start SC_BLESSING,240000,10;',NULL,NULL);
@@ -4987,7 +4987,7 @@ REPLACE INTO `item_db` VALUES (12410,'Spareribs_H','Spareribs H',2,NULL,NULL,0,N
REPLACE INTO `item_db` VALUES (12411,'HE_Battle_Manual','HE Battle Manual',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_EXPBOOST,900000,200;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12412,'HE_Bubble_Gum','HE Bubble Gum',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_ITEMBOOST,900000,300;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12413,'PCBang_Coupon_Box2','PCBang Coupon Box2',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db` VALUES (12414,'Guarana_Candy','Guarana Candy',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_INCASPDRATE,1800000,10; sc_start SC_INCREASEAGI,140000,5; skilleffect "AL_INCAGI",0;',NULL,NULL);
+REPLACE INTO `item_db` VALUES (12414,'Guarana_Candy','Guarana Candy',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_ASPDPOTION0,1800000,0; sc_start SC_INCREASEAGI,140000,5; skilleffect "AL_INCAGI",0;',NULL,NULL);
REPLACE INTO `item_db` VALUES (12415,'Siege_Teleport_Scroll2','Siege Teleport Scroll2',2,NULL,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db` VALUES (12416,'LUcky_Egg_C3','LUcky Egg C3',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db` VALUES (12417,'Boost500','Boost500',2,100,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql
index 44c6102fe..a674667ab 100644
--- a/sql-files/item_db_re.sql
+++ b/sql-files/item_db_re.sql
@@ -585,7 +585,7 @@ REPLACE INTO `item_db_re` VALUES (1194,'F_Executioner_C','Executioner',4,2,NULL,
REPLACE INTO `item_db_re` VALUES (1195,'E_Executioner_C','Executioner',4,2,NULL,0,'190',NULL,1,NULL,0x00004082,7,2,34,4,NULL,NULL,3,'bonus bAtkEle,Ele_Dark;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (1196,'Chrome_Twohand_Sword','Chrome Two-Handed Sword',4,20,NULL,400,'280',NULL,1,NULL,0x00004082,7,2,34,3,'110',1,3,'bonus bUnbreakableWeapon,0; bonus bAgi,3; bonus bMaxHPRate,-10;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (1197,'P_Slayer3','Eden Slayer III',4,NULL,NULL,0,'200',NULL,1,NULL,0x00004082,7,2,34,3,'60',NULL,3,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (1198,'Cutlass','Cutlass',4,NULL,NULL,0,'220',NULL,3,NULL,0x00004082,7,2,34,1,'50',NULL,3,'bonus bUnbreakableWeapon,0; bonus bCritical,20; bonus bCritAtkRate,50; if(BaseLevel>99) { bonus bBaseAtk,50; }',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (1198,'Hairtail','Cutlass',4,NULL,NULL,0,'220',NULL,3,NULL,0x00004082,7,2,34,1,'50',NULL,3,'bonus bUnbreakableWeapon,0; bonus bCritical,20; bonus bCritAtkRate,50; if(BaseLevel>99) { bonus bBaseAtk,50; }',NULL,NULL);
# Daggers
REPLACE INTO `item_db_re` VALUES (1201,'Knife','Knife',4,50,NULL,400,'17',NULL,1,3,0xFE9F7EEF,7,2,2,1,'1',1,1,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (1202,'Knife_','Knife',4,50,NULL,400,'17',NULL,1,4,0xFE9F7EEF,7,2,2,1,'1',1,1,NULL,NULL,NULL);
@@ -1248,12 +1248,12 @@ REPLACE INTO `item_db_re` VALUES (2162,'Bible_Of_Promise2','Bible Of Promise Vol
#2165,
#2166,
#2167,
-REPLACE INTO `item_db_re` VALUES (2168,'Immune_Shield','Immune Shield',5,20,NULL,700,NULL,55,NULL,1,0xFFFFFFFF,7,2,32,NULL,'1',1,1,'if(getrefine()>=5){ bonus2 bSubEle,Ele_Neutral,getrefine()-4; } if(getrefine()>=7){ bonus2 bSubEle,Ele_Neutral,5; } if(getrefine()>=9){ bonus2 bSubEle,Ele_Water,10; bonus2 bSubEle,Ele_Wind,10; bonus2 bSubEle,Ele_Earth,10; bonus2 bSubEle,Ele_Fire,10; } if(getrefine()>=13){ bonus2 bSubEle,Ele_Neutral,12-getrefine(); }',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2169,'Kalasag','Kalasag',5,20,NULL,400,NULL,40,NULL,NULL,0xFFFFFFFF,7,2,32,NULL,'1',1,1,'bonus2 bSubRace,RC_Boss,getrefine()/3;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2170,'Bayani_Kalasag','Bayani Kalasag',5,20,NULL,400,NULL,40,NULL,1,0xFFFFFFFF,7,2,32,NULL,'1',1,1,'bonus2 bSubRace,RC_Boss,getrefine()/3;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2171,'Fox_Wrist_Guard','Fox Wrist Guard',5,40000,NULL,200,NULL,45,NULL,1,0x02000000,7,2,32,NULL,'100',1,1,'bonus bFlee,5;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2172,'Wolf_Wrist_Guard','Wolf Wrist Guard',5,45000,NULL,250,NULL,70,NULL,1,0x02000000,7,2,32,NULL,'100',1,1,'autobonus "{bonus bBaseAtk,100; bonus bFlee,-50;}",10,5000,BF_WEAPON,"{specialeffect2 EF_ENHANCE;}";',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2173,'Crescent_Wrist_Guard','Crescent Wrist Guard',5,45000,NULL,250,NULL,45,NULL,1,0x02000000,7,2,32,NULL,'100',1,1,'bonus bDelayRate,-2;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2168,'Immuned_Shield','Immune Shield',5,20,NULL,700,NULL,55,NULL,1,0xFFFFFFFF,7,2,32,NULL,'1',1,1,'if(getrefine()>=5){ bonus2 bSubEle,Ele_Neutral,getrefine()-4; } if(getrefine()>=7){ bonus2 bSubEle,Ele_Neutral,5; } if(getrefine()>=9){ bonus2 bSubEle,Ele_Water,10; bonus2 bSubEle,Ele_Wind,10; bonus2 bSubEle,Ele_Earth,10; bonus2 bSubEle,Ele_Fire,10; } if(getrefine()>=13){ bonus2 bSubEle,Ele_Neutral,12-getrefine(); }',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2169,'Kalasak','Kalasag',5,20,NULL,400,NULL,40,NULL,NULL,0xFFFFFFFF,7,2,32,NULL,'1',1,1,'bonus2 bSubRace,RC_Boss,getrefine()/3;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2170,'Bayani_Kalasak','Bayani Kalasag',5,20,NULL,400,NULL,40,NULL,1,0xFFFFFFFF,7,2,32,NULL,'1',1,1,'bonus2 bSubRace,RC_Boss,getrefine()/3;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2171,'Fox_Armguard','Fox Wrist Guard',5,40000,NULL,200,NULL,45,NULL,1,0x02000000,7,2,32,NULL,'100',1,1,'bonus bFlee,5;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2172,'Wolf_Armguard','Wolf Wrist Guard',5,45000,NULL,250,NULL,70,NULL,1,0x02000000,7,2,32,NULL,'100',1,1,'autobonus "{bonus bBaseAtk,100; bonus bFlee,-50;}",10,5000,BF_WEAPON,"{specialeffect2 EF_ENHANCE;}";',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2173,'Crescent_Armguard','Crescent Wrist Guard',5,45000,NULL,250,NULL,45,NULL,1,0x02000000,7,2,32,NULL,'100',1,1,'bonus bDelayRate,-2;',NULL,NULL);
# GM Shield
REPLACE INTO `item_db_re` VALUES (2199,'Ahura_Mazda','Ahura Mazdah',5,1,NULL,10,NULL,10000,NULL,NULL,0xFFFFFFFF,7,2,32,NULL,'1',1,0,'bonus bAllStats,50; bonus bMdef,99; bonus bShortWeaponDamageReturn,100; bonus2 bSubRace,RC_DemiHuman,95; skill "CR_FULLPROTECTION",5; skill "WZ_ESTIMATION",1; skill "ST_FULLSTRIP",5; skill "HW_MAGICPOWER", 10; bonus bMaxHPRate,200; bonus bNoKnockback,0; bonus bDelayRate,-20; bonus bSpeedRate,25; bonus bIntravision,0;','sc_start4 SC_ENDURE,60000,10,0,0,1;','sc_end SC_ENDURE;');
# Headgears
@@ -1534,15 +1534,15 @@ REPLACE INTO `item_db_re` VALUES (2471,'Mercy_Shoes','Mercy Shoes',5,20,NULL,300
REPLACE INTO `item_db_re` VALUES (2472,'Judgement_Shoes','Judgement Shoes',5,20,NULL,300,NULL,12,NULL,NULL,0x00000100,7,2,64,NULL,'100',1,0,'bonus bMaxSP,150; bonus2 bSkillAtk,"AB_JUDEX",30;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2473,'Para_Team_Boots4','Eden Team Boots IV',5,NULL,NULL,0,NULL,20,NULL,NULL,0xFFFFFFFF,7,2,64,NULL,'60',NULL,0,'bonus bAgi,1; bonus bVit,1; bonus bHPrecovRate,28; bonus bSPrecovRate,12;',NULL,NULL);
#2474,
-REPLACE INTO `item_db_re` VALUES (2475,'Urj_Greaves','Urj Greaves',5,20,NULL,900,NULL,32,NULL,1,0x00000080,8,2,64,NULL,'100',1,0,'bonus bMaxSP,40; if(getequiprefinerycnt(EQI_SHOES)>7) bonus bMaxHPRate,getequiprefinerycnt(EQI_SHOES)-7;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2476,'Pertz_Greaves','Pertz Greaves',5,20,NULL,900,NULL,32,NULL,1,0x00000080,8,2,64,NULL,'100',1,0,'bonus bMaxSP,40; bonus bAgi,-7+(getequiprefinerycnt(EQI_SHOES)>8)?8:getequiprefinerycnt(EQI_SHOES);',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2477,'Sabath_Shoes','Sabath Shoes',5,20,NULL,400,NULL,18,NULL,1,0x00001000,7,2,64,NULL,'100',1,0,'bonus bMaxSP,30; bonus bLuk,3;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2478,'Nabeu\'s_Shoes','Nabeu\'s Shoes',5,20,NULL,400,NULL,18,NULL,1,0x00001000,7,2,64,NULL,'100',1,0,'bonus bFlee,3; bonus bInt,2;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2475,'Ur_Greave','Urj Greaves',5,20,NULL,900,NULL,32,NULL,1,0x00000080,8,2,64,NULL,'100',1,0,'bonus bMaxSP,40; if(getequiprefinerycnt(EQI_SHOES)>7) bonus bMaxHPRate,getequiprefinerycnt(EQI_SHOES)-7;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2476,'Peuz_Greave','Pertz Greaves',5,20,NULL,900,NULL,32,NULL,1,0x00000080,8,2,64,NULL,'100',1,0,'bonus bMaxSP,40; bonus bAgi,-7+(getequiprefinerycnt(EQI_SHOES)>8)?8:getequiprefinerycnt(EQI_SHOES);',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2477,'Sabah_Shoes','Sabath Shoes',5,20,NULL,400,NULL,18,NULL,1,0x00001000,7,2,64,NULL,'100',1,0,'bonus bMaxSP,30; bonus bLuk,3;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2478,'Nab_Shoes','Nabeu\'s Shoes',5,20,NULL,400,NULL,18,NULL,1,0x00001000,7,2,64,NULL,'100',1,0,'bonus bFlee,3; bonus bInt,2;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2479,'White_Wing_Boots','White Wing Boots',5,20,NULL,400,NULL,18,NULL,1,0x00000800,7,2,64,NULL,'100',1,0,'bonus bAgi,2;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2480,'Black_Wing_Boots','Black Wing Boots',5,20,NULL,400,NULL,18,NULL,1,0x00000800,8,2,64,NULL,'100',1,0,'bonus bInt,2; bonus bMaxSPRate,5;',NULL,NULL);
#2481,
#2482,
-REPLACE INTO `item_db_re` VALUES (2483,'Siege_Greaves','Siege Greaves',5,NULL,NULL,750,NULL,30,NULL,1,0x006444A2,7,2,64,NULL,'95',1,0,'bonus bMdef,1; bonus2 bSubRace,RC_DemiHuman,2;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2483,'Siege_Greave','Siege Greaves',5,NULL,NULL,750,NULL,30,NULL,1,0x006444A2,7,2,64,NULL,'95',1,0,'bonus bMdef,1; bonus2 bSubRace,RC_DemiHuman,2;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2484,'Siege_Boots','Siege Boots',5,NULL,NULL,500,NULL,20,NULL,1,0x036E5CEA,7,2,64,NULL,'95',1,0,'bonus bMdef,5; bonus2 bSubRace,RC_DemiHuman,1;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2485,'Siege_Shoes','Siege Shoes',5,NULL,NULL,350,NULL,15,NULL,1,0x00818315,7,2,64,NULL,'95',1,0,'bonus bMdef,10; bonus2 bSubRace,RC_DemiHuman,1;',NULL,NULL);
#2486,
@@ -1550,8 +1550,8 @@ REPLACE INTO `item_db_re` VALUES (2485,'Siege_Shoes','Siege Shoes',5,NULL,NULL,3
#2488,
#2489,
#2490,
-REPLACE INTO `item_db_re` VALUES (2491,'Nightmare_Bangungot_Boots','Nightmare Bangungot Boots',5,20,NULL,600,NULL,10,NULL,NULL,0xFFFFFFFF,7,2,64,NULL,'1',1,0,'bonus bMdef,getrefine(); if(getrefine()>=14){ bonus bSpeedRate,25; }',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2492,'Bayani_Nightmare_Bangungot_Boots','Bayani Nightmare Bangungot Boots',5,20,NULL,600,NULL,10,NULL,1,0xFFFFFFFF,7,2,64,NULL,'1',1,0,'bonus bMdef,getrefine(); if(getrefine()>=12){ bonus bSpeedRate,25; }',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2491,'Bangungot_Boots','Nightmare Bangungot Boots',5,20,NULL,600,NULL,10,NULL,NULL,0xFFFFFFFF,7,2,64,NULL,'1',1,0,'bonus bMdef,getrefine(); if(getrefine()>=14){ bonus bSpeedRate,25; }',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2492,'Bayani_Bangungot_Boots','Bayani Nightmare Bangungot Boots',5,20,NULL,600,NULL,10,NULL,1,0xFFFFFFFF,7,2,64,NULL,'1',1,0,'bonus bMdef,getrefine(); if(getrefine()>=12){ bonus bSpeedRate,25; }',NULL,NULL);
# Garments
# ===================================================================
REPLACE INTO `item_db_re` VALUES (2501,'Hood','Hood',5,1000,NULL,200,NULL,4,NULL,NULL,0xFFFFFFFF,7,2,4,NULL,NULL,1,0,NULL,NULL,NULL);
@@ -1626,7 +1626,7 @@ REPLACE INTO `item_db_re` VALUES (2569,'Mercy_Shawl','Mercy Shawl',5,20,NULL,400
REPLACE INTO `item_db_re` VALUES (2570,'Judgement_Shawl','Judgement Shawl',5,20,NULL,400,NULL,12,NULL,NULL,0x00000100,7,2,4,NULL,'100',1,0,'bonus bFlee,5; bonus3 bAutoSpellWhenHit,"AB_ORATIO",getskilllv("AB_ORATIO") ? getskilllv("AB_ORATIO") : 2,10;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2571,'Para_Team_Manteau2','Eden Team Manteau II',5,NULL,NULL,0,NULL,18,NULL,NULL,0xFFFFFFFF,7,2,4,NULL,'60',NULL,0,'bonus bFlee,12; bonus2 bSubEle,Ele_Neutral,10;',NULL,NULL);
#2572,
-REPLACE INTO `item_db_re` VALUES (2573,'Archangel_Wings','Archangel Wings',5,NULL,NULL,200,NULL,18,NULL,1,0xFFFFFFFF,7,2,4,NULL,NULL,1,1,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2573,'Archangel_Wing','Archangel Wings',5,NULL,NULL,200,NULL,18,NULL,1,0xFFFFFFFF,7,2,4,NULL,NULL,1,1,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2574,'Urj_Manteau','Urj Manteau',5,20,NULL,600,NULL,20,NULL,NULL,0x00000080,8,2,4,NULL,'100',1,0,'bonus bMaxHPRate,2; bonus2 bSubEle,Ele_Neutral,10;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2575,'Pertz_Manteau','Pertz Manteau',5,20,NULL,600,NULL,16,NULL,NULL,0x00000080,8,2,4,NULL,'100',1,0,'bonus bFlee,10; bonus bCritical,10;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2576,'Adventurer\'s_Backpack','Adventurer\'s Backpack',5,NULL,NULL,200,NULL,20,NULL,1,0xFFFFFFFF,7,2,4,NULL,NULL,1,2,'skill "BS_GREED",1; if(getrefine()>6) { if(readparam(bStr)>=90){ bonus bBaseAtk,20; } if(readparam(bInt)>=90){ bonus bMatk,30; } if(readparam(bVit)>=90){ bonus2 bSubEle,Ele_Neutral,10; } if(readparam(bAgi)>=90){ bonus bAspdRate,8; } if(readparam(bDex)>=90){ bonus bLongAtkRate,5; } if(readparam(bLuk)>=90){ bonus bCritAtkRate,10; } } if(getrefine()>8) { if(readparam(bStr)>=90){ bonus bBaseAtk,10; } if(readparam(bInt)>=90){ bonus bMatk,20; } if(readparam(bVit)>=90){ bonus2 bSubEle,Ele_Neutral,5; } if(readparam(bAgi)>=90){ bonus bAspd,1; } if(readparam(bDex)>=90){ bonus bLongAtkRate,5; } if(readparam(bLuk)>=90){ bonus bCritAtkRate,5; } }',NULL,NULL);
@@ -1913,11 +1913,14 @@ REPLACE INTO `item_db_re` VALUES (2864,'Light_Of_Cure','Liht Of Cure',5,20,NULL,
REPLACE INTO `item_db_re` VALUES (2865,'Seal_Of_Cathedral','Seal Of Cathedral',5,20,NULL,0,NULL,NULL,NULL,NULL,0x00000100,7,2,136,NULL,'110',NULL,0,'bonus bInt,2; bonus bHealPower,2;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (2866,'Ring_Of_Archbishop','Ring Of Archbishop',5,20,NULL,0,NULL,NULL,NULL,NULL,0x00000100,7,2,136,NULL,'110',NULL,0,'bonus bDex,2; bonus bHealPower,2;',NULL,NULL);
#
-REPLACE INTO `item_db_re` VALUES (2883,'Urj_Seal','Urj Seal',5,20,NULL,200,NULL,4,NULL,1,0x00000080,8,2,136,NULL,'100',NULL,0,'bonus bMaxHPrate,2; bonus2 bSkillUseSP,"LK_SPIRALPIERCE",5; bonus2 bSkillUseSP,"RK_HUNDREDSPEAR",5;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2884,'Pertz_Seal','Pertz Seal',5,20,NULL,200,NULL,3,NULL,1,0x00000080,8,2,136,NULL,'100',NULL,0,'bonus bBaseAtk,20; bonus bMaxSP,20;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2872,'G_Honor_Certificate','G Honor Certificate',5,NULL,NULL,0,NULL,2,NULL,NULL,0xFFFFFFFF,7,2,136,NULL,'1',NULL,0,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2873,'Cat_Hand_Glove','Cat Hand Glove',5,20,NULL,100,NULL,2,NULL,1,0xFFFFFFFF,7,2,136,NULL,'1',NULL,0,'bonus bAgi,1; bonus bVit,1; bonus bDex,1; bonus bLuk,1;',NULL,NULL);
+#
+REPLACE INTO `item_db_re` VALUES (2883,'Ur_Seal','Urj Seal',5,20,NULL,200,NULL,4,NULL,1,0x00000080,8,2,136,NULL,'100',NULL,0,'bonus bMaxHPrate,2; bonus2 bSkillUseSP,"LK_SPIRALPIERCE",5; bonus2 bSkillUseSP,"RK_HUNDREDSPEAR",5;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2884,'Peuz_Seal','Pertz Seal',5,20,NULL,200,NULL,3,NULL,1,0x00000080,8,2,136,NULL,'100',NULL,0,'bonus bBaseAtk,20; bonus bMaxSP,20;',NULL,NULL);
#2885,
-REPLACE INTO `item_db_re` VALUES (2886,'Sabath_Seal','Sabath Seal',5,20,NULL,100,NULL,NULL,NULL,NULL,0x00001000,7,2,136,NULL,'100',NULL,0,'bonus bCritical,3;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2887,'Nabeu\'s_Seal','Nabeu\'s Seal',5,20,NULL,100,NULL,NULL,NULL,NULL,0x00001000,7,2,136,NULL,'100',NULL,0,'bonus bBaseAtk,10; bonus bMatk,20;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2886,'Sabah_Ring','Sabath Seal',5,20,NULL,100,NULL,NULL,NULL,NULL,0x00001000,7,2,136,NULL,'100',NULL,0,'bonus bCritical,3;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2887,'Nab_Ring','Nabeu\'s Seal',5,20,NULL,100,NULL,NULL,NULL,NULL,0x00001000,7,2,136,NULL,'100',NULL,0,'bonus bBaseAtk,10; bonus bMatk,20;',NULL,NULL);
#2888,
#2889,
REPLACE INTO `item_db_re` VALUES (2890,'White_Wing_Brooch','White Wing Brooch',5,20,NULL,100,NULL,NULL,NULL,NULL,0x00000800,7,2,136,NULL,'100',NULL,0,'bonus bDex,2; bonus bLongAtkRate,3;',NULL,NULL);
@@ -1934,8 +1937,8 @@ REPLACE INTO `item_db_re` VALUES (2899,'Sound_Amplification_Device','Sound Ampli
REPLACE INTO `item_db_re` VALUES (2907,'Bawaya_Symbol_Tattoo','Bawaya Symbol Tattoo',5,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,136,NULL,'1',NULL,0,'bonus bMatkRate,7; bonus bFixedCastrate,-7;',NULL,NULL);
#2908,
#2909,
-REPLACE INTO `item_db_re` VALUES (2910,'Bakunawa_Symbol_Tattoo','Bakunawa Symbol Tattoo',5,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,136,NULL,'1',NULL,0,'bonus2 bAddRace,RC_NonBoss,7; bonus2 bAddRace,RC_Boss,7; bonus bAspdRate,10;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (2911,'Bangungot_Symbol_Tattoo','Bangungot Symbol Tattoo',5,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,136,NULL,'1',NULL,0,'bonus bHealPower,4; bonus bHealPower2,7;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2910,'Bakonawa_Tattoo','Bakunawa Symbol Tattoo',5,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,136,NULL,'1',NULL,0,'bonus2 bAddRace,RC_NonBoss,7; bonus2 bAddRace,RC_Boss,7; bonus bAspdRate,10;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (2911,'Bangungot_Tattoo','Bangungot Symbol Tattoo',5,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,136,NULL,'1',NULL,0,'bonus bHealPower,4; bonus bHealPower2,7;',NULL,NULL);
# Cards
# ===================================================================
REPLACE INTO `item_db_re` VALUES (4001,'Poring_Card','Poring Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,16,NULL,NULL,NULL,NULL,'bonus bLuk,2; bonus bFlee2,1;',NULL,NULL);
@@ -3852,7 +3855,7 @@ REPLACE INTO `item_db_re` VALUES (6341,'Fade_Notation_Red','Fade Notation Red',3
REPLACE INTO `item_db_re` VALUES (6342,'Fade_Notation_Purple','Fade Notation Purple',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6343,'Fade_Notation_Blue','Fade Notation Blue',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6344,'Muscle_Story','Muscle Story',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6345,'Love_Ball','Love Ball',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6345,'Love_Ball','Love Lump',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6346,'Seagate_Mark','Seagate Mark',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6347,'Bless_Word_Paper1','Bless Word Paper',3,4020,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6348,'Bless_Word_Paper2','Bless Word Paper',3,4020,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -3895,43 +3898,50 @@ REPLACE INTO `item_db_re` VALUES (6389,'Puddle_R_Sample','Pool Sample',3,20,NULL
REPLACE INTO `item_db_re` VALUES (6390,'Small_Pocket','Small Pocket',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6391,'Splendid_Supply_Kit','Splendid Supply Kit',3,20,NULL,2000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6392,'Bradium_Box','Bradium Box',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6393,'Round_Feather','Round Feather',3,524,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6394,'Golden_Feather','Golden Feather',3,486,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6395,'Angel_Magic_Power','Angel Magic Power',3,614,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6393,'Round_Feather','Round Feather',3,525,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6394,'Golden_Feather','Golden Feather',3,487,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6395,'Angel_Magic_Power','Angel Magic Power',3,615,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6396,'Auger_Of_Spirit','Auger Of Spirit',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6401,'Palm_Oil','Palm_Oil',3,20,NULL,500,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6402,'Coconut_Oil','Coconut_Oil',3,20,NULL,50,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6403,'Comodo_Leather','Comodo Leather',3,4,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6404,'Kris_Hilt','Kris Hilt',3,20,NULL,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6405,'Cendrawasih_Feather','Cendrawasih Feather',3,2,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6406,'Shining_Cendrawasih_Feather','Shining Cendrawasih Feather',3,10,NULL,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6407,'Raw_Crystal_Stone_Fragment','Raw Crystal Stone Fragment',3,820,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6408,'Raw_Crystal_Stone','Raw Crystal Stone',3,820,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6409,'Raw_Crystal_Stone_Mass','Raw Crystal Stone Mass',3,820,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
+REPLACE INTO `item_db_re` VALUES (6397,'PR_Team_Ticket','PR Team Ticket',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6398,'Develop_Team_Ticket','Develop Team Ticket',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6399,'Marketing_Team_Ticket','Marketing Team Ticket',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6400,'Operating_Team_Ticket','Operating Team Ticket',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6401,'Palm_O','Palm Oil',3,NULL,NULL,500,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6402,'Oil_Palm_F','Palm Oil Fruit',3,NULL,NULL,50,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6403,'Comodo_L','Comodo Leather',3,5,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6404,'Caress_H','Keris Hilt',3,NULL,NULL,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6405,'Cendrawasih_F','Cendrawasih Feather',3,3,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6406,'Cendrawasih_SF','Shining Cendrawasih Feather',3,10,NULL,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6407,'Sang_Stone_Fragment','Raw Crystal Stone Fragment',3,10,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6408,'Sang_Stone','Raw Crystal Stone',3,10,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6409,'Sang_Stone_Mass','Raw Crystal Stone Mass',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6410,'Idul_Fitri_Card','Idul Fitri Card',3,10,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6411,'Ripe_Watermelon','Ripe Watermelon',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
+REPLACE INTO `item_db_re` VALUES (6412,'Special_Medal','Special Medal',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6413,'New_Insurance','New Insurance',3,2,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6414,'Ragunta_Card','Ragunta Card',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
+REPLACE INTO `item_db_re` VALUES (6415,'Strange_Embryo','Strange Embryo',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6416,'Pet_Exchange','Pet Exchange',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6417,'Garderie_Fruit','Garderie Fruit',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6418,'A_Grade_Coin','A Grade Coin',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6419,'B_Grade_Coin','B Grade Coin',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6420,'C_Grade_Coin','C Grade Coin',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6421,'D_Grade_Coin','D Grade Coin',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6422,'E_Grade_Coin','E Grade Coin',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6423,'Sea_God\'s_Wrath','Sea God\'s Wrath',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6426,'Bad_Canned_Food','Bad Canned Food',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6428,'Adventure_Card_A','Adventure Card A',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6429,'Adventure_Card_B','Adventure Card B',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6430,'Figure_Sculpture','Figure Sculpture',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6431,'Pail','Pail',3,20,NULL,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6433,'Cleaning_Brush','Cleaning Brush',3,20,NULL,300,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6436,'Sea_God\'s_Call','Sea God\'s Call',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6423,'Anger_Seagod','Sea God\'s Wrath',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6424,'Halloween_Fragment','Spirit Piece',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6425,'Halloween_Certificate','Halloween Certificate',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6426,'Bad_Can','Bad Canned Food',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6427,'Bad_Can_Sack','Bad Canned Food Sack',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6428,'Bravery_Card_A','Adventure Card A',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6429,'Bravery_Card_B','Adventure Card B',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6430,'Picture_Piece','Figure Sculpture',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6431,'Bucket','Pail',3,NULL,NULL,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6432,'Full_Bucket','Full Pail',3,NULL,NULL,3000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6433,'Clean_Brush','Cleaning Brush',3,NULL,NULL,300,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6434,'Fix_Kit','Fix Kit',3,NULL,NULL,1000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6435,'Fresh_Fruit','Fresh Fruit',3,NULL,NULL,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6436,'Ptotection_Seagod','Sea God\'s Call',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6437,'Scaraba_Perfume','Scaraba Perfume',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#
REPLACE INTO `item_db_re` VALUES (6440,'General_Lubrication','General Lubrication',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -3941,44 +3951,57 @@ REPLACE INTO `item_db_re` VALUES (6443,'Sillit_Pong_Bottle','Sillit Pong Bottle'
#
REPLACE INTO `item_db_re` VALUES (6451,'Unknown_Fish','Unknown Fish',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#
-REPLACE INTO `item_db_re` VALUES (6469,'Warrior\'s_Will','Warrior\'s Will',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6470,'Blood_Thirst','Blood Thirst',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6471,'Chills_Of_Death','Chills Of Death',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6485,'Blue_Card_2','Blue 2 Card',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6486,'Blue_Card_0','Blue 0 Card',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6487,'Blue_Card_1','Blue 1 Card',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6464,'Hate_Bundle','Hate Crate',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6465,'Guard_Coin','Guard Coin',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6466,'Clean_Water','Clean Water',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6467,'Perfume','Perfume',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6468,'Thai_Perfume','Thai Perfume',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6469,'Will_Of_Warrior','Warrior\'s Will',3,1000,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6470,'Blood_Thirst','Blood Thirst',3,1200,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6471,'Goast_Chill','Chills Of Death',3,1600,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6472,'Holy_Mom_Blaze','Holy Mom Blaze',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#
+REPLACE INTO `item_db_re` VALUES (6485,'BlueCard_2','Blue 2 Card',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6486,'BlueCard_0','Blue 0 Card',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6487,'BlueCard_1','Blue 1 Card',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6488,'Thanks_Invest_Ticket','Thanks Invest Ticket',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6489,'Cats_Invest_Certif','Cats Invest Certificate',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6490,'Magic_Clay_Fragment','Magic Clay Fragment',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6491,'Magic_Clay','Magic Clay',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6492,'Magic_Clay_Lump','Magic Clay Lump',3,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6493,'Makibi','Makibi',3,30,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6496,'Tikbalang_Thick_Spine','Tikbalang Thick Spine',3,300,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6497,'Small_Amulet','Small Amulet',3,20,NULL,50,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6494,'Kafra_Coin2','Kafra Coin',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6495,'Para_Logro_Badge','Eden Merit Badge',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6496,'Tikbalang_Thick_Spine','Tikbalang\'s Thick Spine',3,300,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6497,'Lesser_Agimat','Lesser Agimat',3,20,NULL,50,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6498,'Jejellopy','Jejellopy',3,200,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6499,'Ancient_Talisman','Ancient Talisman',3,500,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6501,'Lost_Belongings','Lost Belongings',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6502,'The_Cross','The Cross',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6503,'Ward','Ward',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6504,'Cast_Iron_Pot','Cast Iron Pot',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6506,'Memorial_Bouquet','Memorial Bouquet',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
+REPLACE INTO `item_db_re` VALUES (6499,'Ancient_Grudge','Ancient Grudge',3,500,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6500,'Sharp_Bamboo','Sharpened Bamboo',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6501,'Salt_Bag','Salt Bag',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6502,'Silver_Cross','The Cross',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6503,'Soul_Protection','Spiritual Protection',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6504,'Cast_Iron_Caldron','Cast-Iron Caldron',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6505,'Purified_Bone','Purified Spirit Bone',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6506,'Memorial_Bouquet','Offering Bouquet',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6507,'Evil_Bone','Evil Spirit Bone',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6508,'Silver_Bracelet','Silver Bracelet',3,300,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (6509,'Mysterious_Flower','Mysterious Flower',3,500,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6510,'Pretty_Flower','Pretty Flower',3,300,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6511,'Graceful_Flower','Graceful Flower',3,300,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6512,'Fire_Amulet','Fire Amulet',3,100,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6513,'Ice_Amulet','Ice Amulet',3,100,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6514,'Wind_Amulet','Wind Amulet',3,100,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6515,'Earth_Amulet','Earth Amulet',3,100,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6516,'Bakonawa_Doll','Bakonawa Doll',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6517,'Bangungot_Doll','Bangungot Doll',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6518,'Buwaya_Doll','Buwaya Doll',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6519,'Collected_Samples','Collected_Samples',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (6523,'Bakonawa_Soul_Fragments','Bakonawa Soul Fragments',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6524,'Bangungot_Soul_Fragments','Bangungot Soul Fragments',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (6525,'Buwaya_Soul_Fragments','Buwaya Soul Fragments',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6510,'Elegant_Flower','Elegant Flower',3,300,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6511,'Beautiful_Flower','Beautiful Flower',3,300,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6512,'Charm_Fire','Fire Amulet',3,100,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6513,'Charm_Ice','Ice Amulet',3,100,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6514,'Charm_Wind','Wind Amulet',3,100,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6515,'Charm_Earth','Earth Amulet',3,100,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6516,'Bakonawa_Doll','Bakonawa Doll',3,3000,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6517,'Bangungot_Doll','Bangungot Doll',3,3000,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6518,'Buwaya_Doll','Buwaya Doll',3,3000,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6519,'Collected_Samples','Collected Sample',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6520,'Lost_Belongings','Lost Belongings',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6521,'Royal_Certificate','Royal Certificate',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6522,'Royal_Certificate_','Royal Certificate',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6523,'Bakonawa_Spirit_Piece','Piece of Bakonawa\'s Spirit',3,3000,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6524,'Bangungot_Spirit_Piece','Piece of Bangungot\'s Spirit',3,3000,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6525,'Buwaya_Spirit_Piece','Piece of Buwaya\'s Spirit',3,3000,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#
REPLACE INTO `item_db_re` VALUES (7001,'Mould_Powder','Mould Powder',3,466,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (7002,'Ogre_Tooth','Ogre Tooth',3,658,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -4610,7 +4633,10 @@ REPLACE INTO `item_db_re` VALUES (7628,'Idiot_Key','Idiot Key',3,NULL,NULL,0,NUL
REPLACE INTO `item_db_re` VALUES (7629,'Pink_Gift_Box','Pink Gift Box',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (7630,'Clean_Beach_Brush','Clean Beach Brush',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (7631,'Trash_Debris','Trash Debris',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (7635,'Sachet','Sachet',3,100,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (7632,'To_Afterworld_Record','Terrible Report Card',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (7633,'To_Heaven_Record','Heavensent Report Card',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (7634,'Rose_Of_Father','Father Rose',3,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (7635,'Perfume_Pouch','Incense Bag',3,100,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#
REPLACE INTO `item_db_re` VALUES (7701,'Dragon_Spirit','Soul',3,2,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (7702,'Special_Cogwheel','Special Cogwheel',3,2,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -5358,7 +5384,7 @@ REPLACE INTO `item_db_re` VALUES (12216,'Inc_Agi_10_Scroll','LV10 Agil Scroll',2
REPLACE INTO `item_db_re` VALUES (12217,'Aspersio_5_Scroll','LV5 Aspersio Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'if(countitem(523)>0) { skilleffect "PR_ASPERSIO",0; sc_start SC_ASPERSIO,180000,5; delitem 523,1; }',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12218,'Assumptio_5_Scroll','LV5 Assumptio Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'skilleffect "HP_ASSUMPTIO",0; sc_start SC_ASSUMPTIO,100000,5;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12219,'Wind_Walk_10_Scroll','LV10 Wind Walker Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'skilleffect "SN_WINDWALK",0; sc_start SC_WINDWALK,250000,5;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (12220,'Adrenaline_Scroll','LV5 Adrenaline Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'if(getiteminfo(getequipid(EQI_HAND_R),14)==6||getiteminfo(getequipid(EQI_HAND_R),14)==7) { skilleffect "BS_ADRENALINE",0; sc_start SC_ADRENALINE,150000,5; }',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (12220,'Adrenaline_Scroll','LV5 Adrenaline Scroll',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'set .@type,getiteminfo(getequipid(EQI_HAND_R),11); if (.@type==6||.@type==7||.@type==8) { skilleffect "BS_ADRENALINE",0; sc_start SC_ADRENALINE,150000,5; }',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12221,'Megaphone_','Megaphone',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'input @megaphone$; announce strcharinfo(0) + ": " + @megaphone$,bc_all,0xFF0000; end;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12225,'Sweet_Candy_Striper','Sweet Candy Cane',2,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'pet 1245;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12226,'Examination1','Examination 1',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_SpeedUp0,5400000,0; percentheal 100,100; sc_start SC_STRFOOD,5400000,10; sc_start SC_DEXFOOD,5400000,5; sc_start SC_ATKPOTION,5400000,22; sc_start SC_MATKFOOD,5400000,15;',NULL,NULL);
@@ -5367,7 +5393,7 @@ REPLACE INTO `item_db_re` VALUES (12228,'Examination3','Examination 3',0,20,NULL
REPLACE INTO `item_db_re` VALUES (12229,'Examination4','Examination 4',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_SpeedUp0,5400000,0; percentheal 100,100; sc_start SC_STRFOOD,5400000,3; sc_start SC_AGIFOOD,5400000,5; sc_start SC_VITFOOD,5400000,10; sc_start SC_MATKFOOD,5400000,52;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12230,'Examination5','Examination 5',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_SpeedUp0,5400000,0; percentheal 100,100; sc_start SC_INTFOOD,5400000,3; sc_start SC_DEXFOOD,5400000,12; sc_start SC_ATKPOTION,5400000,20; sc_start SC_MATKFOOD,5400000,20;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12231,'Examination6','Examination 6',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 100,100; sc_start SC_SpeedUp0,5400000,0; sc_start SC_STRFOOD,5400000,6; sc_start SC_DEXFOOD,5400000,6; sc_start SC_AGIFOOD,5400000,6; sc_start SC_INTFOOD,5400000,6; sc_start SC_VITFOOD,5400000,6; sc_start SC_LUKFOOD,5400000,6; sc_start SC_ATKPOTION,5400000,24; sc_start SC_MATKFOOD,5400000,24;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (12232,'Gingerbread','Ginger Bread',2,20,NULL,150,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (12232,'Gingerbread','Ginger Bread',2,20,NULL,150,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_ASPDPOTION1,900000,0; sc_start SC_SpeedUp0,900000,0;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12233,'Kvass','Kvass',0,20,NULL,200,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 100,100;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12234,'Cacao99','Fierce Cacao 99%',0,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 25,0;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12235,'Strawberry_Choco','Chocolate Strawberry',2,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 0,5; skilleffect "AL_BLESSING",0; sc_start SC_BLESSING,240000,10;',NULL,NULL);
@@ -5549,7 +5575,7 @@ REPLACE INTO `item_db_re` VALUES (12410,'Spareribs_H','Spareribs H',2,NULL,NULL,
REPLACE INTO `item_db_re` VALUES (12411,'HE_Battle_Manual','HE Battle Manual',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_EXPBOOST,900000,200;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12412,'HE_Bubble_Gum','HE Bubble Gum',2,2,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_ITEMBOOST,900000,300;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12413,'PCBang_Coupon_Box2','PCBang Coupon Box2',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (12414,'Guarana_Candy','Guarana Candy',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_INCASPDRATE,1800000,10; sc_start SC_INCREASEAGI,140000,5; skilleffect "AL_INCAGI",0;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (12414,'Guarana_Candy','Guarana Candy',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_ASPDPOTION0,1800000,0; sc_start SC_INCREASEAGI,140000,5; skilleffect "AL_INCAGI",0;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12415,'Siege_Teleport_Scroll2','Siege Teleport Scroll2',2,NULL,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12416,'LUcky_Egg_C3','LUcky Egg C3',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12417,'Boost500','Boost500',2,100,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -5997,7 +6023,7 @@ REPLACE INTO `item_db_re` VALUES (13062,'Ancient_Dagger','Ancient Dagger',4,20,N
#13064,
#13065,
REPLACE INTO `item_db_re` VALUES (13066,'P_Dagger3','Eden Dagger III',4,NULL,NULL,0,'165:80',NULL,1,NULL,0xFE9F7EEF,7,2,2,3,'60',NULL,1,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (13067,'Kris','Kris',4,20,NULL,700,'107:70',NULL,1,1,0xFE9F7EEF,2,2,2,3,'30',1,1,'bonus2 bHpDrainRate,50,10;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (13067,'Caress','Keris',4,20,NULL,700,'107:70',NULL,1,1,0xFE9F7EEF,2,2,2,3,'30',1,1,'bonus2 bHpDrainRate,20,10;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (13068,'Pompano','Pompano',4,NULL,NULL,0,'160:100',NULL,3,NULL,0xFE9F7EEF,7,2,2,1,'50',NULL,1,'bonus bUnbreakableWeapon,0; autobonus "{bonus bBaseAtk,30;}",10,7000,BF_WEAPON,"{specialeffect2 EF_ENHANCE;}"; autobonus "{bonus bMatk,20;}",10,7000,BF_MAGIC,"{specialeffect2 EF_SUFFRAGIUM;}"; if(BaseLevel>99) { bonus bBaseAtk,10; bonus bMatk,10; }',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (13069,'As-nail','As-nail',4,56000,NULL,500,'160:80',NULL,1,NULL,0x000654E2,7,2,2,4,'110',1,1,'bonus bAtkEle,Ele_Wind; bonus2 bAddEff,Eff_Freeze,100+(getrefine()*50);',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (13070,'Scarlet-nail','Scarlet-nail',4,56000,NULL,500,'160:80',NULL,1,NULL,0x000654E2,7,2,2,4,'110',1,1,'bonus bAtkEle,Ele_Fire; bonus2 bAddEff,Eff_Stone,100+(getrefine()*50);',NULL,NULL);
@@ -6116,7 +6142,10 @@ REPLACE INTO `item_db_re` VALUES (13288,'Drocera_Stew_To_Throw','Throwing Droser
REPLACE INTO `item_db_re` VALUES (13289,'Petti_Noodle_To_Throw','Throwing Petite Tail Soup',10,100,NULL,50,NULL,NULL,NULL,NULL,0x00040000,8,2,32768,NULL,'99',NULL,9,'sc_start SC_PUTTI_TAILS_NOODLES,300000,20;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (13290,'Black_Thing_To_Throw','Throwing Black Mass',10,100,NULL,50,NULL,NULL,NULL,NULL,0x00040000,8,2,32768,NULL,'99',NULL,9,'sc_start SC_STOMACHACHE,60000,rand(5,10);',NULL,NULL);
# More Shurikens & Kunais
-REPLACE INTO `item_db_re` VALUES (13294,'Explosive_Kunai','Explosive Kunai',10,100,NULL,50,'30',NULL,NULL,NULL,0x02000000,7,2,32768,NULL,'100',NULL,7,'bonus bAtkEle,Ele_Neutral;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (13291,'Starfish','Starfish',10,NULL,NULL,5,'110',NULL,NULL,NULL,0x02000000,7,2,32768,NULL,'50',NULL,7,'bonus bAtkEle,Ele_Neutral; /* bonus2 bAddEff,Eff_Stun,?; */',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (13292,'Dried_Squid','Dried Squid',10,10,NULL,20,'50',NULL,NULL,NULL,0x02000000,7,2,32768,NULL,'1',NULL,7,'bonus bAtkEle,Ele_Neutral; /* bonus2 bAddEff,Eff_Blind,?; */',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (13293,'Flying_Fish','Flying_Fish',10,10,NULL,20,'50',NULL,NULL,NULL,0x02000000,7,2,32768,NULL,'1',NULL,6,'bonus bAtkEle,Ele_Neutral; /* bonus2 bAddEff,Eff_Bleeding,?; */',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (13294,'Explosive_Kunai','Explosive Kunai',10,100,NULL,30,'50',NULL,NULL,NULL,0x02000000,7,2,32768,NULL,'100',NULL,7,'bonus bAtkEle,Ele_Neutral;',NULL,NULL);
# Ninja Fuuma Shurikens
REPLACE INTO `item_db_re` VALUES (13300,'Huuma_Bird_Wing','Huuma Wing Shuriken',4,90000,NULL,3000,'150',NULL,1,NULL,0x02000000,7,2,34,4,'65',1,22,'bonus bUnbreakableWeapon,0; bonus bAtkEle,Ele_Wind; bonus bDex,-2; bonus bAgi,-1;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (13301,'Huuma_Giant_Wheel','Huuma Giant Wheel Shuriken',4,40000,NULL,2500,'50',NULL,1,3,0x02000000,7,2,34,4,'42',1,22,'bonus bUnbreakableWeapon,0; bonus2 bAddEff,Eff_Bleeding,100;',NULL,NULL);
@@ -7140,10 +7169,10 @@ REPLACE INTO `item_db_re` VALUES (15032,'Tidon','Tidon',5,20,NULL,500,NULL,2,NUL
#15033,
#15034,
#15035,
-REPLACE INTO `item_db_re` VALUES (15036,'Urj_Plate','Urj Plate',5,20,NULL,3000,NULL,110,NULL,NULL,0x00000080,8,2,16,NULL,'100',1,0,'bonus bMdef,10; bonus bMaxHPRate,getequiprefinerycnt(EQI_ARMOR); bonus2 bSubRace,RC_DemiHuman,5; bonus2 bSubEle,Ele_Neutral,5;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (15037,'Pertz_Plate','Pertz Plate',5,20,NULL,3000,NULL,110,NULL,NULL,0x00000080,8,2,16,NULL,'100',1,0,'bonus bMdef,10; bonus bBaseAtk,20; bonus bFlee,17;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (15038,'Sabath\'s_Cloth','Sabath\'s Cloth',5,20,NULL,100,NULL,45,NULL,1,0x00001000,7,2,16,NULL,'100',1,0,'bonus bLuk,3; bonus3 bAutoSpell,"ASC_METEORASSAULT",getskilllv("ASC_METEORASSAULT"),10;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (15039,'Nabeu\'s_Cloth','Nabeu\'s Cloth',5,20,NULL,100,NULL,45,NULL,1,0x00001000,7,2,16,NULL,'100',1,0,'bonus bStr,2; bonus bInt,2;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (15036,'Ur_Plate','Urj Plate',5,20,NULL,3000,NULL,110,NULL,NULL,0x00000080,8,2,16,NULL,'100',1,0,'bonus bMdef,10; bonus bMaxHPRate,getequiprefinerycnt(EQI_ARMOR); bonus2 bSubRace,RC_DemiHuman,5; bonus2 bSubEle,Ele_Neutral,5;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (15037,'Peuz_Plate','Pertz Plate',5,20,NULL,3000,NULL,110,NULL,NULL,0x00000080,8,2,16,NULL,'100',1,0,'bonus bMdef,10; bonus bBaseAtk,20; bonus bFlee,17;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (15038,'Sabah_Cloth','Sabath\'s Cloth',5,20,NULL,100,NULL,45,NULL,1,0x00001000,7,2,16,NULL,'100',1,0,'bonus bLuk,3; bonus3 bAutoSpell,"ASC_METEORASSAULT",getskilllv("ASC_METEORASSAULT"),10;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (15039,'Nab_Cloth','Nabeu\'s Cloth',5,20,NULL,100,NULL,45,NULL,1,0x00001000,7,2,16,NULL,'100',1,0,'bonus bStr,2; bonus bInt,2;',NULL,NULL);
#15040,
#15041,
REPLACE INTO `item_db_re` VALUES (15042,'White_Wing_Suit','White Wing Suit',5,20,NULL,100,NULL,45,NULL,1,0x00000800,7,2,16,NULL,'100',1,0,'bonus bLongAtkRate,getrefine()*2; bonus bFlee,getrefine();',NULL,NULL);
@@ -7151,12 +7180,12 @@ REPLACE INTO `item_db_re` VALUES (15043,'Black_Wing_Suit','Black Wing Suit',5,20
REPLACE INTO `item_db_re` VALUES (15044,'Green_Surgical_Gown','Green Surgical Gown',5,56000,NULL,660,NULL,66,NULL,1,0x00040000,7,2,16,NULL,'100',1,0,'bonus bDex,1; bonus bMaxSP,30;',NULL,NULL);
#15045,
REPLACE INTO `item_db_re` VALUES (15046,'Siege_Plate','Siege Plate',5,NULL,NULL,3300,NULL,85,NULL,1,0x006444A2,7,2,16,NULL,'95',1,0,'bonus bMdef,5; bonus2 bSubRace,RC_DemiHuman,2; if(getrefine()>5) { bonus bHealpower2,12; bonus bAddItemHealRate,12; } if(getrefine()>8) { bonus bMaxHPRate,25; }',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (15047,'Siege_Suit','Siege Suit',5,NULL,NULL,750,NULL,50,NULL,1,0x036E5CEA,7,2,16,NULL,'95',1,0,'bonus bMdef,10; bonus2 bSubRace,RC_DemiHuman,2; if(getrefine()>5) { bonus bFlee2,5; bonus bLongAtkDef,20; } if(getrefine()>8) { bonus bMaxHPRate,15; }',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (15047,'Siege_Suits','Siege Suit',5,NULL,NULL,750,NULL,50,NULL,1,0x036E5CEA,7,2,16,NULL,'95',1,0,'bonus bMdef,10; bonus2 bSubRace,RC_DemiHuman,2; if(getrefine()>5) { bonus bFlee2,5; bonus bLongAtkDef,20; } if(getrefine()>8) { bonus bMaxHPRate,15; }',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (15048,'Siege_Robe','Siege Robe',5,NULL,NULL,500,NULL,40,NULL,1,0x00818315,7,2,16,NULL,'95',1,0,'bonus bMdef,20; bonus2 bSubRace,RC_DemiHuman,2; if(getrefine()>5) { bonus bFlee,5; bonus bLongAtkDef,15; } if(getrefine()>8) { bonus bMaxHP,1000; bonus bMaxSP,100; }',NULL,NULL);
#15049,
#15050,
-REPLACE INTO `item_db_re` VALUES (15051,'Bakunawa_Scale_Armor','Bakunawa Scale Armor',5,20,NULL,500,NULL,55,NULL,NULL,0xFFFFFFFF,7,2,16,NULL,'1',1,0,'bonus2 bSubRace,RC_Boss,getrefine()/2; bonus bAllStats,1;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (15052,'Bayani_Bakunawa_Scale_Armor','Bayani Bakunawa Scale Armor',5,20,NULL,500,NULL,55,NULL,1,0xFFFFFFFF,7,2,16,NULL,'1',1,0,'bonus2 bSubRace,RC_Boss,getrefine()/2; bonus bAllStats,2;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (15051,'Bakonawa_Armor','Bakunawa Scale Armor',5,20,NULL,500,NULL,55,NULL,NULL,0xFFFFFFFF,7,2,16,NULL,'1',1,0,'bonus2 bSubRace,RC_Boss,getrefine()/2; bonus bAllStats,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (15052,'Bayani_Bakonawa_Armor','Bayani Bakunawa Scale Armor',5,20,NULL,500,NULL,55,NULL,1,0xFFFFFFFF,7,2,16,NULL,'1',1,0,'bonus2 bSubRace,RC_Boss,getrefine()/2; bonus bAllStats,2;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (15053,'Special_Ninja_Suit','Special Ninja Suit',5,10000,NULL,1200,NULL,70,NULL,NULL,0x02000000,7,2,16,NULL,'100',1,0,'bonus bAgi,1+(getrefine()/3);',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (15054,'Ninja_Scale_Armor','Ninja Scale Armor',5,10000,NULL,1800,NULL,90,NULL,1,0x02000000,7,2,16,NULL,'100',1,0,'bonus bMaxHPRate,15; bonus bMaxSPRate,-30;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (15055,'Armor_of_Nothingness','Armor of Nothingness',5,10000,NULL,1500,NULL,60,NULL,1,0x02000000,7,2,16,NULL,'100',1,0,'bonus bAgi,1;',NULL,NULL);
@@ -7177,7 +7206,7 @@ REPLACE INTO `item_db_re` VALUES (16010,'Red_Ether_Bag','Red Ether Bag',4,20,NUL
#16012,
REPLACE INTO `item_db_re` VALUES (16013,'Judgement_Mace1','Judgement Mace I',4,20,NULL,1200,'140:180',NULL,1,2,0x00000100,2,2,2,3,'100',1,8,'bonus bStr,1; bonus bInt,1; autobonus "{bonus2 bAddRace,RC_Demon,20;}",10,7000,BF_WEAPON|BF_MAGIC,"{specialeffect2 EF_BLOODDRAIN;}";',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (16014,'P_Mace3','Eden Mace III',4,NULL,NULL,0,'172',NULL,1,NULL,0x0004C5B3,7,2,2,3,'60',NULL,8,NULL,NULL,NULL);
-#16015,
+REPLACE INTO `item_db_re` VALUES (16015,'Cat_Club','Cat Club',4,20,NULL,700,'88',NULL,3,NULL,0x0004C5B3,7,2,2,1,'1',1,8,'bonus2 bAddRace,RC_Brute,15;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (16016,'Tuna','Tuna',4,NULL,NULL,0,'180',NULL,1,NULL,0x0004C5B3,7,2,2,1,'50',NULL,8,'bonus bUnbreakableWeapon,0; bonus2 bAddEff,Eff_Stun,100; bonus3 bAutoSpell,"SM_BASH",5+5*(getskilllv("SM_BASH")==10),10; if(BaseLevel>99) { bonus bBaseAtk,20; }',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (16017,'Bloody_Cross','Bloody Cross',4,20,NULL,1500,'170',NULL,1,NULL,0x00008110,7,2,2,4,'100',1,8,'bonus bAtkEle,Ele_Dark; bonus3 bAutoSpell,"WL_HELLINFERNO",1,10+(getrefine()*5);',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (16018,'Judgement_Mace2','Judgement Mace II',4,20,NULL,1200,'170:180',NULL,1,1,0x00000100,2,2,2,3,'130',1,8,'bonus bStr,2; bonus bInt,2; autobonus "{bonus2 bAddRace,RC_Demon,40;}",10,7000,BF_WEAPON|BF_MAGIC,"{specialeffect2 EF_BLOODDRAIN;}";',NULL,NULL);
@@ -7267,32 +7296,44 @@ REPLACE INTO `item_db_re` VALUES (16678,'Universal_Catalog_Gold_Box50','Universa
REPLACE INTO `item_db_re` VALUES (16679,'Universal_Catalog_Gold_Box10','Universal Catalog Gold 10 Box',2,NULL,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 12581,10;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (16680,'Universal_Catalog_Gold_Box50','Universal Catalog Gold 50 Box',2,NULL,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 12581,50;',NULL,NULL);
#
-REPLACE INTO `item_db_re` VALUES (16740,'The_Sea_God\'s_Call_23_Hour_Box','The Sea God\'s Call 23 Hour Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 6436,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16741,'Cutlass_1_Day_Box','Cutlass 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1198,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16742,'Cutlass_7_Day_Box','Cutlass 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1198,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16743,'Marlin_1_Day_Box','Marlin 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1489,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16744,'Marlin_7_Day_Box','Marlin 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1489,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16745,'Pompano_1_Day_Box','Pompano 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13068,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16746,'Pompano_7_Day_Box','Pompano 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13068,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16747,'Tuna_1_Day_Box','Tuna 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 16016,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16748,'Tuna_7_Day_Box','Tuna 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 16016,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16749,'Malangdo_Crab_1_Day_Box','Malangdo Crab 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18107,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16750,'Malangdo_Crab_7_Day_Box','Malangdo Crab 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18107,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16751,'Zebra_Eel_1_Day_Box','Zebra Eel 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18108,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16752,'Zebra_Eel_7_Day_Box','Zebra Eel 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18108,604800;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16740,'Ptotection_Seagod_Box','The Sea God\'s Call 23 Hour Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 6436,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16741,'Hairtail_Box1','Cutlass 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1198,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16742,'Hairtail_Box2','Cutlass 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1198,604800;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16743,'Spearfish_Box1','Marlin 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1489,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16744,'Spearfish_Box2','Marlin 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1489,604800;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16745,'Saurel_Box1','Pompano 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13068,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16746,'Saurel_Box2','Pompano 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13068,604800;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16747,'Tuna_Box1','Tuna 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 16016,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16748,'Tuna_Box2','Tuna 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 16016,604800;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16749,'Malang_Crab_Box1','Malangdo Crab 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18107,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16750,'Malang_Crab_Box2','Malangdo Crab 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18107,604800;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16751,'Brindle_Eel_Box1','Zebra Eel 1 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18108,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16752,'Brindle_Eel_Box2','Zebra Eel 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18108,604800;',NULL,NULL);
#
-REPLACE INTO `item_db_re` VALUES (16763,'The_Sea_God\'s_Call_7_Day_Box','The Sea God\'s Call 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 6436,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16764,'The_Sea_God\'s_Call_15_Day_Box','The Sea God\'s Call 15 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 6436,1209600;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16765,'Octopus_Hunting_Skewer_23_Hour_Box','Octopus Hunting Skewer 23 Hour Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 6442,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16766,'Octopus_Hunting_Skewer_3_Day_Box','Octopus Hunting Skewer 3 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 6442,259200;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16767,'Octopus_Hunting_Skewer_7_Day_Box','Octopus Hunting Skewer 7 Day Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 6442,604800;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16770,'Silvervine_Fruit_Box10','Silvervine 10 Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 6417,10; getitem 12636,30;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16771,'Silvervine_Fruit_Box40','Silvervine 40 Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 6417,40; getitem 12636,120;',NULL,NULL);
#
REPLACE INTO `item_db_re` VALUES (16776,'Universal_Catalog_Gold_Box10','Universal Catalog Gold 10 Box',2,NULL,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 12581,10;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (16777,'Universal_Catalog_Gold_Box50','Universal Catalog Gold 50 Box',2,NULL,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 12581,50;',NULL,NULL);
#
-REPLACE INTO `item_db_re` VALUES (16998,'Archangel_Wings_Box','Archangel Wings Box',2,NULL,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 2573,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16979,'Silvervine_Fruit_Box4','Silvervine 4 Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 6417,4; getitem 12636,12;',NULL,NULL);
+#
+REPLACE INTO `item_db_re` VALUES (16998,'Archangel_Wing_Box','Archangel Wings Box',2,NULL,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 2573,1;',NULL,NULL);
+#
+REPLACE INTO `item_db_re` VALUES (17013,'Malang_Woe_Encard_Box','Malang Woe Encard Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 16740,1; getitem 16765,1;',NULL,NULL);
+#
+REPLACE INTO `item_db_re` VALUES (17084,'Upg_Katar_Box','Upg Katar Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 1292,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17085,'Upg_Two_Handed_Axe_Box','Upg Two Handed Axe Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 1394,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17086,'Upg_Lance_Box','Upg Lance Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 1491,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17087,'Upg_Book_Box','Upg Book Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 1585,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17088,'Upg_Staff_Box','Upg Staff Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 2015,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17089,'Upg_Dagger_Box','Upg Dagger Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 13071,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17090,'Upg_Revolver_Box','Upg Revolver',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 13115,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17091,'Upg_Mace_Box','Upg Mace Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 16019,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17092,'Upg_Bow_Box','Upg Bow Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 18112,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17093,'Upg_Twohand_Sword_Box','Upg Two-Handed Sword Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 21000,1;',NULL,NULL);
#
-REPLACE INTO `item_db_re` VALUES (17155,'Enhance_Huuma_Shuriken_Box','Enhance Huuma Shuriken Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13316,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (17155,'Upg_Huuma_Shuriken_Box','Upg Huuma Shuriken Box',2,NULL,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13316,86400;',NULL,NULL);
# Mechanic/Genetic Cannonballs
REPLACE INTO `item_db_re` VALUES (18000,'Cannon_Ball','Cannon Ball',10,100,NULL,10,'100',NULL,NULL,NULL,0x00040400,8,2,32768,NULL,'99',NULL,8,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (18001,'Holy_Cannon_Ball','Holy Cannon Ball',10,200,NULL,10,'120',NULL,NULL,NULL,0x00040400,8,2,32768,NULL,'99',NULL,8,'bonus bAtkEle,Ele_Holy;',NULL,NULL);
@@ -7330,7 +7371,7 @@ REPLACE INTO `item_db_re` VALUES (18516,'RTC_2nd_Winner_Hat','RTC 2nd Winner Hat
REPLACE INTO `item_db_re` VALUES (18517,'RTC_3rd_Winner_Hat','RTC 3rd Winner Hat',5,20,NULL,100,NULL,2,NULL,NULL,0xFFFFFFFF,7,2,512,NULL,'1',NULL,685,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (18518,'Angelwing_Ear_S','Angel Wing Ears',5,20,NULL,100,NULL,3,NULL,1,0xFFFFFFFF,7,2,512,NULL,'70',NULL,158,'bonus bStr,1;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (18519,'Devilwing_Ear_S','Evil Wing Ears',5,20,NULL,100,NULL,3,NULL,1,0xFFFFFFFF,7,2,512,NULL,'70',NULL,152,'bonus bStr,1;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (18520,'Jati_Crown','Jati Crown',5,20,NULL,100,NULL,1,NULL,NULL,0xFFFFFFFF,7,2,256,NULL,'1',1,686,'bonus2 bSubRace,RC_Plant,5; bonus2 bSubRace,RC_Brute,5; bonus2 bAddRace,RC_Plant,5; bonus2 bAddRace,RC_Brute,5;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (18520,'Jaty_C','Jaty Crown',5,20,NULL,100,NULL,1,NULL,NULL,0xFFFFFFFF,7,2,256,NULL,'1',1,686,'bonus2 bSubRace,RC_Plant,5; bonus2 bSubRace,RC_Brute,5; bonus2 bAddRace,RC_Plant,5; bonus2 bAddRace,RC_Brute,5;',NULL,NULL);
#
REPLACE INTO `item_db_re` VALUES (18523,'Thunderstorm_Cloud','Thunderstorm Cloud',5,20,NULL,100,NULL,2,NULL,NULL,0xFFFFFFFF,7,2,512,NULL,'1',NULL,688,NULL,NULL,NULL);
#
diff --git a/sql-files/main.sql b/sql-files/main.sql
index ae8fa7b03..0e9dc5b67 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -105,8 +105,9 @@ CREATE TABLE IF NOT EXISTS `char` (
`child` int(11) unsigned NOT NULL default '0',
`fame` int(11) unsigned NOT NULL default '0',
`rename` SMALLINT(3) unsigned NOT NULL default '0',
- `delete_date` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `delete_date` INT(11) unsigned NOT NULL DEFAULT '0',
`slotchange` SMALLINT(3) unsigned NOT NULL default '0',
+ `char_opt` INT( 11 ) unsigned NOT NULL default '0',
PRIMARY KEY (`char_id`),
UNIQUE KEY `name_key` (`name`),
KEY `account_id` (`account_id`),
@@ -654,6 +655,8 @@ INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531);
INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000);
INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218);
INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316);
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474);
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541);
--
-- Table structure for table `sstatus`
diff --git a/sql-files/upgrades/2013-03-06--00-00.sql b/sql-files/upgrades/2013-03-06--00-00.sql
index 844e3d8a8..8d46be76a 100644
--- a/sql-files/upgrades/2013-03-06--00-00.sql
+++ b/sql-files/upgrades/2013-03-06--00-00.sql
@@ -6,4 +6,4 @@ DELETE FROM `quest` WHERE `quest_id` > 9154 AND `quest_id` < 9166;
DELETE FROM `global_reg_value` WHERE `str` = 'dewata_gatti';
DELETE FROM `global_reg_value` WHERE `str` = 'dewata_legend';
DELETE FROM `global_reg_value` WHERE `str` = 'dewata_oldman';
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000); \ No newline at end of file
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000);
diff --git a/sql-files/upgrades/2013-04-16--01-24.sql b/sql-files/upgrades/2013-04-16--01-24.sql
new file mode 100644
index 000000000..69672b368
--- /dev/null
+++ b/sql-files/upgrades/2013-04-16--01-24.sql
@@ -0,0 +1,3 @@
+#1366075474
+#Info http://hercules.ws/board/topic/410-skill-script-command-updatefix/
+UPDATE `skill` SET `flag` = 0 WHERE `flag` = 4 AND `id` != 2535 AND `id` != 681; \ No newline at end of file
diff --git a/sql-files/upgrades/2013-04-16--02-15.sql b/sql-files/upgrades/2013-04-16--02-15.sql
new file mode 100644
index 000000000..8d051421f
--- /dev/null
+++ b/sql-files/upgrades/2013-04-16--02-15.sql
@@ -0,0 +1,4 @@
+#1366078541
+ALTER TABLE `char` ADD `char_opt` INT( 11 ) UNSIGNED NOT NULL;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474);#for the previous that missed it..
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541); \ No newline at end of file
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
index a803adffc..54502d48b 100644
--- a/sql-files/upgrades/index.txt
+++ b/sql-files/upgrades/index.txt
@@ -2,4 +2,5 @@
2013-02-15--18-06.sql
2013-03-05--01-05.sql
2013-03-06--00-00.sql
-2013-03-09--01-56.sql \ No newline at end of file
+2013-03-09--01-56.sql
+2013-04-16--01-24.sql \ No newline at end of file
diff --git a/src/char/char.c b/src/char/char.c
index 0b8a3831d..b91a3a984 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -125,8 +125,7 @@ int max_connect_user = -1;
int gm_allow_group = -1;
int autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
int start_zeny = 0;
-int start_weapon = 1201;
-int start_armor = 2301;
+int start_items[MAX_START_ITEMS*2];
int guild_exp_rate = 100;
//Custom limits for the fame lists. [Skotlex]
@@ -436,7 +435,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
else
errors++;
}
-
+
if (
(p->base_exp != cp->base_exp) || (p->base_level != cp->base_level) ||
(p->job_level != cp->job_level) || (p->job_exp != cp->job_exp) ||
@@ -453,9 +452,16 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
(p->pet_id != cp->pet_id) || (p->weapon != cp->weapon) || (p->hom_id != cp->hom_id) ||
(p->ele_id != cp->ele_id) || (p->shield != cp->shield) || (p->head_top != cp->head_top) ||
(p->head_mid != cp->head_mid) || (p->head_bottom != cp->head_bottom) || (p->delete_date != cp->delete_date) ||
- (p->rename != cp->rename) || (p->slotchange != cp->slotchange) || (p->robe != cp->robe)
- )
- { //Save status
+ (p->rename != cp->rename) || (p->slotchange != cp->slotchange) || (p->robe != cp->robe) ||
+ (p->show_equip != cp->show_equip) || (p->allow_party != cp->allow_party)
+ ) { //Save status
+ unsigned int opt = 0;
+
+ if( p->allow_party )
+ opt |= OPT_ALLOW_PARTY;
+ if( p->show_equip )
+ opt |= OPT_SHOW_EQUIP;
+
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
"`base_exp`='%u', `job_exp`='%u', `zeny`='%d',"
"`max_hp`='%d',`hp`='%d',`max_sp`='%d',`sp`='%d',`status_point`='%d',`skill_point`='%d',"
@@ -463,7 +469,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
"`option`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',`homun_id`='%d',`elemental_id`='%d',"
"`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d',"
"`last_map`='%s',`last_x`='%d',`last_y`='%d',`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d',"
- "`delete_date`='%lu',`robe`='%d',`slotchange`='%d'"
+ "`delete_date`='%lu',`robe`='%d',`slotchange`='%d', `char_opt`='%u'"
" WHERE `account_id`='%d' AND `char_id` = '%d'",
char_db, p->base_level, p->job_level,
p->base_exp, p->job_exp, p->zeny,
@@ -474,7 +480,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
mapindex_id2name(p->last_point.map), p->last_point.x, p->last_point.y,
mapindex_id2name(p->save_point.map), p->save_point.x, p->save_point.y, p->rename,
(unsigned long)p->delete_date, // FIXME: platform-dependent size
- p->robe,p->slotchange,
+ p->robe,p->slotchange,opt,
p->account_id, p->char_id) )
{
Sql_ShowDebug(sql_handle);
@@ -1051,7 +1057,7 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
sd->found_char[p.slot] = p.char_id;
j += mmo_char_tobuf(WBUFP(buf, j), &p);
}
-
+
memset(sd->new_name,0,sizeof(sd->new_name));
SqlStmt_Free(stmt);
@@ -1077,6 +1083,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
struct hotkey tmp_hotkey;
int hotkey_num;
#endif
+ unsigned int opt;
memset(p, 0, sizeof(struct mmo_charstatus));
@@ -1095,7 +1102,8 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
"`str`,`agi`,`vit`,`int`,`dex`,`luk`,`max_hp`,`hp`,`max_sp`,`sp`,"
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`homun_id`,`elemental_id`,`hair`,"
"`hair_color`,`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`last_x`,`last_y`,"
- "`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`,`slotchange`"
+ "`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`,`slotchange`,"
+ "`char_opt`"
" FROM `%s` WHERE `char_id`=? LIMIT 1", char_db)
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
|| SQL_ERROR == SqlStmt_Execute(stmt)
@@ -1152,6 +1160,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 50, SQLDT_UINT32, &p->delete_date, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 51, SQLDT_SHORT, &p->robe, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 52, SQLDT_USHORT, &p->slotchange, 0, NULL, NULL)
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 53, SQLDT_UINT, &opt, 0, NULL, NULL)
)
{
SqlStmt_ShowDebug(stmt);
@@ -1323,6 +1332,12 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
SqlStmt_Free(stmt);
StringBuf_Destroy(&buf);
+ /* load options into proper vars */
+ if( opt & OPT_ALLOW_PARTY )
+ p->allow_party = true;
+ if( opt & OPT_SHOW_EQUIP )
+ p->show_equip = true;
+
cp = idb_ensure(char_db_, char_id, create_charstatus);
memcpy(cp, p, sizeof(struct mmo_charstatus));
return 1;
@@ -1507,7 +1522,7 @@ int make_new_char_sql(struct char_session_data* sd, char* name_, int str, int ag
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1];
- int char_id, flag;
+ int char_id, flag, k;
safestrncpy(name, name_, NAME_LENGTH);
normalize_name(name,TRIM_CHARS);
@@ -1571,13 +1586,10 @@ int make_new_char_sql(struct char_session_data* sd, char* name_, int str, int ag
//Retrieve the newly auto-generated char id
char_id = (int)Sql_LastInsertId(sql_handle);
//Give the char the default items
- if (start_weapon > 0) { //add Start Weapon (Knife?)
- if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')", inventory_db, char_id, start_weapon, 1, 1) )
- Sql_ShowDebug(sql_handle);
- }
- if (start_armor > 0) { //Add default armor (cotton shirt?)
- if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')", inventory_db, char_id, start_armor, 1, 1) )
- Sql_ShowDebug(sql_handle);
+
+ for (k = 0; k < ARRAYLENGTH(start_items) && start_items[k] != 0; k += 2) {
+ if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')", inventory_db, char_id, start_items[k], start_items[k + 1], 1) )
+ Sql_ShowDebug(sql_handle);
}
ShowInfo("Created char: account: %d, char: %d, slot: %d, name: %s\n", sd->account_id, char_id, slot, name);
@@ -1865,7 +1877,27 @@ int mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p)
return 106+offset;
}
-
+ int mmo_char_send006b(int fd, struct char_session_data* sd);
+//----------------------------------------
+// [Ind/Hercules] notify client about charselect window data
+//----------------------------------------
+void mmo_char_send082d(int fd, struct char_session_data* sd) {
+ if (save_log)
+ ShowInfo("Loading Char Data ("CL_BOLD"%d"CL_RESET")\n",sd->account_id);
+
+ WFIFOHEAD(fd,29);
+ WFIFOW(fd,0) = 0x82d;
+ WFIFOW(fd,2) = 29;
+ WFIFOB(fd,4) = sd->char_slots;
+ WFIFOB(fd,5) = MAX_CHARS - sd->char_slots;
+ WFIFOB(fd,6) = MAX_CHARS - sd->char_slots;
+ WFIFOB(fd,7) = sd->char_slots;
+ WFIFOB(fd,8) = sd->char_slots;
+ memset(WFIFOP(fd,9), 0, 20); // unused bytes
+ WFIFOSET(fd,29);
+ mmo_char_send006b(fd,sd);
+
+}
//----------------------------------------
// Function to send characters to a player
//----------------------------------------
@@ -1874,11 +1906,10 @@ int mmo_char_send006b(int fd, struct char_session_data* sd)
int j, offset = 0;
#if PACKETVER >= 20100413
offset += 3;
-#endif
-
+#endif
if (save_log)
ShowInfo("Loading Char Data ("CL_BOLD"%d"CL_RESET")\n",sd->account_id);
-
+
j = 24 + offset; // offset
WFIFOHEAD(fd,j + MAX_CHARS*MAX_CHAR_BUF);
WFIFOW(fd,0) = 0x6b;
@@ -2179,7 +2210,7 @@ int parse_fromlogin(int fd) {
if( sd->char_slots > MAX_CHARS ) {
ShowError("Account '%d' `character_slots` column is higher than supported MAX_CHARS (%d), update MAX_CHARS in mmo.h! capping to MAX_CHARS...\n",sd->account_id,sd->char_slots);
sd->char_slots = MAX_CHARS;/* cap to maximum */
- } else if ( !sd->char_slots )/* no value aka 0 in sql */
+ } else if ( sd->char_slots <= 0 )/* no value aka 0 in sql */
sd->char_slots = MAX_CHARS;/* cap to maximum */
safestrncpy(sd->birthdate, (const char*)RFIFOP(fd,52), sizeof(sd->birthdate));
safestrncpy(sd->pincode, (const char*)RFIFOP(fd,63), sizeof(sd->pincode));
@@ -2196,7 +2227,11 @@ int parse_fromlogin(int fd) {
WFIFOSET(i,3);
} else {
// send characters to player
+#if PACKETVER >= 20130000
+ mmo_char_send082d(i, sd);
+#else
mmo_char_send006b(i, sd);
+#endif
#if PACKETVER >= 20110309
pincode->handle(i, sd);
#endif
@@ -3615,8 +3650,7 @@ static void char_delete2_accept(int fd, struct char_session_data* sd)
}
// refresh character list cache
- for(k = i; k < MAX_CHARS-1; k++)
- {
+ for(k = i; k < MAX_CHARS-1; k++) {
sd->found_char[k] = sd->found_char[k+1];
}
sd->found_char[MAX_CHARS-1] = -1;
@@ -4285,12 +4319,16 @@ int parse_char(int fd)
WFIFOSET(fd, 8);
/* for some stupid reason it requires the char data again (gravity -_-) */
if( ret )
- mmo_char_send006b( fd, sd );
+#if PACKETVER >= 20130000
+ mmo_char_send082d(fd, sd);
+#else
+ mmo_char_send006b(fd, sd);
+#endif
RFIFOSKIP(fd, 8);
}
break;
-
+
// unknown packet received
default:
ShowError("parse_char: Received unknown packet "CL_WHITE"0x%x"CL_RESET" from ip '"CL_WHITE"%s"CL_RESET"'! Disconnecting!\n", RFIFOW(fd,0), ip2str(ipl, NULL));
@@ -4746,18 +4784,29 @@ int char_config_read(const char* cfgName)
ShowError("Specified start_point %s not found in map-index cache.\n", map);
start_point.x = x;
start_point.y = y;
+ } else if (strcmpi(w1, "start_items") == 0) {
+ int i;
+ char *split, *split2;
+
+ i = 0;
+ split = strtok(w2, ",");
+ while (split != NULL && i < MAX_START_ITEMS*2) {
+ split2 = split;
+ split = strtok(NULL, ",");
+ start_items[i] = atoi(split2);
+ if (start_items[i] < 0)
+ start_items[i] = 0;
+ ++i;
+ }
+
+ if (i%2) { //we know it must be a even number
+ ShowError("Specified 'start_items' is missing a parameter. Removing '%d'.\n", start_items[i - 1]);
+ start_items[i - 1] = 0;
+ }
} else if (strcmpi(w1, "start_zeny") == 0) {
start_zeny = atoi(w2);
if (start_zeny < 0)
start_zeny = 0;
- } else if (strcmpi(w1, "start_weapon") == 0) {
- start_weapon = atoi(w2);
- if (start_weapon < 0)
- start_weapon = 0;
- } else if (strcmpi(w1, "start_armor") == 0) {
- start_armor = atoi(w2);
- if (start_armor < 0)
- start_armor = 0;
} else if(strcmpi(w1,"log_char")==0) { //log char or not [devil]
log_char = atoi(w2);
} else if (strcmpi(w1, "unknown_char_name") == 0) {
diff --git a/src/char/inter.c b/src/char/inter.c
index dec217d02..7fd1e089a 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -489,10 +489,10 @@ void mapif_parse_accinfo(int fd) {
/* it will only get here if we have a single match */
if( account_id ) {
- char userid[NAME_LENGTH], user_pass[NAME_LENGTH], email[40], last_ip[20], lastlogin[30], pincode[5];
+ char userid[NAME_LENGTH], user_pass[NAME_LENGTH], email[40], last_ip[20], lastlogin[30], pincode[5], birthdate[11];
short level = -1;
int logincount = 0,state = 0;
- if ( SQL_ERROR == Sql_Query(sql_handle, "SELECT `userid`, `user_pass`, `email`, `last_ip`, `group_id`, `lastlogin`, `logincount`, `state`,`pincode` FROM `login` WHERE `account_id` = '%d' LIMIT 1", account_id)
+ if ( SQL_ERROR == Sql_Query(sql_handle, "SELECT `userid`, `user_pass`, `email`, `last_ip`, `group_id`, `lastlogin`, `logincount`, `state`,`pincode`,`birthdate` FROM `login` WHERE `account_id` = '%d' LIMIT 1", account_id)
|| Sql_NumRows(sql_handle) == 0 ) {
if( Sql_NumRows(sql_handle) == 0 ) {
inter_to_fd(fd, u_fd, aid, "No account with ID '%d' was found.", account_id );
@@ -511,6 +511,7 @@ void mapif_parse_accinfo(int fd) {
Sql_GetData(sql_handle, 6, &data, NULL); logincount = atoi(data);
Sql_GetData(sql_handle, 7, &data, NULL); state = atoi(data);
Sql_GetData(sql_handle, 8, &data, NULL); safestrncpy(pincode, data, sizeof(pincode));
+ Sql_GetData(sql_handle, 9, &data, NULL); safestrncpy(birthdate, data, sizeof(birthdate));
}
Sql_FreeResult(sql_handle);
@@ -528,7 +529,7 @@ void mapif_parse_accinfo(int fd) {
inter_to_fd(fd, u_fd, aid, "Password: %s", user_pass );
}
- inter_to_fd(fd, u_fd, aid, "Account e-mail: %s", email);
+ inter_to_fd(fd, u_fd, aid, "Account e-mail: %s | Birthdate: %s", email, birthdate);
inter_to_fd(fd, u_fd, aid, "Last IP: %s (%s)", last_ip, geoip_getcountry(str2ip(last_ip)) );
inter_to_fd(fd, u_fd, aid, "This user has logged %d times, the last time were at %s", logincount, lastlogin );
inter_to_fd(fd, u_fd, aid, "-- Character Details --" );
diff --git a/src/common/malloc.c b/src/common/malloc.c
index eb073036e..d8799b2a1 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -130,49 +130,49 @@ void aFree_(void *p, const char *file, int line, const char *func)
/* USE_MEMMGR */
/*
- * ƒƒ‚ƒŠƒ}ƒl[ƒWƒƒ
- * malloc , free ‚̈—‚ðŒø—¦“I‚Éo—ˆ‚é‚悤‚É‚µ‚½‚à‚ÌB
- * •¡ŽG‚Ȉ—‚ðs‚Á‚Ä‚¢‚é‚Ì‚ÅAŽáŠ±d‚­‚È‚é‚©‚à‚µ‚ê‚Ü‚¹‚ñB
+ * Memory manager
+ * able to handle malloc and free efficiently
+ * Since the complex processing, I might be slightly heavier.
*
- * ƒf[ƒ^\‘¢‚È‚Çià–¾‰ºŽè‚Å‚·‚¢‚Ü‚¹‚ñ^^; j
- * Eƒƒ‚ƒŠ‚ð•¡”‚ÌuƒuƒƒbƒNv‚É•ª‚¯‚ÄA‚³‚ç‚ɃuƒƒbƒN‚ð•¡”‚Ìuƒ†ƒjƒbƒgv
- * ‚É•ª‚¯‚Ä‚¢‚Ü‚·Bƒ†ƒjƒbƒg‚̃TƒCƒY‚ÍA‚PƒuƒƒbƒN‚Ì—e—Ê‚ð•¡”ŒÂ‚É‹Ï“™”z•ª
- * ‚µ‚½‚à‚Ì‚Å‚·B‚½‚Æ‚¦‚ÎA‚Pƒ†ƒjƒbƒg32KB‚Ìê‡AƒuƒƒbƒN‚P‚‚Í32Byte‚̃†
- * ƒjƒbƒg‚ªA1024ŒÂW‚Ü‚Á‚Äo—ˆ‚Ä‚¢‚½‚èA64Byte‚̃†ƒjƒbƒg‚ª 512ŒÂW‚Ü‚Á‚Ä
- * o—ˆ‚Ä‚¢‚½‚肵‚Ü‚·Bipadding,unit_head ‚𜂭j
+ * (I'm sorry for the poor description ^ ^;) such as data structures
+ * Divided into "blocks" of a plurality of memory, "unit" of a plurality of blocks further
+ * I have to divide. Size of the unit, a plurality of distribution equal to the capacity of one block
+ * That's what you have. For example, if one unit of 32KB, one block 1 Yu 32Byte
+ * Knit, or are able to gather 1024, gathered 512 units 64Byte
+ * I can be or have. (Excluding padding, the unit_head)
*
- * EƒuƒƒbƒN“¯Žm‚̓Šƒ“ƒNƒŠƒXƒg(block_prev,block_next) ‚ł‚Ȃª‚èA“¯‚¶ƒTƒC
- * ƒY‚ðŽ‚ƒuƒƒbƒN“¯Žm‚àƒŠƒ“ƒNƒŠƒXƒg(hash_prev,hash_nect) ‚ł‚È
- * ‚ª‚Á‚Ä‚¢‚Ü‚·B‚»‚ê‚É‚æ‚èA•s—v‚Æ‚È‚Á‚½ƒƒ‚ƒŠ‚ÌÄ—˜—p‚ªŒø—¦“I‚És‚¦‚Ü‚·B
+ * Lead-linked list (block_prev, block_next) in each other is the same size block
+ * Linked list (hash_prev, hash_nect) even among such one in the block with the figure
+ * I like to have. Thus, reuse of memory no longer needed can be performed efficiently.
*/
-/* ƒuƒƒbƒN‚̃Aƒ‰ƒCƒƒ“ƒg */
+/* Alignment of the block */
#define BLOCK_ALIGNMENT1 16
#define BLOCK_ALIGNMENT2 64
-/* ƒuƒƒbƒN‚É“ü‚éƒf[ƒ^—Ê */
+/* Amount of data entering a block */
#define BLOCK_DATA_COUNT1 128
#define BLOCK_DATA_COUNT2 608
-/* ƒuƒƒbƒN‚Ì‘å‚«‚³: 16*128 + 64*576 = 40KB */
+/* The size of the block: 16*128 + 64*576 = 40KB */
#define BLOCK_DATA_SIZE1 ( BLOCK_ALIGNMENT1 * BLOCK_DATA_COUNT1 )
#define BLOCK_DATA_SIZE2 ( BLOCK_ALIGNMENT2 * BLOCK_DATA_COUNT2 )
#define BLOCK_DATA_SIZE ( BLOCK_DATA_SIZE1 + BLOCK_DATA_SIZE2 )
-/* ˆê“x‚ÉŠm•Û‚·‚éƒuƒƒbƒN‚Ì”B */
+/* The number of blocks to be allocated at a time. */
#define BLOCK_ALLOC 104
-/* ƒuƒƒbƒN */
+/* block */
struct block {
- struct block* block_next; /* ŽŸ‚ÉŠm•Û‚µ‚½—̈æ */
- struct block* unfill_prev; /* ŽŸ‚Ì–„‚Ü‚Á‚Ä‚¢‚È‚¢—̈æ */
- struct block* unfill_next; /* ŽŸ‚Ì–„‚Ü‚Á‚Ä‚¢‚È‚¢—̈æ */
- unsigned short unit_size; /* ƒ†ƒjƒbƒg‚Ì‘å‚«‚³ */
- unsigned short unit_hash; /* ƒ†ƒjƒbƒg‚̃nƒbƒVƒ… */
- unsigned short unit_count; /* ƒ†ƒjƒbƒg‚̌” */
- unsigned short unit_used; /* Žg—pƒ†ƒjƒbƒg” */
- unsigned short unit_unfill; /* –¢Žg—pƒ†ƒjƒbƒg‚ÌêŠ */
- unsigned short unit_maxused; /* Žg—pƒ†ƒjƒbƒg‚ÌÅ‘å’l */
+ struct block* block_next; /* Then the allocated area */
+ struct block* unfill_prev; /* The previous area not filled */
+ struct block* unfill_next; /* The next area not filled */
+ unsigned short unit_size; /* The size of the unit */
+ unsigned short unit_hash; /* The hash of the unit */
+ unsigned short unit_count; /* The number of units */
+ unsigned short unit_used; /* The number of used units */
+ unsigned short unit_unfill; /* The number of unused units */
+ unsigned short unit_maxused; /* The maximum value of units used */
char data[ BLOCK_DATA_SIZE ];
};
@@ -187,7 +187,7 @@ struct unit_head {
static struct block* hash_unfill[BLOCK_DATA_COUNT1 + BLOCK_DATA_COUNT2 + 1];
static struct block* block_first, *block_last, block_head;
-/* ƒƒ‚ƒŠ‚ðŽg‚¢‰ñ‚¹‚È‚¢—̈æ—p‚̃f[ƒ^ */
+/* Data for areas that do not use the memory be turned */
struct unit_head_large {
size_t size;
struct unit_head_large* prev;
@@ -212,7 +212,7 @@ static unsigned short size2hash( size_t size )
return (unsigned short)(size - BLOCK_DATA_SIZE1 + BLOCK_ALIGNMENT2 - 1) / BLOCK_ALIGNMENT2
+ BLOCK_DATA_COUNT1;
} else {
- return 0xffff; // ƒuƒƒbƒN’·‚ð’´‚¦‚éê‡‚Í hash ‚É‚µ‚È‚¢
+ return 0xffff; // If it exceeds the block length hash I do not
}
}
@@ -241,8 +241,8 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
}
memmgr_usage_bytes += size;
- /* ƒuƒƒbƒN’·‚ð’´‚¦‚é—̈æ‚ÌŠm•Û‚É‚ÍAmalloc() ‚ð—p‚¢‚é */
- /* ‚»‚ÌÛAunit_head.block ‚É NULL ‚ð‘ã“ü‚µ‚Ä‹æ•Ê‚·‚é */
+ /* To ensure the area that exceeds the length of the block, using malloc () to */
+ /* At that time, the distinction by assigning NULL to unit_head.block */
if(hash2size(size_hash) > BLOCK_DATA_SIZE - sizeof(struct unit_head)) {
struct unit_head_large* p = (struct unit_head_large*)MALLOC(sizeof(struct unit_head_large)+size,file,line,func);
if(p != NULL) {
@@ -267,7 +267,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
}
}
- /* “¯ˆêƒTƒCƒY‚̃uƒƒbƒN‚ªŠm•Û‚³‚ê‚Ä‚¢‚È‚¢ŽžAV‚½‚ÉŠm•Û‚·‚é */
+ /* When a block of the same size is not ensured, to ensure a new */
if(hash_unfill[size_hash]) {
block = hash_unfill[size_hash];
} else {
@@ -275,7 +275,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
}
if( block->unit_unfill == 0xFFFF ) {
- // freeςݗ̈悪Žc‚Á‚Ä‚¢‚È‚¢
+ // there are no more free space that
memmgr_assert(block->unit_used < block->unit_count);
memmgr_assert(block->unit_used == block->unit_maxused);
head = block2unit(block, block->unit_maxused);
@@ -288,7 +288,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
}
if( block->unit_unfill == 0xFFFF && block->unit_maxused >= block->unit_count) {
- // ƒ†ƒjƒbƒg‚ðŽg‚¢‰Ê‚½‚µ‚½‚Ì‚ÅAunfillƒŠƒXƒg‚©‚çíœ
+ // Since I ran out of the unit, removed from the list unfill
if( block->unfill_prev == &block_head) {
hash_unfill[ size_hash ] = block->unfill_next;
} else {
@@ -349,10 +349,10 @@ void* _mrealloc(void *memblock, size_t size, const char *file, int line, const c
old_size = ((struct unit_head_large *)((char *)memblock - sizeof(struct unit_head_large) + sizeof(long)))->size;
}
if(old_size > size) {
- // ƒTƒCƒYk¬ -> ‚»‚Ì‚Ü‚Ü•Ô‚·iŽè”²‚«j
+ // Size reduction - return> as it is (negligence)
return memblock;
} else {
- // ƒTƒCƒYŠg‘å
+ // Size Large
void *p = _mmalloc(size,file,line,func);
if(p != NULL) {
memcpy(p,memblock,old_size);
@@ -383,7 +383,7 @@ void _mfree(void *ptr, const char *file, int line, const char *func )
head = (struct unit_head *)((char *)ptr - sizeof(struct unit_head) + sizeof(long));
if(head->size == 0) {
- /* malloc() ‚Å’¼‚ÉŠm•Û‚³‚ꂽ—̈æ */
+ /* area that is directly secured by malloc () */
struct unit_head_large *head_large = (struct unit_head_large *)((char *)ptr - sizeof(struct unit_head_large) + sizeof(long));
if(
*(long*)((char*)head_large + sizeof(struct unit_head_large) - sizeof(long) + head_large->size)
@@ -408,7 +408,7 @@ void _mfree(void *ptr, const char *file, int line, const char *func )
FREE(head_large,file,line,func);
}
} else {
- /* ƒ†ƒjƒbƒg‰ð•ú */
+ /* Release unit */
struct block *block = head->block;
if( (char*)head - (char*)block > sizeof(struct block) ) {
ShowError("Memory manager: args of aFree 0x%p is invalid pointer %s line %d\n", ptr, file, line);
@@ -426,11 +426,11 @@ void _mfree(void *ptr, const char *file, int line, const char *func )
#endif
memmgr_assert( block->unit_used > 0 );
if(--block->unit_used == 0) {
- /* ƒuƒƒbƒN‚̉ð•ú */
+ /* Release of the block */
block_free(block);
} else {
if( block->unfill_prev == NULL) {
- // unfill ƒŠƒXƒg‚ɒljÁ
+ // add to unfill list
if( hash_unfill[ block->unit_hash ] ) {
hash_unfill[ block->unit_hash ]->unfill_prev = block;
}
@@ -445,17 +445,17 @@ void _mfree(void *ptr, const char *file, int line, const char *func )
}
}
-/* ƒuƒƒbƒN‚ðŠm•Û‚·‚é */
+/* Allocating blocks */
static struct block* block_malloc(unsigned short hash)
{
int i;
struct block *p;
if(hash_unfill[0] != NULL) {
- /* ƒuƒƒbƒN—p‚̗̈æ‚ÍŠm•ÛÏ‚Ý */
+ /* Space for the block has already been secured */
p = hash_unfill[0];
hash_unfill[0] = hash_unfill[0]->unfill_next;
} else {
- /* ƒuƒƒbƒN—p‚̗̈æ‚ðV‚½‚ÉŠm•Û‚·‚é */
+ /* Newly allocated space for the block */
p = (struct block*)MALLOC(sizeof(struct block) * (BLOCK_ALLOC), __FILE__, __LINE__, __func__ );
if(p == NULL) {
ShowFatalError("Memory manager::block_alloc failed.\n");
@@ -463,17 +463,17 @@ static struct block* block_malloc(unsigned short hash)
}
if(block_first == NULL) {
- /* ‰‰ñŠm•Û */
+ /* First ensure */
block_first = p;
} else {
block_last->block_next = p;
}
block_last = &p[BLOCK_ALLOC - 1];
block_last->block_next = NULL;
- /* ƒuƒƒbƒN‚ð˜AŒ‹‚³‚¹‚é */
+ /* Linking the block */
for(i=0;i<BLOCK_ALLOC;i++) {
if(i != 0) {
- // p[0] ‚Í‚±‚ê‚©‚çŽg‚¤‚̂ŃŠƒ“ƒN‚ɂ͉Á‚¦‚È‚¢
+ // I do not add the link p [0], so we will use
p[i].unfill_next = hash_unfill[0];
hash_unfill[0] = &p[i];
p[i].unfill_prev = NULL;
@@ -485,7 +485,7 @@ static struct block* block_malloc(unsigned short hash)
}
}
- // unfill ‚ɒljÁ
+ // Add to unfill
memmgr_assert(hash_unfill[ hash ] == NULL);
hash_unfill[ hash ] = p;
p->unfill_prev = &block_head;
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 7d1928201..e19c8f94d 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -98,8 +98,9 @@
#define MAX_GUILDSKILL 15 // increased max guild skills because of new skills [Sara-chan]
#define MAX_GUILDLEVEL 50
#define MAX_GUARDIANS 8 //Local max per castle. [Skotlex]
-#define MAX_QUEST_DB 2350 //Max quests that the server will load
+#define MAX_QUEST_DB 2400 //Max quests that the server will load
#define MAX_QUEST_OBJECTIVES 3 //Max quest objectives for a quest
+#define MAX_START_ITEMS 32 //Max number of items allowed to be given to a char whenever it's created. [mkbu95]
// for produce
#define MIN_ATTRIBUTE 0
@@ -219,6 +220,12 @@ enum e_skill_flag
//...
};
+enum e_mmo_charstatus_opt {
+ OPT_NONE = 0x0,
+ OPT_SHOW_EQUIP = 0x1,
+ OPT_ALLOW_PARTY = 0x2,
+};
+
struct s_skill {
unsigned short id;
unsigned char lv;
@@ -378,7 +385,7 @@ struct mmo_charstatus {
#ifdef HOTKEY_SAVING
struct hotkey hotkeys[MAX_HOTKEYS];
#endif
- bool show_equip;
+ bool show_equip, allow_party;
unsigned short rename;
unsigned short slotchange;
diff --git a/src/config/const.h b/src/config/const.h
index abc36b05f..53f24da6f 100644
--- a/src/config/const.h
+++ b/src/config/const.h
@@ -19,8 +19,14 @@
#if SECURE_NPCTIMEOUT_INTERVAL <= 0
#error SECURE_NPCTIMEOUT_INTERVAL should be at least 1 (1s)
#endif
-#if SECURE_NPCTIMEOUT < 0
- #error SECURE_NPCTIMEOUT cannot be lower than 0
+#if NPC_SECURE_TIMEOUT_INPUT < 0
+ #error NPC_SECURE_TIMEOUT_INPUT cannot be lower than 0
+#endif
+#if NPC_SECURE_TIMEOUT_MENU < 0
+ #error NPC_SECURE_TIMEOUT_MENU cannot be lower than 0
+#endif
+#if NPC_SECURE_TIMEOUT_NEXT < 0
+ #error NPC_SECURE_TIMEOUT_NEXT cannot be lower than 0
#endif
/**
@@ -47,9 +53,9 @@
/* pointer size fix which fixes several gcc warnings */
#ifdef __64BIT__
- #define __64BPRTSIZE(y) (intptr)y
+ #define __64BPTRSIZE(y) (intptr)y
#else
- #define __64BPRTSIZE(y) y
+ #define __64BPTRSIZE(y) y
#endif
/* ATCMD_FUNC(mobinfo) HIT and FLEE calculations */
diff --git a/src/config/core.h b/src/config/core.h
index c9b1463de..bec6cb507 100644
--- a/src/config/core.h
+++ b/src/config/core.h
@@ -34,11 +34,6 @@
/// We kindly ask you to consider keeping it enabled, it helps us improve Hercules.
//#define STATS_OPT_OUT
-/// uncomment to enable query_sql script command and mysql logs to function on it's own thread
-/// be aware this feature is under tests and you should use at your own risk, we however
-/// welcome any feedback you may have regarding this feature, please send us all bug reports.
-//#define BETA_THREAD_TEST
-
/// Uncomment to enable the Cell Stack Limit mod.
/// It's only config is the battle_config cell_stack_limit.
/// Only chars affected are those defined in BL_CHAR (mobs and players currently)
@@ -51,6 +46,17 @@
/// - but is not the official behaviour.
//#define CIRCULAR_AREA
+//This is the distance at which @autoloot works,
+//if the item drops farther from the player than this,
+//it will not be autolooted. [Skotlex]
+//Note: The range is unlimited unless this define is set.
+//#define AUTOLOOT_DISTANCE AREA_SIZE
+
+/// Uncomment to switch the way map zones' "skill_damage_cap" functions.
+/// When commented the cap takes place before modifiers, as to have them be useful.
+/// When uncommented the cap takes place after modifiers.
+//#define HMAP_ZONE_DAMAGE_CAP_TYPE
+
/// Uncomment to enable Non Stackable items unique ID
/// By enabling it, the system will create an unique id for each new non stackable item created
//#define NSI_UNIQUE_ID
diff --git a/src/config/secure.h b/src/config/secure.h
index 70ee0437a..7f16ba55a 100644
--- a/src/config/secure.h
+++ b/src/config/secure.h
@@ -17,11 +17,27 @@
* Optional NPC Dialog Timer
* When enabled all npcs dialog will 'timeout' if user is on idle for longer than the amount of seconds allowed
* - On 'timeout' the npc dialog window changes its next/menu to a 'close' button
- * @values
- * - ? : Desired idle time in seconds (e.g. 10)
- * - 0 : Disabled
+ * Uncomment to enable
**/
-#define SECURE_NPCTIMEOUT 0
+//#define SECURE_NPCTIMEOUT
+
+/**
+ * number of seconds to 'timeout' if the user is on idle for longer than the value allowed after a 'input' field is displayed.
+ * default: 180
+ **/
+#define NPC_SECURE_TIMEOUT_INPUT 180
+
+/**
+ * number of seconds to 'timeout' if the user is on idle for longer than the value allowed after a 'menu' is displayed.
+ * default: 60
+ **/
+#define NPC_SECURE_TIMEOUT_MENU 60
+
+/**
+ * number of seconds to 'timeout' if the user is on idle for longer than the value allowed after a 'next' button is displayed.
+ * default: 60
+ **/
+#define NPC_SECURE_TIMEOUT_NEXT 60
/**
* (Secure) Optional NPC Dialog Timer
diff --git a/src/login/login.c b/src/login/login.c
index 16835d675..2b96eefec 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1131,8 +1131,8 @@ int mmo_auth(struct login_session_data* sd, bool isServer) {
// update session data
sd->account_id = acc.account_id;
- sd->login_id1 = rnd();
- sd->login_id2 = rnd();
+ sd->login_id1 = rnd() + 1;
+ sd->login_id2 = rnd() + 1;
safestrncpy(sd->lastlogin, acc.lastlogin, sizeof(sd->lastlogin));
sd->sex = acc.sex;
sd->group_id = acc.group_id;
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index a49a6edb4..bb99b6a05 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -17,7 +17,7 @@ MAP_OBJ = map.o chrif.o clif.o pc.o status.o npc.o \
storage.o skill.o atcommand.o battle.o battleground.o \
intif.o trade.o party.o vending.o guild.o pet.o \
log.o mail.o date.o unit.o homunculus.o mercenary.o quest.o instance.o \
- buyingstore.o searchstore.o duel.o pc_groups.o elemental.o
+ buyingstore.o searchstore.o duel.o pc_groups.o elemental.o irc-bot.o
MAP_SQL_OBJ = $(MAP_OBJ:%=obj_sql/%) \
obj_sql/mapreg_sql.o
MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \
@@ -27,7 +27,7 @@ MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \
log.h mail.h date.h unit.h homunculus.h mercenary.h quest.h instance.h mapreg.h \
buyingstore.h searchstore.h duel.h pc_groups.h \
../config/core.h ../config/renewal.h ../config/secure.h ../config/const.h \
- ../config/classes/general.h elemental.h packets.h
+ ../config/classes/general.h elemental.h packets.h packets_struct.h irc-bot.h
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d9c01b0fb..e9c8c5fba 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/cbasetypes.h"
#include "../common/mmo.h"
@@ -43,6 +44,7 @@
#include "unit.h"
#include "mapreg.h"
#include "quest.h"
+#include "searchstore.h"
#include <stdio.h>
#include <stdlib.h>
@@ -50,36 +52,11 @@
#include <math.h>
-#define ATCOMMAND_LENGTH 50
-#define ACMD_FUNC(x) static int atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message)
-#define MAX_MSG 1500
-
-
-typedef struct AtCommandInfo AtCommandInfo;
-typedef struct AliasInfo AliasInfo;
-
-int atcmd_binding_count = 0;
-
-struct AtCommandInfo {
- char command[ATCOMMAND_LENGTH];
- AtCommandFunc func;
- char* at_groups;/* quick @commands "can-use" lookup */
- char* char_groups;/* quick @charcommands "can-use" lookup */
-};
-
-struct AliasInfo {
- AtCommandInfo *command;
- char alias[ATCOMMAND_LENGTH];
-};
-
-
-char atcommand_symbol = '@'; // first char of the commands
-char charcommand_symbol = '#';
+#define ACMD(x) static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info)
static char* msg_table[MAX_MSG]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
static DBMap* atcommand_db = NULL; //name -> AtCommandInfo
static DBMap* atcommand_alias_db = NULL; //alias -> AtCommandInfo
-static config_t atcommand_config;
static char atcmd_output[CHAT_SIZE_MAX];
static char atcmd_player_name[NAME_LENGTH];
@@ -92,12 +69,12 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
struct atcmd_binding_data* get_atcommandbind_byname(const char* name) {
int i = 0;
- if( *name == atcommand_symbol || *name == charcommand_symbol )
+ if( *name == atcommand->at_symbol || *name == atcommand->char_symbol )
name++; // for backwards compatibility
- ARR_FIND( 0, atcmd_binding_count, i, strcmp(atcmd_binding[i]->command, name) == 0 );
+ ARR_FIND( 0, atcommand->binding_count, i, strcmp(atcommand->binding[i]->command, name) == 0 );
- return ( i < atcmd_binding_count ) ? atcmd_binding[i] : NULL;
+ return ( i < atcommand->binding_count ) ? atcommand->binding[i] : NULL;
}
//-----------------------------------------------------------
@@ -169,107 +146,79 @@ void do_final_msg(void)
/**
* retrieves the help string associated with a given command.
- *
- * @param name the name of the command to retrieve help information for
- * @return the string associated with the command, or NULL
*/
-static const char* atcommand_help_string(const char* command)
-{
- const char* str = NULL;
- config_setting_t* info;
-
- if( *command == atcommand_symbol || *command == charcommand_symbol )
- {// remove the prefix symbol for the raw name of the command
- command ++;
- }
-
- // convert alias to the real command name
- command = atcommand_checkalias(command);
-
- // attept to find the first default help command
- info = config_lookup(&atcommand_config, "help");
-
- if( info == NULL )
- {// failed to find the help property in the configuration file
- return NULL;
- }
-
- if( !config_setting_lookup_string( info, command, &str ) )
- {// failed to find the matching help string
- return NULL;
- }
-
- // push the result from the method
- return str;
+static inline const char* atcommand_help_string(AtCommandInfo *info) {
+ return info->help;
}
+
/*==========================================
* @send (used for testing packet sends from the client)
*------------------------------------------*/
-ACMD_FUNC(send)
+ACMD(send)
{
int len=0,off,end,type;
long num;
-
+
// read message type as hex number (without the 0x)
if(!message || !*message ||
- !((sscanf(message, "len %x", &type)==1 && (len=1))
- || sscanf(message, "%x", &type)==1) )
+ !((sscanf(message, "len %x", &type)==1 && (len=1))
+ || sscanf(message, "%x", &type)==1) )
{
int i;
for (i = 900; i <= 903; ++i)
clif->message(fd, msg_txt(i));
- return -1;
+ return false;
}
-
+
#define PARSE_ERROR(error,p) \
- {\
- clif->message(fd, (error));\
- sprintf(atcmd_output, ">%s", (p));\
- clif->message(fd, atcmd_output);\
- }
-//define PARSE_ERROR
-
+{\
+clif->message(fd, (error));\
+sprintf(atcmd_output, ">%s", (p));\
+clif->message(fd, atcmd_output);\
+}
+ //define PARSE_ERROR
+
#define CHECK_EOS(p) \
- if(*(p) == 0){\
- clif->message(fd, "Unexpected end of string");\
- return -1;\
- }
-//define CHECK_EOS
-
+if(*(p) == 0){\
+clif->message(fd, "Unexpected end of string");\
+return false;\
+}
+ //define CHECK_EOS
+
#define SKIP_VALUE(p) \
- {\
- while(*(p) && !ISSPACE(*(p))) ++(p); /* non-space */\
- while(*(p) && ISSPACE(*(p))) ++(p); /* space */\
- }
-//define SKIP_VALUE
-
+{\
+while(*(p) && !ISSPACE(*(p))) ++(p); /* non-space */\
+while(*(p) && ISSPACE(*(p))) ++(p); /* space */\
+}
+ //define SKIP_VALUE
+
#define GET_VALUE(p,num) \
- {\
- if(sscanf((p), "x%lx", &(num)) < 1 && sscanf((p), "%ld ", &(num)) < 1){\
- PARSE_ERROR("Invalid number in:",(p));\
- return -1;\
- }\
- }
-//define GET_VALUE
-
+{\
+if(sscanf((p), "x%lx", &(num)) < 1 && sscanf((p), "%ld ", &(num)) < 1){\
+PARSE_ERROR("Invalid number in:",(p));\
+return false;\
+}\
+}
+ //define GET_VALUE
+
if (type > 0 && type < MAX_PACKET_DB) {
-
+
if(len)
{// show packet length
sprintf(atcmd_output, msg_txt(904), type, packet_db[type].len); // Packet 0x%x length: %d
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
-
+
len=packet_db[type].len;
off=2;
if(len == 0)
{// unknown packet - ERROR
sprintf(atcmd_output, msg_txt(905), type); // Unknown packet: 0x%x
clif->message(fd, atcmd_output);
- return -1;
+ return false;
} else if(len == -1)
{// dynamic packet
len=SHRT_MAX-4; // maximum length
@@ -277,7 +226,7 @@ ACMD_FUNC(send)
}
WFIFOHEAD(fd, len);
WFIFOW(fd,0)=TOW(type);
-
+
// parse packet contents
SKIP_VALUE(message);
while(*message != 0 && off < len){
@@ -316,12 +265,12 @@ ACMD_FUNC(send)
{// find start of string
if(*message == 0 || ISSPACE(*message)){
PARSE_ERROR(msg_txt(906),message); // Not a string:
- return -1;
+ return false;
}
++message;
}
}
-
+
// parse string
++message;
CHECK_EOS(message);
@@ -346,7 +295,7 @@ ACMD_FUNC(send)
CHECK_EOS(message);
if(!ISXDIGIT(*message)){
PARSE_ERROR(msg_txt(907),message); // Not a hexadecimal digit:
- return -1;
+ return false;
}
num=(ISDIGIT(*message)?*message-'0':TOLOWER(*message)-'a'+10);
if(ISXDIGIT(*message)){
@@ -399,7 +348,7 @@ ACMD_FUNC(send)
++message;
CHECK_EOS(message);
}
-
+
// terminate the string
if(off < end)
{// fill the rest with 0's
@@ -409,11 +358,11 @@ ACMD_FUNC(send)
} else
{// unknown
PARSE_ERROR(msg_txt(908),message); // Unknown type of value in:
- return -1;
+ return false;
}
SKIP_VALUE(message);
}
-
+
if(packet_db[type].len == -1) {// send dynamic packet
WFIFOW(fd,2)=TOW(off);
WFIFOSET(fd,off);
@@ -424,11 +373,11 @@ ACMD_FUNC(send)
}
} else {
clif->message(fd, msg_txt(259)); // Invalid packet
- return -1;
+ return false;
}
sprintf (atcmd_output, msg_txt(258), type, type); // Sent packet 0x%x (%d)
clif->message(fd, atcmd_output);
- return 0;
+ return true;
#undef PARSE_ERROR
#undef CHECK_EOS
#undef SKIP_VALUE
@@ -438,34 +387,34 @@ ACMD_FUNC(send)
/*==========================================
* @rura, @warp, @mapmove
*------------------------------------------*/
-ACMD_FUNC(mapmove)
+ACMD(mapmove)
{
char map_name[MAP_NAME_LENGTH_EXT];
unsigned short mapindex;
short x = 0, y = 0;
int16 m = -1;
-
+
nullpo_retr(-1, sd);
-
+
memset(map_name, '\0', sizeof(map_name));
-
+
if (!message || !*message ||
(sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 &&
sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) {
-
+
clif->message(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).
- return -1;
- }
-
+ return false;
+ }
+
mapindex = mapindex_name2id(map_name);
if (mapindex)
m = map_mapindex2mapid(mapindex);
-
+
if (!mapindex) { // m < 0 means on different server! [Kevin]
clif->message(fd, msg_txt(1)); // Map not found.
- return -1;
+ return false;
}
-
+
if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS))
{ //This is to prevent the pc_setpos call from printing an error.
clif->message(fd, msg_txt(2));
@@ -474,138 +423,138 @@ ACMD_FUNC(mapmove)
}
if (map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(247));
- return -1;
+ return false;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(248));
- return -1;
+ return false;
}
if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) {
clif->message(fd, msg_txt(1)); // Map not found.
- return -1;
+ return false;
}
-
+
clif->message(fd, msg_txt(0)); // Warped.
- return 0;
+ return true;
}
/*==========================================
* Displays where a character is. Corrected version by Silent. [Skotlex]
*------------------------------------------*/
-ACMD_FUNC(where)
+ACMD(where)
{
struct map_session_data* pl_sd;
-
+
nullpo_retr(-1, sd);
memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_txt(910)); // Please enter a player name (usage: @where <char name>).
- return -1;
+ return false;
}
-
+
pl_sd = map_nick2sd(atcmd_player_name);
if (pl_sd == NULL ||
strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 ||
(pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID))
- ) {
+ ) {
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
snprintf(atcmd_output, sizeof atcmd_output, "%s %s %d %d", pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(jumpto)
+ACMD(jumpto)
{
struct map_session_data *pl_sd = NULL;
-
+
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto <char name/ID>).
- return -1;
+ return false;
}
-
+
if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
{
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
{
clif->message(fd, msg_txt(247)); // You are not authorized to warp to this map.
- return -1;
+ return false;
}
-
+
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
{
clif->message(fd, msg_txt(248)); // You are not authorized to warp from your current map.
- return -1;
+ return false;
}
-
+
if( pc_isdead(sd) )
{
clif->message(fd, msg_txt(664));
- return -1;
+ return false;
}
-
+
pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(jump)
+ACMD(jump)
{
short x = 0, y = 0;
-
+
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
sscanf(message, "%hd %hd", &x, &y);
-
+
if (map[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(248)); // You are not authorized to warp from your current map.
- return -1;
+ return false;
}
-
+
if( pc_isdead(sd) )
{
clif->message(fd, msg_txt(664));
- return -1;
+ return false;
}
-
+
if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS))
{ //This is to prevent the pc_setpos call from printing an error.
clif->message(fd, msg_txt(2));
if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1))
x = y = 0; //Invalid cell, use random spot.
}
-
+
pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT);
sprintf(atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
/*==========================================
* Display list of online characters with
* various info.
*------------------------------------------*/
-ACMD_FUNC(who)
+ACMD(who)
{
struct map_session_data *pl_sd = NULL;
struct s_mapiterator *iter = NULL;
@@ -621,24 +570,24 @@ ACMD_FUNC(who)
*/
int display_type = 1;
int map_id = -1;
-
+
nullpo_retr(-1, sd);
-
+
if (strstr(command, "map") != NULL) {
if (sscanf(message, "%15s %23s", map_name, player_name) < 1 || (map_id = map_mapname2mapid(map_name)) < 0)
map_id = sd->bl.m;
} else {
sscanf(message, "%23s", player_name);
}
-
+
if (strstr(command, "2") != NULL)
display_type = 2;
else if (strstr(command, "3") != NULL)
display_type = 3;
-
+
level = pc_get_group_level(sd);
StringBuf_Init(&buf);
-
+
iter = mapit_getallusers();
for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) {
if (!((pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) || (pl_sd->sc.option & OPTION_INVISIBLE)) && pc_get_group_level(pl_sd) > level)) { // you can look only lower or same level
@@ -651,7 +600,7 @@ ACMD_FUNC(who)
if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
StringBuf_Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
StringBuf_Printf(&buf, msg_txt(347), pl_sd->status.base_level, pl_sd->status.job_level,
- job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s"
+ job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s"
break;
}
case 3: {
@@ -666,7 +615,7 @@ ACMD_FUNC(who)
default: {
struct party_data *p = party_search(pl_sd->status.party_id);
struct guild *g = pl_sd->guild;
-
+
StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s "
if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
StringBuf_Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
@@ -683,7 +632,7 @@ ACMD_FUNC(who)
}
}
mapit_free(iter);
-
+
if (map_id < 0) {
if (count == 0)
StringBuf_Printf(&buf, msg_txt(28)); // No player found.
@@ -701,13 +650,13 @@ ACMD_FUNC(who)
}
clif->message(fd, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(whogm)
+ACMD(whogm)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
@@ -717,28 +666,28 @@ ACMD_FUNC(whogm)
char player_name[NAME_LENGTH];
struct guild *g;
struct party_data *p;
-
+
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(match_text, '\0', sizeof(match_text));
memset(player_name, '\0', sizeof(player_name));
-
+
if (sscanf(message, "%199[^\n]", match_text) < 1)
strcpy(match_text, "");
for (j = 0; match_text[j]; j++)
match_text[j] = TOLOWER(match_text[j]);
-
+
count = 0;
level = pc_get_group_level(sd);
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
pl_level = pc_get_group_level(pl_sd);
if (!pl_level)
continue;
-
+
if (match_text[0])
{
memcpy(player_name, pl_sd->status.name, NAME_LENGTH);
@@ -756,28 +705,28 @@ ACMD_FUNC(whogm)
count++;
continue;
}
-
+
sprintf(atcmd_output, msg_txt(914), // Name: %s (GM:%d) | Location: %s %d %d
- pl_sd->status.name, pl_level,
- mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
+ pl_sd->status.name, pl_level,
+ mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
clif->message(fd, atcmd_output);
-
+
sprintf(atcmd_output, msg_txt(915), // BLvl: %d | Job: %s (Lvl: %d)
- pl_sd->status.base_level,
- job_name(pl_sd->status.class_), pl_sd->status.job_level);
+ pl_sd->status.base_level,
+ job_name(pl_sd->status.class_), pl_sd->status.job_level);
clif->message(fd, atcmd_output);
-
+
p = party_search(pl_sd->status.party_id);
g = pl_sd->guild;
-
+
sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s'
- p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None.
-
+ p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None.
+
clif->message(fd, atcmd_output);
count++;
}
mapit_free(iter);
-
+
if (count == 0)
clif->message(fd, msg_txt(150)); // No GM found.
else if (count == 1)
@@ -786,167 +735,173 @@ ACMD_FUNC(whogm)
sprintf(atcmd_output, msg_txt(152), count); // %d GMs found.
clif->message(fd, atcmd_output);
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(save)
+ACMD(save)
{
nullpo_retr(-1, sd);
-
+
pc_setsavepoint(sd, sd->mapindex, sd->bl.x, sd->bl.y);
if (sd->status.pet_id > 0 && sd->pd)
intif_save_petdata(sd->status.account_id, &sd->pd->pet);
-
+
chrif_save(sd,0);
-
+
clif->message(fd, msg_txt(6)); // Your save point has been changed.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(load)
+ACMD(load)
{
int16 m;
-
+
nullpo_retr(-1, sd);
-
+
m = map_mapindex2mapid(sd->status.save_point.map);
if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(249)); // You are not authorized to warp to your save map.
- return -1;
+ return false;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(248)); // You are not authorized to warp from your current map.
- return -1;
+ return false;
}
-
+
pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT);
clif->message(fd, msg_txt(7)); // Warping to save point..
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(speed)
+ACMD(speed)
{
int speed;
-
+
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%d", &speed) < 1) {
sprintf(atcmd_output, msg_txt(918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>).
clif->message(fd, atcmd_output);
- return -1;
+ return false;
+ }
+
+ if (speed < 0) {
+ sd->base_status.speed = DEFAULT_WALK_SPEED;
+ sd->state.permanent_speed = 0; // Remove lock when set back to default speed.
+ } else {
+ sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);
+ sd->state.permanent_speed = 1; // Set lock when set to non-default speed.
}
-
- sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);
status_calc_bl(&sd->bl, SCB_SPEED);
clif->message(fd, msg_txt(8)); // Speed changed.
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(storage)
+ACMD(storage)
{
nullpo_retr(-1, sd);
-
+
if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag)
- return -1;
-
+ return false;
+
if (storage_storageopen(sd) == 1)
{ //Already open.
clif->message(fd, msg_txt(250));
- return -1;
+ return false;
}
-
+
clif->message(fd, msg_txt(919)); // Storage opened.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(guildstorage)
+ACMD(guildstorage)
{
nullpo_retr(-1, sd);
-
+
if (!sd->status.guild_id) {
clif->message(fd, msg_txt(252));
- return -1;
+ return false;
}
-
+
if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading)
- return -1;
-
+ return false;
+
if (sd->state.storage_flag == 1) {
clif->message(fd, msg_txt(250));
- return -1;
+ return false;
}
-
+
if (sd->state.storage_flag == 2) {
clif->message(fd, msg_txt(251));
- return -1;
+ return false;
}
-
+
storage_guild_storageopen(sd);
clif->message(fd, msg_txt(920)); // Guild storage opened.
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(option)
+ACMD(option)
{
int param1 = 0, param2 = 0, param3 = 0;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%d %d %d", &param1, &param2, &param3) < 1 || param1 < 0 || param2 < 0 || param3 < 0)
{// failed to match the parameters so inform the user of the options
const char* text;
-
+
// attempt to find the setting information for this command
- text = atcommand_help_string( command );
-
+ text = atcommand_help_string( info );
+
// notify the user of the requirement to enter an option
clif->message(fd, msg_txt(921)); // Please enter at least one option.
-
+
if( text )
{// send the help text associated with this command
clif->message( fd, text );
}
-
- return -1;
+
+ return false;
}
-
+
sd->sc.opt1 = param1;
sd->sc.opt2 = param2;
pc_setoption(sd, param3);
-
+
clif->message(fd, msg_txt(9)); // Options changed.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(hide)
+ACMD(hide)
{
nullpo_retr(-1, sd);
if (sd->sc.option & OPTION_INVISIBLE) {
@@ -956,10 +911,10 @@ ACMD_FUNC(hide)
else
status_set_viewdata(&sd->bl, sd->status.class_);
clif->message(fd, msg_txt(10)); // Invisible: Off
-
+
// increment the number of pvp players on the map
map[sd->bl.m].users_pvp++;
-
+
if( map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank )
{// register the player for ranking calculations
sd->pvp_timer = add_timer( gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0 );
@@ -970,10 +925,10 @@ ACMD_FUNC(hide)
sd->sc.option |= OPTION_INVISIBLE;
sd->vd.class_ = INVISIBLE_CLASS;
clif->message(fd, msg_txt(11)); // Invisible: On
-
+
// decrement the number of pvp players on the map
map[sd->bl.m].users_pvp--;
-
+
if( map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER )
{// unregister the player for ranking
delete_timer( sd->pvp_timer, pc_calc_pvprank_timer );
@@ -981,109 +936,119 @@ ACMD_FUNC(hide)
}
}
clif->changeoption(&sd->bl);
-
- return 0;
+
+ return true;
}
/*==========================================
* Changes a character's class
*------------------------------------------*/
-ACMD_FUNC(jobchange)
+ACMD(jobchange)
{
int job = 0, upper = 0;
const char* text;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%d %d", &job, &upper) < 1) {
- int i, found = 0;
-
- for (i = JOB_NOVICE; i < JOB_MAX; ++i) {
- if (strncmpi(message, job_name(i), 16) == 0) {
- job = i;
- upper = 0;
- found = 1;
- break;
+ int i;
+ bool found = false;
+
+ upper = 0;
+
+ // Normal Jobs
+ for( i = JOB_NOVICE; i < JOB_MAX_BASIC && !found; i++ ){
+ if (strncmpi(message, job_name(i), 16) == 0) {
+ job = i;
+ found = true;
}
}
-
+
+ // High Jobs, Babys and Third
+ for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){
+ if (strncmpi(message, job_name(i), 16) == 0) {
+ job = i;
+ found = true;
+ }
+ }
+
if (!found) {
- text = atcommand_help_string(command);
+ text = atcommand_help_string(info);
if (text)
clif->message(fd, text);
- return -1;
+ return false;
}
}
-
+
if (job == JOB_KNIGHT2 || job == JOB_CRUSADER2 || job == JOB_WEDDING || job == JOB_XMAS || job == JOB_SUMMER
|| job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2
- || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2)
- ) // Deny direct transformation into dummy jobs
- {clif->message(fd, msg_txt(923)); //"You can not change to this job by command."
- return 0;}
-
+ || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2)
+ ) // Deny direct transformation into dummy jobs
+ {clif->message(fd, msg_txt(923)); //"You can not change to this job by command."
+ return true;}
+
if (pcdb_checkid(job))
{
if (pc_jobchange(sd, job, upper) == 0)
clif->message(fd, msg_txt(12)); // Your job has been changed.
else {
clif->message(fd, msg_txt(155)); // You are unable to change your job.
- return -1;
+ return false;
}
} else {
- text = atcommand_help_string(command);
+ text = atcommand_help_string(info);
if (text)
clif->message(fd, text);
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(kill)
+ACMD(kill)
{
nullpo_retr(-1, sd);
status_kill(&sd->bl);
clif->message(sd->fd, msg_txt(13)); // A pity! You've died.
if (fd != sd->fd)
clif->message(fd, msg_txt(14)); // Character killed.
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(alive)
+ACMD(alive)
{
nullpo_retr(-1, sd);
if (!status_revive(&sd->bl, 100, 100))
{
clif->message(fd, msg_txt(667));
- return -1;
+ return false;
}
clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
clif->message(fd, msg_txt(16)); // You've been revived! It's a miracle!
- return 0;
+ return true;
}
/*==========================================
* +kamic [LuzZza]
*------------------------------------------*/
-ACMD_FUNC(kami)
+ACMD(kami)
{
unsigned long color=0;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if(*(command + 5) != 'c' && *(command + 5) != 'C') {
if (!message || !*message) {
clif->message(fd, msg_txt(980)); // Please enter a message (usage: @kami <message>).
- return -1;
+ return false;
}
-
+
sscanf(message, "%199[^\n]", atcmd_output);
if (strstr(command, "l") != NULL)
clif->broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP);
@@ -1092,22 +1057,22 @@ ACMD_FUNC(kami)
} else {
if(!message || !*message || (sscanf(message, "%lx %199[^\n]", &color, atcmd_output) < 2)) {
clif->message(fd, msg_txt(981)); // Please enter color and message (usage: @kamic <color> <message>).
- return -1;
+ return false;
}
-
+
if(color > 0xFFFFFF) {
clif->message(fd, msg_txt(982)); // Invalid color.
- return -1;
+ return false;
}
intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0);
}
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(heal)
+ACMD(heal)
{
int hp = 0, sp = 0; // [Valaris] thanks to fov
nullpo_retr(-1, sd);
@@ -1117,30 +1082,30 @@ ACMD_FUNC(heal)
// some overflow checks
if( hp == INT_MIN ) hp++;
if( sp == INT_MIN ) sp++;
-
+
if ( hp == 0 && sp == 0 ) {
if (!status_percent_heal(&sd->bl, 100, 100))
clif->message(fd, msg_txt(157)); // HP and SP have already been recovered.
else
clif->message(fd, msg_txt(17)); // HP, SP recovered.
- return 0;
+ return true;
}
-
+
if ( hp > 0 && sp >= 0 ) {
if(!status_heal(&sd->bl, hp, sp, 0))
clif->message(fd, msg_txt(157)); // HP and SP are already with the good value.
else
clif->message(fd, msg_txt(17)); // HP, SP recovered.
- return 0;
+ return true;
}
-
+
if ( hp < 0 && sp <= 0 ) {
status_damage(NULL, &sd->bl, -hp, -sp, 0, 0);
clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0);
clif->message(fd, msg_txt(156)); // HP or/and SP modified.
- return 0;
+ return true;
}
-
+
//Opposing signs.
if ( hp ) {
if (hp > 0)
@@ -1150,22 +1115,22 @@ ACMD_FUNC(heal)
clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0);
}
}
-
+
if ( sp ) {
if (sp > 0)
status_heal(&sd->bl, 0, sp, 0);
else
status_damage(NULL, &sd->bl, 0, -sp, 0, 0);
}
-
+
clif->message(fd, msg_txt(156)); // HP or/and SP modified.
- return 0;
+ return true;
}
/*==========================================
* @item command (usage: @item <name/id_of_item> <quantity>) (modified by [Yor] for pet_egg)
*------------------------------------------*/
-ACMD_FUNC(item)
+ACMD(item)
{
char item_name[100];
int number = 0, item_id, flag = 0;
@@ -1173,54 +1138,54 @@ ACMD_FUNC(item)
struct item_data *item_data;
int get_count, i;
nullpo_retr(-1, sd);
-
+
memset(item_name, '\0', sizeof(item_name));
-
+
if (!message || !*message || (
- sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
- sscanf(message, "%99s %d", item_name, &number) < 1
- )) {
+ sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
+ sscanf(message, "%99s %d", item_name, &number) < 1
+ )) {
clif->message(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>).
- return -1;
+ return false;
}
-
+
if (number <= 0)
number = 1;
-
+
if ((item_data = itemdb_searchname(item_name)) == NULL &&
(item_data = itemdb_exists(atoi(item_name))) == NULL)
{
clif->message(fd, msg_txt(19)); // Invalid item ID or name.
- return -1;
+ return false;
}
-
+
item_id = item_data->nameid;
get_count = number;
//Check if it's stackable.
if (!itemdb_isstackable2(item_data))
get_count = 1;
-
+
for (i = 0; i < number; i += get_count) {
// if not pet egg
if (!pet_create_egg(sd, item_id)) {
memset(&item_tmp, 0, sizeof(item_tmp));
item_tmp.nameid = item_id;
item_tmp.identify = 1;
-
+
if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
clif->additem(sd, 0, 0, flag);
}
}
-
+
if (flag == 0)
clif->message(fd, msg_txt(18)); // Item created.
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(item2)
+ACMD(item2)
{
struct item item_tmp;
struct item_data *item_data;
@@ -1229,26 +1194,26 @@ ACMD_FUNC(item2)
int identify = 0, refine = 0, attr = 0;
int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
nullpo_retr(-1, sd);
-
+
memset(item_name, '\0', sizeof(item_name));
-
+
if (!message || !*message || (
- sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 &&
- sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
- )) {
+ sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 &&
+ sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
+ )) {
clif->message(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity>
clif->message(fd, msg_txt(985)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>).
- return -1;
+ return false;
}
-
+
if (number <= 0)
number = 1;
-
+
item_id = 0;
if ((item_data = itemdb_searchname(item_name)) != NULL ||
(item_data = itemdb_exists(atoi(item_name))) != NULL)
item_id = item_data->nameid;
-
+
if (item_id > 500) {
int flag = 0;
int loop, get_count, i;
@@ -1283,59 +1248,59 @@ ACMD_FUNC(item2)
if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
clif->additem(sd, 0, 0, flag);
}
-
+
if (flag == 0)
clif->message(fd, msg_txt(18)); // Item created.
} else {
clif->message(fd, msg_txt(19)); // Invalid item ID or name.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(itemreset)
+ACMD(itemreset)
{
int i;
nullpo_retr(-1, sd);
-
+
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount && sd->status.inventory[i].equip == 0) {
pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND);
}
}
clif->message(fd, msg_txt(20)); // All of your items have been removed.
-
- return 0;
+
+ return true;
}
/*==========================================
* Atcommand @lvlup
*------------------------------------------*/
-ACMD_FUNC(baselevelup)
+ACMD(baselevelup)
{
int level=0, i=0, status_point=0;
nullpo_retr(-1, sd);
level = atoi(message);
-
+
if (!message || !*message || !level) {
clif->message(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>).
- return -1;
+ return false;
}
-
+
if (level > 0) {
if (sd->status.base_level >= pc_maxbaselv(sd)) { // check for max level by Valaris
clif->message(fd, msg_txt(47)); // Base level can't go any higher.
- return -1;
+ return false;
} // End Addition
if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow
level = pc_maxbaselv(sd) - sd->status.base_level;
for (i = 0; i < level; i++)
status_point += pc_gets_status_point(sd->status.base_level + i);
-
+
sd->status.status_point += status_point;
sd->status.base_level += (unsigned int)level;
status_percent_heal(&sd->bl, 100, 100);
@@ -1344,7 +1309,7 @@ ACMD_FUNC(baselevelup)
} else {
if (sd->status.base_level == 1) {
clif->message(fd, msg_txt(158)); // Base level can't go any lower.
- return -1;
+ return false;
}
level*=-1;
if ((unsigned int)level >= sd->status.base_level)
@@ -1369,27 +1334,27 @@ ACMD_FUNC(baselevelup)
pc_baselevelchanged(sd);
if(sd->status.party_id)
party_send_levelup(sd);
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(joblevelup)
+ACMD(joblevelup)
{
int level=0;
nullpo_retr(-1, sd);
-
+
level = atoi(message);
-
+
if (!message || !*message || !level) {
clif->message(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>).
- return -1;
+ return false;
}
if (level > 0) {
if (sd->status.job_level >= pc_maxjoblv(sd)) {
clif->message(fd, msg_txt(23)); // Job level can't go any higher.
- return -1;
+ return false;
}
if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow
level = pc_maxjoblv(sd) - sd->status.job_level;
@@ -1400,7 +1365,7 @@ ACMD_FUNC(joblevelup)
} else {
if (sd->status.job_level == 1) {
clif->message(fd, msg_txt(159)); // Job level can't go any lower.
- return -1;
+ return false;
}
level *=-1;
if ((unsigned int)level >= sd->status.job_level) // fix negativ overflow
@@ -1420,60 +1385,54 @@ ACMD_FUNC(joblevelup)
clif->updatestatus(sd, SP_NEXTJOBEXP);
clif->updatestatus(sd, SP_SKILLPOINT);
status_calc_pc(sd, 0);
-
- return 0;
+
+ return true;
}
/*==========================================
* @help
*------------------------------------------*/
-ACMD_FUNC(help)
-{
- config_setting_t *help;
- const char *text = NULL;
+ACMD(help) {
const char *command_name = NULL;
char *default_command = "help";
-
+ AtCommandInfo *tinfo = NULL;
+
nullpo_retr(-1, sd);
-
- help = config_lookup(&atcommand_config, "help");
- if (help == NULL) {
- clif->message(fd, msg_txt(27)); // "Commands help is not available."
- return -1;
- }
-
+
if (!message || !*message) {
command_name = default_command; // If no command_name specified, display help for @help.
} else {
- if (*message == atcommand_symbol || *message == charcommand_symbol)
+ if (*message == atcommand->at_symbol || *message == atcommand->char_symbol)
++message;
command_name = atcommand_checkalias(message);
}
-
- if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) {
+
+ if (!atcommand->can_use2(sd, command_name, COMMAND_ATCOMMAND)) {
sprintf(atcmd_output, msg_txt(153), message); // "%s is Unknown Command"
clif->message(fd, atcmd_output);
atcommand_get_suggestions(sd, command_name, true);
- return -1;
+ return false;
}
-
- if (!config_setting_lookup_string(help, command_name, &text)) {
- sprintf(atcmd_output, msg_txt(988), atcommand_symbol, command_name); // There is no help for %c%s.
+
+ tinfo = get_atcommandinfo_byname(atcommand_checkalias(command_name));
+
+ if ( !tinfo || tinfo->help == NULL ) {
+ sprintf(atcmd_output, msg_txt(988), atcommand->at_symbol, command_name); // There is no help for %c%s.
clif->message(fd, atcmd_output);
atcommand_get_suggestions(sd, command_name, true);
- return -1;
+ return false;
}
-
- sprintf(atcmd_output, msg_txt(989), atcommand_symbol, command_name); // Help for command %c%s:
+
+ sprintf(atcmd_output, msg_txt(989), atcommand->at_symbol, command_name); // Help for command %c%s:
clif->message(fd, atcmd_output);
-
+
{ // Display aliases
DBIterator* iter;
AtCommandInfo *command_info;
AliasInfo *alias_info = NULL;
StringBuf buf;
bool has_aliases = false;
-
+
StringBuf_Init(&buf);
StringBuf_AppendStr(&buf, msg_txt(990)); // Available aliases:
command_info = get_atcommandinfo_byname(command_name);
@@ -1489,10 +1448,10 @@ ACMD_FUNC(help)
clif->message(fd, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
}
-
+
// Display help contents
- clif->message(fd, text);
- return 0;
+ clif->message(fd, tinfo->help);
+ return true;
}
// helper function, used in foreach calls to stop auto-attack timers
@@ -1522,24 +1481,26 @@ static int atcommand_pvpoff_sub(struct block_list *bl,va_list ap)
return 0;
}
-ACMD_FUNC(pvpoff)
+ACMD(pvpoff)
{
nullpo_retr(-1, sd);
-
+
if (!map[sd->bl.m].flag.pvp) {
clif->message(fd, msg_txt(160)); // PvP is already Off.
- return -1;
+ return false;
}
-
+
map_zone_change2(sd->bl.m,map[sd->bl.m].prev_zone);
map[sd->bl.m].flag.pvp = 0;
-
- if (!battle_config.pk_mode)
+
+ if (!battle_config.pk_mode) {
clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
+ clif->maptypeproperty2(&sd->bl,ALL_SAMEMAP);
+ }
map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC);
map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
clif->message(fd, msg_txt(31)); // PvP: Off.
- return 0;
+ return true;
}
/*==========================================
@@ -1559,192 +1520,195 @@ static int atcommand_pvpon_sub(struct block_list *bl,va_list ap)
return 0;
}
-ACMD_FUNC(pvpon)
+ACMD(pvpon)
{
nullpo_retr(-1, sd);
-
+
if (map[sd->bl.m].flag.pvp) {
clif->message(fd, msg_txt(161)); // PvP is already On.
- return -1;
+ return false;
}
map_zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_PVP_NAME));
map[sd->bl.m].flag.pvp = 1;
-
+
if (!battle_config.pk_mode) {// display pvp circle and rank
clif->map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE);
+ clif->maptypeproperty2(&sd->bl,ALL_SAMEMAP);
map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC);
}
-
+
clif->message(fd, msg_txt(32)); // PvP: On.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(gvgoff)
+ACMD(gvgoff)
{
nullpo_retr(-1, sd);
-
+
if (!map[sd->bl.m].flag.gvg) {
clif->message(fd, msg_txt(162)); // GvG is already Off.
- return -1;
+ return false;
}
-
+
map_zone_change2(sd->bl.m,map[sd->bl.m].prev_zone);
map[sd->bl.m].flag.gvg = 0;
clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
+ clif->maptypeproperty2(&sd->bl,ALL_SAMEMAP);
map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
clif->message(fd, msg_txt(33)); // GvG: Off.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(gvgon)
+ACMD(gvgon)
{
nullpo_retr(-1, sd);
-
+
if (map[sd->bl.m].flag.gvg) {
clif->message(fd, msg_txt(163)); // GvG is already On.
- return -1;
+ return false;
}
map_zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_GVG_NAME));
map[sd->bl.m].flag.gvg = 1;
clif->map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE);
+ clif->maptypeproperty2(&sd->bl,ALL_SAMEMAP);
clif->message(fd, msg_txt(34)); // GvG: On.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(model)
+ACMD(model)
{
int hair_style = 0, hair_color = 0, cloth_color = 0;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) {
sprintf(atcmd_output, msg_txt(991), // Please enter at least one value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).
MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR);
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE &&
hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR &&
cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) {
- pc_changelook(sd, LOOK_HAIR, hair_style);
- pc_changelook(sd, LOOK_HAIR_COLOR, hair_color);
- pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color);
- clif->message(fd, msg_txt(36)); // Appearence changed.
+ pc_changelook(sd, LOOK_HAIR, hair_style);
+ pc_changelook(sd, LOOK_HAIR_COLOR, hair_color);
+ pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color);
+ clif->message(fd, msg_txt(36)); // Appearence changed.
} else {
clif->message(fd, msg_txt(37)); // An invalid number was specified.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @dye && @ccolor
*------------------------------------------*/
-ACMD_FUNC(dye)
+ACMD(dye)
{
int cloth_color = 0;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) {
sprintf(atcmd_output, msg_txt(992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) {
pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color);
clif->message(fd, msg_txt(36)); // Appearence changed.
} else {
clif->message(fd, msg_txt(37)); // An invalid number was specified.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @hairstyle && @hstyle
*------------------------------------------*/
-ACMD_FUNC(hair_style)
+ACMD(hair_style)
{
int hair_style = 0;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) {
sprintf(atcmd_output, msg_txt(993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) {
- pc_changelook(sd, LOOK_HAIR, hair_style);
- clif->message(fd, msg_txt(36)); // Appearence changed.
+ pc_changelook(sd, LOOK_HAIR, hair_style);
+ clif->message(fd, msg_txt(36)); // Appearence changed.
} else {
clif->message(fd, msg_txt(37)); // An invalid number was specified.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @haircolor && @hcolor
*------------------------------------------*/
-ACMD_FUNC(hair_color)
+ACMD(hair_color)
{
int hair_color = 0;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) {
sprintf(atcmd_output, msg_txt(994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) {
- pc_changelook(sd, LOOK_HAIR_COLOR, hair_color);
- clif->message(fd, msg_txt(36)); // Appearence changed.
+ pc_changelook(sd, LOOK_HAIR_COLOR, hair_color);
+ clif->message(fd, msg_txt(36)); // Appearence changed.
} else {
clif->message(fd, msg_txt(37)); // An invalid number was specified.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @go [city_number or city_name] - Updated by Harbin
*------------------------------------------*/
-ACMD_FUNC(go)
+ACMD(go)
{
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int16 m;
-
+
const struct {
char map[MAP_NAME_LENGTH];
int x, y;
@@ -1790,37 +1754,32 @@ ACMD_FUNC(go)
{ MAP_MALAYA, 242, 211 }, // 34=Malaya Port
{ MAP_ECLAGE, 110, 39 }, // 35=Eclage
};
-
+
nullpo_retr(-1, sd);
-
- if( map[sd->bl.m].flag.nogo && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) {
- clif->message(sd->fd,msg_txt(995)); // You cannot use @go on this map.
- return 0;
- }
-
+
memset(map_name, '\0', sizeof(map_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
// get the number
town = atoi(message);
-
+
if (!message || !*message || sscanf(message, "%11s", map_name) < 1 || town < 0 || town >= ARRAYLENGTH(data))
{// no value matched so send the list of locations
const char* text;
-
+
// attempt to find the text help string
- text = atcommand_help_string( command );
-
+ text = atcommand_help_string( info );
+
clif->message(fd, msg_txt(38)); // Invalid location number, or name.
-
+
if( text )
{// send the text to the client
clif->message( fd, text );
}
-
- return -1;
+
+ return false;
}
-
+
// get possible name of the city
map_name[MAP_NAME_LENGTH-1] = '\0';
for (i = 0; map_name[i]; i++)
@@ -1909,36 +1868,36 @@ ACMD_FUNC(go)
} else if (strncmp(map_name, "eclage", 3) == 0) {
town = 35;
}
-
+
if (town >= 0 && town < ARRAYLENGTH(data))
{
m = map_mapname2mapid(data[town].map);
if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(247));
- return -1;
+ return false;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(248));
- return -1;
+ return false;
}
if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) {
clif->message(fd, msg_txt(0)); // Warped.
} else {
clif->message(fd, msg_txt(1)); // Map not found.
- return -1;
+ return false;
}
} else { // if you arrive here, you have an error in town variable when reading of names
clif->message(fd, msg_txt(38)); // Invalid location number or name.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(monster)
+ACMD(monster)
{
char name[NAME_LENGTH];
char monster[NAME_LENGTH];
@@ -1950,14 +1909,14 @@ ACMD_FUNC(monster)
short mx, my;
unsigned int size;
nullpo_retr(-1, sd);
-
+
memset(name, '\0', sizeof(name));
memset(monster, '\0', sizeof(monster));
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message) {
- clif->message(fd, msg_txt(80)); // Give the display name or monster name/id please.
- return -1;
+ clif->message(fd, msg_txt(80)); // Give the display name or monster name/id please.
+ return false;
}
if (sscanf(message, "\"%23[^\"]\" %23s %d", name, monster, &number) > 1 ||
sscanf(message, "%23s \"%23[^\"]\" %d", monster, name, &number) > 1) {
@@ -1973,42 +1932,42 @@ ACMD_FUNC(monster)
name[0] = '\0';
} else {
clif->message(fd, msg_txt(80)); // Give a display name and monster name/id please.
- return -1;
+ return false;
}
-
+
if ((mob_id = mobdb_searchname(monster)) == 0) // check name first (to avoid possible name begining by a number)
mob_id = mobdb_checkid(atoi(monster));
-
+
if (mob_id == 0) {
clif->message(fd, msg_txt(40)); // Invalid monster ID or name.
- return -1;
+ return false;
}
-
+
if (mob_id == MOBID_EMPERIUM) {
clif->message(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned.
- return -1;
+ return false;
}
-
+
if (number <= 0)
number = 1;
-
+
if( !name[0] )
strcpy(name, "--ja--");
-
+
// If value of atcommand_spawn_quantity_limit directive is greater than or equal to 1 and quantity of monsters is greater than value of the directive
if (battle_config.atc_spawn_quantity_limit && number > battle_config.atc_spawn_quantity_limit)
number = battle_config.atc_spawn_quantity_limit;
-
+
if (strcmp(command+1, "monstersmall") == 0)
size = SZ_MEDIUM; // This is just gorgeous [mkbu95]
else if (strcmp(command+1, "monsterbig") == 0)
size = SZ_BIG;
else
size = SZ_SMALL;
-
+
if (battle_config.etc_log)
ShowInfo("%s monster='%s' name='%s' id=%d count=%d (%d,%d)\n", command, monster, name, mob_id, number, sd->bl.x, sd->bl.y);
-
+
count = 0;
range = (int)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around)
for (i = 0; i < number; i++) {
@@ -2016,7 +1975,7 @@ ACMD_FUNC(monster)
k = mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE);
count += (k != 0) ? 1 : 0;
}
-
+
if (count != 0)
if (number == count)
clif->message(fd, msg_txt(39)); // All monster summoned!
@@ -2024,12 +1983,12 @@ ACMD_FUNC(monster)
sprintf(atcmd_output, msg_txt(240), count); // %d monster(s) summoned!
clif->message(fd, atcmd_output);
}
- else {
- clif->message(fd, msg_txt(40)); // Invalid monster ID or name.
- return -1;
- }
-
- return 0;
+ else {
+ clif->message(fd, msg_txt(40)); // Invalid monster ID or name.
+ return false;
+ }
+
+ return true;
}
/*==========================================
@@ -2039,13 +1998,13 @@ static int atkillmonster_sub(struct block_list *bl, va_list ap)
{
struct mob_data *md;
int flag;
-
+
nullpo_ret(md=(struct mob_data *)bl);
flag = va_arg(ap, int);
-
+
if (md->guardian_data)
return 0; //Do not touch WoE mobs!
-
+
if (flag)
status_zap(bl,md->status.hp, 0);
else
@@ -2053,41 +2012,41 @@ static int atkillmonster_sub(struct block_list *bl, va_list ap)
return 1;
}
-ACMD_FUNC(killmonster)
+ACMD(killmonster)
{
int map_id, drop_flag;
char map_name[MAP_NAME_LENGTH_EXT];
nullpo_retr(-1, sd);
-
+
memset(map_name, '\0', sizeof(map_name));
-
+
if (!message || !*message || sscanf(message, "%15s", map_name) < 1)
map_id = sd->bl.m;
else {
if ((map_id = map_mapname2mapid(map_name)) < 0)
map_id = sd->bl.m;
}
-
+
drop_flag = strcmp(command+1, "killmonster2");
-
+
map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag);
-
+
clif->message(fd, msg_txt(165)); // All monsters killed!
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(refine)
+ACMD(refine)
{
int i,j, position = 0, refine = 0, current_position, final_refine;
int count;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) {
clif->message(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>).
sprintf(atcmd_output, msg_txt(997), EQP_HEAD_LOW); // %d: Lower Headgear
@@ -2110,11 +2069,11 @@ ACMD_FUNC(refine)
clif->message(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1006), EQP_HEAD_MID); // %d: Mid Headgear
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
refine = cap_value(refine, -MAX_REFINE, MAX_REFINE);
-
+
count = 0;
for (j = 0; j < EQI_MAX-1; j++) {
if ((i = sd->equip_index[j]) < 0)
@@ -2125,10 +2084,10 @@ ACMD_FUNC(refine)
continue;
if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == i || sd->equip_index[EQI_HEAD_LOW] == i))
continue;
-
+
if(position && !(sd->status.inventory[i].equip & position))
continue;
-
+
final_refine = cap_value(sd->status.inventory[i].refine + refine, 0, MAX_REFINE);
if (sd->status.inventory[i].refine != final_refine) {
sd->status.inventory[i].refine = final_refine;
@@ -2142,7 +2101,7 @@ ACMD_FUNC(refine)
count++;
}
}
-
+
if (count == 0)
clif->message(fd, msg_txt(166)); // No item has been refined.
else if (count == 1)
@@ -2151,40 +2110,40 @@ ACMD_FUNC(refine)
sprintf(atcmd_output, msg_txt(168), count); // %d items have been refined.
clif->message(fd, atcmd_output);
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(produce)
+ACMD(produce)
{
char item_name[100];
int item_id, attribute = 0, star = 0;
struct item_data *item_data;
struct item tmp_item;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(item_name, '\0', sizeof(item_name));
-
+
if (!message || !*message || (
- sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 &&
- sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1
- )) {
+ sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 &&
+ sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1
+ )) {
clif->message(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>).
- return -1;
+ return false;
}
-
+
if ( (item_data = itemdb_searchname(item_name)) == NULL &&
- (item_data = itemdb_exists(atoi(item_name))) == NULL ) {
+ (item_data = itemdb_exists(atoi(item_name))) == NULL ) {
clif->message(fd, msg_txt(170)); //This item is not an equipment.
- return -1;
+ return false;
}
-
+
item_id = item_data->nameid;
-
+
if (itemdb_isequip2(item_data)) {
int flag = 0;
if (attribute < MIN_ATTRIBUTE || attribute > MAX_ATTRIBUTE)
@@ -2197,33 +2156,33 @@ ACMD_FUNC(produce)
tmp_item.identify = 1;
tmp_item.card[0] = CARD0_FORGE;
tmp_item.card[1] = item_data->type==IT_WEAPON?
- ((star*5) << 8) + attribute:0;
+ ((star*5) << 8) + attribute:0;
tmp_item.card[2] = GetWord(sd->status.char_id, 0);
tmp_item.card[3] = GetWord(sd->status.char_id, 1);
clif->produce_effect(sd, 0, item_id);
clif->misceffect(&sd->bl, 3);
-
+
if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND)))
clif->additem(sd, 0, 0, flag);
} else {
sprintf(atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable.
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(memo)
+ACMD(memo)
{
int position = 0;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if( !message || !*message || sscanf(message, "%d", &position) < 1 )
{
int i;
@@ -2236,78 +2195,78 @@ ACMD_FUNC(memo)
sprintf(atcmd_output, msg_txt(171), i); // %d - void
clif->message(sd->fd, atcmd_output);
}
- return 0;
+ return true;
}
-
+
if( position < 0 || position >= MAX_MEMOPOINTS )
{
sprintf(atcmd_output, msg_txt(1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo <memo_position:%d-%d>).
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
pc_memo(sd, position);
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(gat)
+ACMD(gat)
{
int y;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
for (y = 2; y >= -2; y--) {
sprintf(atcmd_output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X",
- map[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y,
- map_getcell(sd->bl.m, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE),
- map_getcell(sd->bl.m, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE),
- map_getcell(sd->bl.m, sd->bl.x, sd->bl.y + y, CELL_GETTYPE),
- map_getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
- map_getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
-
+ map[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y,
+ map_getcell(sd->bl.m, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE),
+ map_getcell(sd->bl.m, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE),
+ map_getcell(sd->bl.m, sd->bl.x, sd->bl.y + y, CELL_GETTYPE),
+ map_getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
+ map_getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
+
clif->message(fd, atcmd_output);
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(displaystatus)
+ACMD(displaystatus)
{
int i, type, flag, tick, val1 = 0, val2 = 0, val3 = 0;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) {
clif->message(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}).
- return -1;
+ return false;
}
if (i < 2) flag = 1;
if (i < 3) tick = 0;
-
+
clif->status_change(&sd->bl, type, flag, tick, val1, val2, val3);
-
- return 0;
+
+ return true;
}
/*==========================================
* @stpoint (Rewritten by [Yor])
*------------------------------------------*/
-ACMD_FUNC(statuspoint)
+ACMD(statuspoint)
{
int point;
unsigned int new_status_point;
-
+
if (!message || !*message || (point = atoi(message)) == 0) {
clif->message(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint <number of points>).
- return -1;
+ return false;
}
-
+
if(point < 0)
{
if(sd->status.status_point < (unsigned int)(-point))
@@ -2327,7 +2286,7 @@ ACMD_FUNC(statuspoint)
{
new_status_point = sd->status.status_point + point;
}
-
+
if (new_status_point != sd->status.status_point) {
sd->status.status_point = new_status_point;
clif->updatestatus(sd, SP_STATUSPOINT);
@@ -2337,26 +2296,26 @@ ACMD_FUNC(statuspoint)
clif->message(fd, msg_txt(41)); // Unable to decrease the number/value.
else
clif->message(fd, msg_txt(149)); // Unable to increase the number/value.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @skpoint (Rewritten by [Yor])
*------------------------------------------*/
-ACMD_FUNC(skillpoint)
+ACMD(skillpoint)
{
int point;
unsigned int new_skill_point;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || (point = atoi(message)) == 0) {
clif->message(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint <number of points>).
- return -1;
+ return false;
}
-
+
if(point < 0)
{
if(sd->status.skill_point < (unsigned int)(-point))
@@ -2376,7 +2335,7 @@ ACMD_FUNC(skillpoint)
{
new_skill_point = sd->status.skill_point + point;
}
-
+
if (new_skill_point != sd->status.skill_point) {
sd->status.skill_point = new_skill_point;
clif->updatestatus(sd, SP_SKILLPOINT);
@@ -2386,75 +2345,75 @@ ACMD_FUNC(skillpoint)
clif->message(fd, msg_txt(41)); // Unable to decrease the number/value.
else
clif->message(fd, msg_txt(149)); // Unable to increase the number/value.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @zeny
*------------------------------------------*/
-ACMD_FUNC(zeny)
+ACMD(zeny)
{
int zeny=0, ret=-1;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || (zeny = atoi(message)) == 0) {
clif->message(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny <amount>).
- return -1;
+ return false;
}
-
+
if(zeny > 0){
if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1)
- clif->message(fd, msg_txt(149)); // Unable to increase the number/value.
+ clif->message(fd, msg_txt(149)); // Unable to increase the number/value.
}
else {
if( sd->status.zeny < -zeny ) zeny = -sd->status.zeny;
if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1)
- clif->message(fd, msg_txt(41)); // Unable to decrease the number/value.
+ clif->message(fd, msg_txt(41)); // Unable to decrease the number/value.
}
if(!ret) clif->message(fd, msg_txt(176)); //ret=0 mean cmd success
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(param)
+ACMD(param)
{
int i, value = 0, new_value, max;
const char* param[] = { "str", "agi", "vit", "int", "dex", "luk" };
short* status[6];
//we don't use direct initialization because it isn't part of the c standard.
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
clif->message(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
- return -1;
+ return false;
}
-
+
ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 );
-
+
if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible...
clif->message(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
- return -1;
+ return false;
}
-
+
status[0] = &sd->status.str;
status[1] = &sd->status.agi;
status[2] = &sd->status.vit;
status[3] = &sd->status.int_;
status[4] = &sd->status.dex;
status[5] = &sd->status.luk;
-
+
if( battle_config.atcommand_max_stat_bypass )
max = SHRT_MAX;
else
max = pc_maxparameter(sd);
-
+
if(value < 0 && *status[i] <= -value) {
new_value = 1;
} else if(max - *status[i] < value) {
@@ -2462,7 +2421,7 @@ ACMD_FUNC(param)
} else {
new_value = *status[i] + value;
}
-
+
if (new_value != *status[i]) {
*status[i] = new_value;
clif->updatestatus(sd, SP_STR + i);
@@ -2474,29 +2433,29 @@ ACMD_FUNC(param)
clif->message(fd, msg_txt(41)); // Unable to decrease the number/value.
else
clif->message(fd, msg_txt(149)); // Unable to increase the number/value.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Stat all by fritz (rewritten by [Yor])
*------------------------------------------*/
-ACMD_FUNC(stat_all)
+ACMD(stat_all)
{
int index, count, value, max, new_value;
short* status[6];
//we don't use direct initialization because it isn't part of the c standard.
nullpo_retr(-1, sd);
-
+
status[0] = &sd->status.str;
status[1] = &sd->status.agi;
status[2] = &sd->status.vit;
status[3] = &sd->status.int_;
status[4] = &sd->status.dex;
status[5] = &sd->status.luk;
-
+
if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
value = pc_maxparameter(sd);
max = pc_maxparameter(sd);
@@ -2506,17 +2465,17 @@ ACMD_FUNC(stat_all)
else
max = pc_maxparameter(sd);
}
-
+
count = 0;
for (index = 0; index < ARRAYLENGTH(status); index++) {
-
+
if (value > 0 && *status[index] > max - value)
new_value = max;
else if (value < 0 && *status[index] <= -value)
new_value = 1;
else
new_value = *status[index] +value;
-
+
if (new_value != (int)*status[index]) {
*status[index] = new_value;
clif->updatestatus(sd, SP_STR + index);
@@ -2524,7 +2483,7 @@ ACMD_FUNC(stat_all)
count++;
}
}
-
+
if (count > 0) { // if at least 1 stat modified
status_calc_pc(sd, 0);
clif->message(fd, msg_txt(84)); // All stats changed!
@@ -2533,268 +2492,268 @@ ACMD_FUNC(stat_all)
clif->message(fd, msg_txt(177)); // You cannot decrease that stat anymore.
else
clif->message(fd, msg_txt(178)); // You cannot increase that stat anymore.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(guildlevelup)
+ACMD(guildlevelup)
{
int level = 0;
short added_level;
struct guild *guild_info;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%d", &level) < 1 || level == 0) {
clif->message(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>).
- return -1;
+ return false;
}
-
+
if (sd->status.guild_id <= 0 || (guild_info = sd->guild) == NULL) {
clif->message(fd, msg_txt(43)); // You're not in a guild.
- return -1;
+ return false;
}
//if (strcmp(sd->status.name, guild_info->master) != 0) {
// clif->message(fd, msg_txt(44)); // You're not the master of your guild.
- // return -1;
+ // return false;
//}
-
+
added_level = (short)level;
if (level > 0 && (level > MAX_GUILDLEVEL || added_level > ((short)MAX_GUILDLEVEL - guild_info->guild_lv))) // fix positiv overflow
added_level = (short)MAX_GUILDLEVEL - guild_info->guild_lv;
else if (level < 0 && (level < -MAX_GUILDLEVEL || added_level < (1 - guild_info->guild_lv))) // fix negativ overflow
added_level = 1 - guild_info->guild_lv;
-
+
if (added_level != 0) {
intif_guild_change_basicinfo(guild_info->guild_id, GBI_GUILDLV, &added_level, sizeof(added_level));
clif->message(fd, msg_txt(179)); // Guild level changed.
} else {
clif->message(fd, msg_txt(45)); // Guild level change failed.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(makeegg)
+ACMD(makeegg)
{
struct item_data *item_data;
int id, pet_id;
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg <pet>).
- return -1;
+ return false;
}
-
+
if ((item_data = itemdb_searchname(message)) != NULL) // for egg name
id = item_data->nameid;
else
- if ((id = mobdb_searchname(message)) != 0) // for monster name
- ;
- else
- id = atoi(message);
-
+ if ((id = mobdb_searchname(message)) != 0) // for monster name
+ ;
+ else
+ id = atoi(message);
+
pet_id = search_petDB_index(id, PET_CLASS);
if (pet_id < 0)
pet_id = search_petDB_index(id, PET_EGG);
if (pet_id >= 0) {
sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(
- sd->status.account_id, sd->status.char_id,
- (short)pet_db[pet_id].class_, (short)mob_db(pet_db[pet_id].class_)->lv,
- (short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate,
- 100, 0, 1, pet_db[pet_id].jname);
+ sd->status.account_id, sd->status.char_id,
+ (short)pet_db[pet_id].class_, (short)mob_db(pet_db[pet_id].class_)->lv,
+ (short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate,
+ 100, 0, 1, pet_db[pet_id].jname);
} else {
clif->message(fd, msg_txt(180)); // The monster/egg name/id doesn't exist.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(hatch)
+ACMD(hatch)
{
nullpo_retr(-1, sd);
if (sd->status.pet_id <= 0)
clif->sendegg(sd);
else {
clif->message(fd, msg_txt(181)); // You already have a pet.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(petfriendly)
+ACMD(petfriendly)
{
int friendly;
struct pet_data *pd;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || (friendly = atoi(message)) < 0) {
clif->message(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>).
- return -1;
+ return false;
}
-
+
pd = sd->pd;
if (!pd) {
clif->message(fd, msg_txt(184)); // Sorry, but you have no pet.
- return -1;
+ return false;
}
-
+
if (friendly < 0 || friendly > 1000)
{
clif->message(fd, msg_txt(37)); // An invalid number was specified.
- return -1;
+ return false;
}
-
+
if (friendly == pd->pet.intimate) {
clif->message(fd, msg_txt(183)); // Pet intimacy is already at maximum.
- return -1;
+ return false;
}
-
+
pet_set_intimate(pd, friendly);
clif->send_petstatus(sd);
clif->message(fd, msg_txt(182)); // Pet intimacy changed.
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(pethungry)
+ACMD(pethungry)
{
int hungry;
struct pet_data *pd;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || (hungry = atoi(message)) < 0) {
clif->message(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>).
- return -1;
+ return false;
}
-
+
pd = sd->pd;
if (!sd->status.pet_id || !pd) {
clif->message(fd, msg_txt(184)); // Sorry, but you have no pet.
- return -1;
+ return false;
}
if (hungry < 0 || hungry > 100) {
clif->message(fd, msg_txt(37)); // An invalid number was specified.
- return -1;
+ return false;
}
if (hungry == pd->pet.hungry) {
clif->message(fd, msg_txt(186)); // Pet hunger is already at maximum.
- return -1;
+ return false;
}
-
+
pd->pet.hungry = hungry;
clif->send_petstatus(sd);
clif->message(fd, msg_txt(185)); // Pet hunger changed.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(petrename)
+ACMD(petrename)
{
struct pet_data *pd;
nullpo_retr(-1, sd);
if (!sd->status.pet_id || !sd->pd) {
clif->message(fd, msg_txt(184)); // Sorry, but you have no pet.
- return -1;
+ return false;
}
pd = sd->pd;
if (!pd->pet.rename_flag) {
clif->message(fd, msg_txt(188)); // You can already rename your pet.
- return -1;
+ return false;
}
-
+
pd->pet.rename_flag = 0;
intif_save_petdata(sd->status.account_id, &pd->pet);
clif->send_petstatus(sd);
clif->message(fd, msg_txt(187)); // You can now rename your pet.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(recall) {
+ACMD(recall) {
struct map_session_data *pl_sd = NULL;
-
+
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1018)); // Please enter a player name (usage: @recall <char name/ID>).
- return -1;
+ return false;
}
-
+
if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
{
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
{
clif->message(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player.
- return -1;
+ return false;
}
-
+
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(1019)); // You are not authorized to warp someone to this map.
- return -1;
+ return false;
}
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(1020)); // You are not authorized to warp this player from their map.
- return -1;
+ return false;
}
if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) {
- return -1;
+ return false;
}
pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
sprintf(atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled!
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
/*==========================================
* charblock command (usage: charblock <player_name>)
* This command do a definitiv ban on a player
*------------------------------------------*/
-ACMD_FUNC(char_block)
+ACMD(char_block)
{
nullpo_retr(-1, sd);
-
+
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block <char name>).
- return -1;
+ return false;
}
-
+
chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block
clif->message(fd, msg_txt(88)); // Character name sent to char-server to ask it.
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -2812,24 +2771,24 @@ ACMD_FUNC(char_block)
* <example> @ban +1m-2mn1s-6y test_player
* this example adds 1 month and 1 second, and substracts 2 minutes and 6 years at the same time.
*------------------------------------------*/
-ACMD_FUNC(char_ban)
+ACMD(char_ban)
{
char * modif_p;
int year, month, day, hour, minute, second, value;
time_t timestamp;
struct tm *tmtime;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
-
+
if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) {
clif->message(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>).
- return -1;
+ return false;
}
-
+
atcmd_output[sizeof(atcmd_output)-1] = '\0';
-
+
modif_p = atcmd_output;
year = month = day = hour = minute = second = 0;
while (modif_p[0] != '\0') {
@@ -2869,7 +2828,7 @@ ACMD_FUNC(char_ban)
}
if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0 && second == 0) {
clif->message(fd, msg_txt(85)); // Invalid time for ban command.
- return -1;
+ return false;
}
/**
* We now check if you can adjust the ban to negative (and if this is the case)
@@ -2883,103 +2842,103 @@ ACMD_FUNC(char_ban)
tmtime->tm_min = tmtime->tm_min + minute;
tmtime->tm_sec = tmtime->tm_sec + second;
timestamp = mktime(tmtime);
- if( timestamp <= time(NULL) && !pc_can_use_command(sd, "unban", COMMAND_ATCOMMAND) ) {
+ if( timestamp <= time(NULL) && !pc_can_use_command(sd, "@unban") ) {
clif->message(fd,msg_txt(1023)); // You are not allowed to reduce the length of a ban.
- return -1;
+ return false;
}
-
+
chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 2, year, month, day, hour, minute, second); // type: 2 - ban
clif->message(fd, msg_txt(88)); // Character name sent to char-server to ask it.
-
- return 0;
+
+ return true;
}
/*==========================================
* charunblock command (usage: charunblock <player_name>)
*------------------------------------------*/
-ACMD_FUNC(char_unblock)
+ACMD(char_unblock)
{
nullpo_retr(-1, sd);
-
+
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_txt(1024)); // Please enter a player name (usage: @charunblock <char name>).
- return -1;
+ return false;
}
-
+
// send answer to login server via char-server
chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 3, 0, 0, 0, 0, 0, 0); // type: 3 - unblock
clif->message(fd, msg_txt(88)); // Character name sent to char-server to ask it.
-
- return 0;
+
+ return true;
}
/*==========================================
* charunban command (usage: charunban <player_name>)
*------------------------------------------*/
-ACMD_FUNC(char_unban)
+ACMD(char_unban)
{
nullpo_retr(-1, sd);
-
+
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_txt(1025)); // Please enter a player name (usage: @charunban <char name>).
- return -1;
+ return false;
}
-
+
// send answer to login server via char-server
chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 4, 0, 0, 0, 0, 0, 0); // type: 4 - unban
clif->message(fd, msg_txt(88)); // Character name sent to char-server to ask it.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(night)
+ACMD(night)
{
nullpo_retr(-1, sd);
-
+
if (night_flag != 1) {
map_night_timer(night_timer_tid, 0, 0, 1);
} else {
clif->message(fd, msg_txt(89)); // Night mode is already enabled.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(day)
+ACMD(day)
{
nullpo_retr(-1, sd);
-
+
if (night_flag != 0) {
map_day_timer(day_timer_tid, 0, 0, 1);
} else {
clif->message(fd, msg_txt(90)); // Day mode is already enabled.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(doom)
+ACMD(doom)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
-
+
nullpo_retr(-1, sd);
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
@@ -2991,22 +2950,22 @@ ACMD_FUNC(doom)
}
}
mapit_free(iter);
-
+
clif->message(fd, msg_txt(62)); // Judgement was made.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(doommap)
+ACMD(doommap)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
-
+
nullpo_retr(-1, sd);
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
@@ -3018,19 +2977,19 @@ ACMD_FUNC(doommap)
}
}
mapit_free(iter);
-
+
clif->message(fd, msg_txt(62)); // Judgement was made.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
static void atcommand_raise_sub(struct map_session_data* sd) {
-
+
status_revive(&sd->bl, 100, 100);
-
+
clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
clif->message(sd->fd, msg_txt(63)); // Mercy has been shown.
}
@@ -3038,86 +2997,86 @@ static void atcommand_raise_sub(struct map_session_data* sd) {
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(raise)
+ACMD(raise)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
-
+
nullpo_retr(-1, sd);
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
if( pc_isdead(pl_sd) )
atcommand_raise_sub(pl_sd);
mapit_free(iter);
-
+
clif->message(fd, msg_txt(64)); // Mercy has been granted.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(raisemap)
+ACMD(raisemap)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
-
+
nullpo_retr(-1, sd);
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
if (sd->bl.m == pl_sd->bl.m && pc_isdead(pl_sd) )
atcommand_raise_sub(pl_sd);
mapit_free(iter);
-
+
clif->message(fd, msg_txt(64)); // Mercy has been granted.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(kick)
+ACMD(kick)
{
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
-
+
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1026)); // Please enter a player name (usage: @kick <char name/ID>).
- return -1;
+ return false;
}
-
+
if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
{
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
{
clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
- return -1;
+ return false;
}
-
+
clif->GM_kick(sd, pl_sd);
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(kickall)
+ACMD(kickall)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
nullpo_retr(-1, sd);
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
@@ -3127,192 +3086,192 @@ ACMD_FUNC(kickall)
}
}
mapit_free(iter);
-
+
clif->message(fd, msg_txt(195)); // All players have been kicked!
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(allskill)
+ACMD(allskill)
{
nullpo_retr(-1, sd);
pc_allskillup(sd); // all skills
sd->status.skill_point = 0; // 0 skill points
clif->updatestatus(sd, SP_SKILLPOINT); // update
clif->message(fd, msg_txt(76)); // All skills have been added to your skill tree.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(questskill)
+ACMD(questskill)
{
uint16 skill_id;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || (skill_id = atoi(message)) <= 0)
{// also send a list of skills applicable to this command
const char* text;
-
+
// attempt to find the text corresponding to this command
- text = atcommand_help_string( command );
-
+ text = atcommand_help_string( info );
+
// send the error message as always
clif->message(fd, msg_txt(1027)); // Please enter a quest skill number.
-
+
if( text )
{// send the skill ID list associated with this command
clif->message( fd, text );
}
-
- return -1;
+
+ return false;
}
if (skill_id >= MAX_SKILL_DB) {
clif->message(fd, msg_txt(198)); // This skill number doesn't exist.
- return -1;
+ return false;
}
if (!(skill->get_inf2(skill_id) & INF2_QUEST_SKILL)) {
clif->message(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill.
- return -1;
+ return false;
}
if (pc_checkskill(sd, skill_id) > 0) {
clif->message(fd, msg_txt(196)); // You already have this quest skill.
- return -1;
+ return false;
}
-
+
pc_skill(sd, skill_id, 1, 0);
clif->message(fd, msg_txt(70)); // You have learned the skill.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(lostskill)
+ACMD(lostskill)
{
uint16 skill_id;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || (skill_id = atoi(message)) <= 0)
{// also send a list of skills applicable to this command
const char* text;
-
+
// attempt to find the text corresponding to this command
- text = atcommand_help_string( command );
-
+ text = atcommand_help_string( info );
+
// send the error message as always
clif->message(fd, msg_txt(1027)); // Please enter a quest skill number.
-
+
if( text )
{// send the skill ID list associated with this command
clif->message( fd, text );
}
-
- return -1;
+
+ return false;
}
if (skill_id >= MAX_SKILL) {
clif->message(fd, msg_txt(198)); // This skill number doesn't exist.
- return -1;
+ return false;
}
if (!(skill->get_inf2(skill_id) & INF2_QUEST_SKILL)) {
clif->message(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill.
- return -1;
+ return false;
}
if (pc_checkskill(sd, skill_id) == 0) {
clif->message(fd, msg_txt(201)); // You don't have this quest skill.
- return -1;
+ return false;
}
-
+
sd->status.skill[skill_id].lv = 0;
sd->status.skill[skill_id].flag = 0;
clif->deleteskill(sd,skill_id);
clif->message(fd, msg_txt(71)); // You have forgotten the skill.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(spiritball)
+ACMD(spiritball)
{
int max_spiritballs;
int number;
nullpo_retr(-1, sd);
-
+
max_spiritballs = min(ARRAYLENGTH(sd->spirit_timer), 0x7FFF);
-
+
if( !message || !*message || (number = atoi(message)) < 0 || number > max_spiritballs )
{
char msg[CHAT_SIZE_MAX];
safesnprintf(msg, sizeof(msg), msg_txt(1028), max_spiritballs); // Please enter a party name (usage: @party <party_name>).
clif->message(fd, msg);
- return -1;
+ return false;
}
-
+
if( sd->spiritball > 0 )
pc_delspiritball(sd, sd->spiritball, 1);
sd->spiritball = number;
clif->spiritball(&sd->bl);
// no message, player can look the difference
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(party)
+ACMD(party)
{
char party[NAME_LENGTH];
nullpo_retr(-1, sd);
-
+
memset(party, '\0', sizeof(party));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", party) < 1) {
clif->message(fd, msg_txt(1029)); // Please enter a party name (usage: @party <party_name>).
- return -1;
+ return false;
}
-
+
party_create(sd, party, 0, 0);
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(guild)
+ACMD(guild)
{
char guild[NAME_LENGTH];
int prev;
nullpo_retr(-1, sd);
-
+
memset(guild, '\0', sizeof(guild));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", guild) < 1) {
clif->message(fd, msg_txt(1030)); // Please enter a guild name (usage: @guild <guild_name>).
- return -1;
+ return false;
}
-
+
prev = battle_config.guild_emperium_check;
battle_config.guild_emperium_check = 0;
guild_create(sd, guild);
battle_config.guild_emperium_check = prev;
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(breakguild)
+ACMD(breakguild)
{
nullpo_retr(-1, sd);
-
+
if (sd->status.guild_id) { // Check if the player has a guild
struct guild *g;
g = sd->guild; // Search the guild
@@ -3321,126 +3280,126 @@ ACMD_FUNC(breakguild)
int ret = 0;
ret = guild_break(sd, g->name); // Break guild
if (ret) { // Check if anything went wrong
- return 0; // Guild was broken
+ return true; // Guild was broken
} else {
- return -1; // Something went wrong
+ return false; // Something went wrong
}
} else { // Not guild master
clif->message(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
- return -1;
+ return false;
}
} else { // Guild was not found. HOW?
clif->message(fd, msg_txt(252)); // You are not in a guild.
- return -1;
+ return false;
}
} else { // Player does not have a guild
clif->message(fd, msg_txt(252)); // You are not in a guild.
- return -1;
+ return false;
}
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(agitstart)
+ACMD(agitstart)
{
nullpo_retr(-1, sd);
if (agit_flag == 1) {
clif->message(fd, msg_txt(73)); // War of Emperium is currently in progress.
- return -1;
+ return false;
}
-
+
agit_flag = 1;
guild_agit_start();
clif->message(fd, msg_txt(72)); // War of Emperium has been initiated.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(agitstart2)
+ACMD(agitstart2)
{
nullpo_retr(-1, sd);
if (agit2_flag == 1) {
clif->message(fd, msg_txt(404)); // "War of Emperium SE is currently in progress."
- return -1;
+ return false;
}
-
+
agit2_flag = 1;
guild_agit2_start();
clif->message(fd, msg_txt(403)); // "War of Emperium SE has been initiated."
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(agitend)
+ACMD(agitend)
{
nullpo_retr(-1, sd);
if (agit_flag == 0) {
clif->message(fd, msg_txt(75)); // War of Emperium is currently not in progress.
- return -1;
+ return false;
}
-
+
agit_flag = 0;
guild_agit_end();
clif->message(fd, msg_txt(74)); // War of Emperium has been ended.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(agitend2)
+ACMD(agitend2)
{
nullpo_retr(-1, sd);
if (agit2_flag == 0) {
clif->message(fd, msg_txt(406)); // "War of Emperium SE is currently not in progress."
- return -1;
+ return false;
}
-
+
agit2_flag = 0;
guild_agit2_end();
clif->message(fd, msg_txt(405)); // "War of Emperium SE has been ended."
-
- return 0;
+
+ return true;
}
/*==========================================
* @mapexit - shuts down the map server
*------------------------------------------*/
-ACMD_FUNC(mapexit)
+ACMD(mapexit)
{
nullpo_retr(-1, sd);
-
+
do_shutdown();
- return 0;
+ return true;
}
/*==========================================
* idsearch <part_of_name>: revrited by [Yor]
*------------------------------------------*/
-ACMD_FUNC(idsearch)
+ACMD(idsearch)
{
char item_name[100];
unsigned int i, match;
struct item_data *item_array[MAX_SEARCH];
nullpo_retr(-1, sd);
-
+
memset(item_name, '\0', sizeof(item_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%99s", item_name) < 0) {
clif->message(fd, msg_txt(1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>).
- return -1;
+ return false;
}
-
+
sprintf(atcmd_output, msg_txt(77), item_name); // The reference result of '%s' (name: id):
clif->message(fd, atcmd_output);
match = itemdb_searchname_array(item_array, MAX_SEARCH, item_name);
@@ -3455,27 +3414,27 @@ ACMD_FUNC(idsearch)
}
sprintf(atcmd_output, msg_txt(79), match); // It is %d affair above.
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
/*==========================================
* Recall All Characters Online To Your Location
*------------------------------------------*/
-ACMD_FUNC(recallall)
+ACMD(recallall)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
int count;
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
- return -1;
+ return false;
}
-
+
count = 0;
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
@@ -3496,20 +3455,20 @@ ACMD_FUNC(recallall)
}
}
mapit_free(iter);
-
+
clif->message(fd, msg_txt(92)); // All characters recalled!
if (count) {
sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
clif->message(fd, atcmd_output);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Recall online characters of a guild to your location
*------------------------------------------*/
-ACMD_FUNC(guildrecall)
+ACMD(guildrecall)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
@@ -3517,29 +3476,29 @@ ACMD_FUNC(guildrecall)
char guild_name[NAME_LENGTH];
struct guild *g;
nullpo_retr(-1, sd);
-
+
memset(guild_name, '\0', sizeof(guild_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
clif->message(fd, msg_txt(1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>).
- return -1;
+ return false;
}
-
+
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
- return -1;
+ return false;
}
-
+
if ((g = guild_searchname(guild_name)) == NULL && // name first to avoid error when name begin with a number
(g = guild_search(atoi(message))) == NULL)
{
clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
- return -1;
+ return false;
}
-
+
count = 0;
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
@@ -3554,21 +3513,21 @@ ACMD_FUNC(guildrecall)
}
}
mapit_free(iter);
-
+
sprintf(atcmd_output, msg_txt(93), g->name); // All online characters of the %s guild have been recalled to your position.
clif->message(fd, atcmd_output);
if (count) {
sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
clif->message(fd, atcmd_output);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Recall online characters of a party to your location
*------------------------------------------*/
-ACMD_FUNC(partyrecall)
+ACMD(partyrecall)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
@@ -3576,29 +3535,29 @@ ACMD_FUNC(partyrecall)
struct party_data *p;
int count;
nullpo_retr(-1, sd);
-
+
memset(party_name, '\0', sizeof(party_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
clif->message(fd, msg_txt(1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>).
- return -1;
+ return false;
}
-
+
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
- return -1;
+ return false;
}
-
+
if ((p = party_searchname(party_name)) == NULL && // name first to avoid error when name begin with a number
(p = party_search(atoi(message))) == NULL)
{
clif->message(fd, msg_txt(96)); // Incorrect name or ID, or no one from the party is online.
- return -1;
+ return false;
}
-
+
count = 0;
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
@@ -3613,33 +3572,33 @@ ACMD_FUNC(partyrecall)
}
}
mapit_free(iter);
-
+
sprintf(atcmd_output, msg_txt(95), p->party.name); // All online characters of the %s party have been recalled to your position.
clif->message(fd, atcmd_output);
if (count) {
sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
clif->message(fd, atcmd_output);
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(reloaditemdb)
+ACMD(reloaditemdb)
{
nullpo_retr(-1, sd);
itemdb_reload();
clif->message(fd, msg_txt(97)); // Item database has been reloaded.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(reloadmobdb)
+ACMD(reloadmobdb)
{
nullpo_retr(-1, sd);
mob_reload();
@@ -3649,14 +3608,14 @@ ACMD_FUNC(reloadmobdb)
read_mercenary_skilldb();
reload_elementaldb();
clif->message(fd, msg_txt(98)); // Monster database has been reloaded.
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(reloadskilldb)
+ACMD(reloadskilldb)
{
nullpo_retr(-1, sd);
skill->reload();
@@ -3664,130 +3623,130 @@ ACMD_FUNC(reloadskilldb)
reload_elemental_skilldb();
read_mercenary_skilldb();
clif->message(fd, msg_txt(99)); // Skill database has been reloaded.
-
- return 0;
+
+ return true;
}
/*==========================================
* @reloadatcommand - reloads conf/atcommand.conf conf/groups.conf
*------------------------------------------*/
void atcommand_doload();
-ACMD_FUNC(reloadatcommand) {
+ACMD(reloadatcommand) {
config_t run_test;
-
+
if (conf_read_file(&run_test, "conf/groups.conf")) {
clif->message(fd, msg_txt(1036)); // Error reading groups.conf, reload failed.
- return -1;
+ return false;
}
-
+
config_destroy(&run_test);
-
+
if (conf_read_file(&run_test, ATCOMMAND_CONF_FILENAME)) {
clif->message(fd, msg_txt(1037)); // Error reading atcommand.conf, reload failed.
- return -1;
+ return false;
}
-
+
config_destroy(&run_test);
-
+
atcommand_doload();
pc_groups_reload();
clif->message(fd, msg_txt(254));
- return 0;
+ return true;
}
/*==========================================
* @reloadbattleconf - reloads /conf/battle.conf
*------------------------------------------*/
-ACMD_FUNC(reloadbattleconf)
+ACMD(reloadbattleconf)
{
struct Battle_Config prev_config;
memcpy(&prev_config, &battle_config, sizeof(prev_config));
-
+
battle->config_read(BATTLE_CONF_FILENAME);
-
+
if( prev_config.item_rate_mvp != battle_config.item_rate_mvp
- || prev_config.item_rate_common != battle_config.item_rate_common
- || prev_config.item_rate_common_boss != battle_config.item_rate_common_boss
- || prev_config.item_rate_card != battle_config.item_rate_card
- || prev_config.item_rate_card_boss != battle_config.item_rate_card_boss
- || prev_config.item_rate_equip != battle_config.item_rate_equip
- || prev_config.item_rate_equip_boss != battle_config.item_rate_equip_boss
- || prev_config.item_rate_heal != battle_config.item_rate_heal
- || prev_config.item_rate_heal_boss != battle_config.item_rate_heal_boss
- || prev_config.item_rate_use != battle_config.item_rate_use
- || prev_config.item_rate_use_boss != battle_config.item_rate_use_boss
- || prev_config.item_rate_treasure != battle_config.item_rate_treasure
- || prev_config.item_rate_adddrop != battle_config.item_rate_adddrop
- || prev_config.logarithmic_drops != battle_config.logarithmic_drops
- || prev_config.item_drop_common_min != battle_config.item_drop_common_min
- || prev_config.item_drop_common_max != battle_config.item_drop_common_max
- || prev_config.item_drop_card_min != battle_config.item_drop_card_min
- || prev_config.item_drop_card_max != battle_config.item_drop_card_max
- || prev_config.item_drop_equip_min != battle_config.item_drop_equip_min
- || prev_config.item_drop_equip_max != battle_config.item_drop_equip_max
- || prev_config.item_drop_mvp_min != battle_config.item_drop_mvp_min
- || prev_config.item_drop_mvp_max != battle_config.item_drop_mvp_max
- || prev_config.item_drop_heal_min != battle_config.item_drop_heal_min
- || prev_config.item_drop_heal_max != battle_config.item_drop_heal_max
- || prev_config.item_drop_use_min != battle_config.item_drop_use_min
- || prev_config.item_drop_use_max != battle_config.item_drop_use_max
- || prev_config.item_drop_treasure_min != battle_config.item_drop_treasure_min
- || prev_config.item_drop_treasure_max != battle_config.item_drop_treasure_max
- || prev_config.base_exp_rate != battle_config.base_exp_rate
- || prev_config.job_exp_rate != battle_config.job_exp_rate
- )
+ || prev_config.item_rate_common != battle_config.item_rate_common
+ || prev_config.item_rate_common_boss != battle_config.item_rate_common_boss
+ || prev_config.item_rate_card != battle_config.item_rate_card
+ || prev_config.item_rate_card_boss != battle_config.item_rate_card_boss
+ || prev_config.item_rate_equip != battle_config.item_rate_equip
+ || prev_config.item_rate_equip_boss != battle_config.item_rate_equip_boss
+ || prev_config.item_rate_heal != battle_config.item_rate_heal
+ || prev_config.item_rate_heal_boss != battle_config.item_rate_heal_boss
+ || prev_config.item_rate_use != battle_config.item_rate_use
+ || prev_config.item_rate_use_boss != battle_config.item_rate_use_boss
+ || prev_config.item_rate_treasure != battle_config.item_rate_treasure
+ || prev_config.item_rate_adddrop != battle_config.item_rate_adddrop
+ || prev_config.logarithmic_drops != battle_config.logarithmic_drops
+ || prev_config.item_drop_common_min != battle_config.item_drop_common_min
+ || prev_config.item_drop_common_max != battle_config.item_drop_common_max
+ || prev_config.item_drop_card_min != battle_config.item_drop_card_min
+ || prev_config.item_drop_card_max != battle_config.item_drop_card_max
+ || prev_config.item_drop_equip_min != battle_config.item_drop_equip_min
+ || prev_config.item_drop_equip_max != battle_config.item_drop_equip_max
+ || prev_config.item_drop_mvp_min != battle_config.item_drop_mvp_min
+ || prev_config.item_drop_mvp_max != battle_config.item_drop_mvp_max
+ || prev_config.item_drop_heal_min != battle_config.item_drop_heal_min
+ || prev_config.item_drop_heal_max != battle_config.item_drop_heal_max
+ || prev_config.item_drop_use_min != battle_config.item_drop_use_min
+ || prev_config.item_drop_use_max != battle_config.item_drop_use_max
+ || prev_config.item_drop_treasure_min != battle_config.item_drop_treasure_min
+ || prev_config.item_drop_treasure_max != battle_config.item_drop_treasure_max
+ || prev_config.base_exp_rate != battle_config.base_exp_rate
+ || prev_config.job_exp_rate != battle_config.job_exp_rate
+ )
{ // Exp or Drop rates changed.
mob_reload(); //Needed as well so rate changes take effect.
chrif_ragsrvinfo(battle_config.base_exp_rate, battle_config.job_exp_rate, battle_config.item_rate_common);
}
clif->message(fd, msg_txt(255));
- return 0;
+ return true;
}
/*==========================================
* @reloadstatusdb - reloads job_db1.txt job_db2.txt job_db2-2.txt refine_db.txt size_fix.txt
*------------------------------------------*/
-ACMD_FUNC(reloadstatusdb)
+ACMD(reloadstatusdb)
{
status_readdb();
clif->message(fd, msg_txt(256));
- return 0;
+ return true;
}
/*==========================================
* @reloadpcdb - reloads exp.txt skill_tree.txt attr_fix.txt statpoint.txt
*------------------------------------------*/
-ACMD_FUNC(reloadpcdb)
+ACMD(reloadpcdb)
{
pc_readdb();
clif->message(fd, msg_txt(257));
- return 0;
+ return true;
}
/*==========================================
* @reloadmotd - reloads motd.txt
*------------------------------------------*/
-ACMD_FUNC(reloadmotd)
+ACMD(reloadmotd)
{
pc_read_motd();
clif->message(fd, msg_txt(268));
- return 0;
+ return true;
}
/*==========================================
* @reloadscript - reloads all scripts (npcs, warps, mob spawns, ...)
*------------------------------------------*/
-ACMD_FUNC(reloadscript)
+ACMD(reloadscript)
{
nullpo_retr(-1, sd);
//atcommand_broadcast( fd, sd, "@broadcast", "Server is reloading scripts..." );
//atcommand_broadcast( fd, sd, "@broadcast", "You will feel a bit of lag at this point !" );
-
+
flush_fifos();
map_reloadnpc(true); // reload config files seeking for npcs
script_reload();
npc_reload();
-
+
clif->message(fd, msg_txt(100)); // Scripts have been reloaded.
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -3799,7 +3758,7 @@ ACMD_FUNC(reloadscript)
* 3 = Shows the chats in that map
TODO# add the missing mapflags e.g. adjust_skill_damage to display
*------------------------------------------*/
-ACMD_FUNC(mapinfo) {
+ACMD(mapinfo) {
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
struct npc_data *nd = NULL;
@@ -3808,35 +3767,35 @@ ACMD_FUNC(mapinfo) {
int i, m_id, chat_num = 0, list = 0, vend_num = 0;
unsigned short m_index;
char mapname[24];
-
+
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(mapname, '\0', sizeof(mapname));
memset(direction, '\0', sizeof(direction));
-
+
sscanf(message, "%d %23[^\n]", &list, mapname);
-
+
if (list < 0 || list > 3) {
clif->message(fd, msg_txt(1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
- return -1;
+ return false;
}
-
+
if (mapname[0] == '\0') {
safestrncpy(mapname, mapindex_id2name(sd->mapindex), MAP_NAME_LENGTH);
m_id = map_mapindex2mapid(sd->mapindex);
} else {
m_id = map_mapname2mapid(mapname);
}
-
+
if (m_id < 0) {
clif->message(fd, msg_txt(1)); // Map not found.
- return -1;
+ return false;
}
m_index = mapindex_name2id(mapname); //This one shouldn't fail since the previous seek did not.
-
+
clif->message(fd, msg_txt(1039)); // ------ Map Info ------
-
+
// count chats (for initial message)
chat_num = 0;
iter = mapit_getallusers();
@@ -3849,21 +3808,21 @@ ACMD_FUNC(mapinfo) {
}
}
mapit_free(iter);
-
+
sprintf(atcmd_output, msg_txt(1040), mapname, map[m_id].zone->name, map[m_id].users, map[m_id].npc_num, chat_num, vend_num); // Map: %s (Zone:%s) | Players: %d | NPCs: %d | Chats: %d | Vendings: %d
clif->message(fd, atcmd_output);
clif->message(fd, msg_txt(1041)); // ------ Map Flags ------
if (map[m_id].flag.town)
clif->message(fd, msg_txt(1042)); // Town Map
-
+
if (battle_config.autotrade_mapflag == map[m_id].flag.autotrade)
clif->message(fd, msg_txt(1043)); // Autotrade Enabled
else
clif->message(fd, msg_txt(1044)); // Autotrade Disabled
-
+
if (map[m_id].flag.battleground)
clif->message(fd, msg_txt(1045)); // Battlegrounds ON
-
+
strcpy(atcmd_output,msg_txt(1046)); // PvP Flags:
if (map[m_id].flag.pvp)
strcat(atcmd_output, msg_txt(1047)); // Pvp ON |
@@ -3876,7 +3835,7 @@ ACMD_FUNC(mapinfo) {
if (map[m_id].flag.pvp_nocalcrank)
strcat(atcmd_output, msg_txt(1051)); // NoCalcRank |
clif->message(fd, atcmd_output);
-
+
strcpy(atcmd_output,msg_txt(1052)); // GvG Flags:
if (map[m_id].flag.gvg)
strcat(atcmd_output, msg_txt(1053)); // GvG ON |
@@ -3887,7 +3846,7 @@ ACMD_FUNC(mapinfo) {
if (map[m_id].flag.gvg_noparty)
strcat(atcmd_output, msg_txt(1056)); // NoParty |
clif->message(fd, atcmd_output);
-
+
strcpy(atcmd_output,msg_txt(1057)); // Teleport Flags:
if (map[m_id].flag.noteleport)
strcat(atcmd_output, msg_txt(1058)); // NoTeleport |
@@ -3899,16 +3858,14 @@ ACMD_FUNC(mapinfo) {
strcat(atcmd_output, msg_txt(1061)); // NoWarpTo |
if (map[m_id].flag.noreturn)
strcat(atcmd_output, msg_txt(1062)); // NoReturn |
- if (map[m_id].flag.nogo)
- strcat(atcmd_output, msg_txt(1063)); // NoGo |
if (map[m_id].flag.nomemo)
strcat(atcmd_output, msg_txt(1064)); // NoMemo |
clif->message(fd, atcmd_output);
-
+
sprintf(atcmd_output, msg_txt(1065), // No Exp Penalty: %s | No Zeny Penalty: %s
- (map[m_id].flag.noexppenalty) ? msg_txt(1066) : msg_txt(1067), (map[m_id].flag.nozenypenalty) ? msg_txt(1066) : msg_txt(1067)); // On / Off
+ (map[m_id].flag.noexppenalty) ? msg_txt(1066) : msg_txt(1067), (map[m_id].flag.nozenypenalty) ? msg_txt(1066) : msg_txt(1067)); // On / Off
clif->message(fd, atcmd_output);
-
+
if (map[m_id].flag.nosave) {
if (!map[m_id].save.map)
clif->message(fd, msg_txt(1068)); // No Save (Return to last Save Point)
@@ -3918,11 +3875,11 @@ ACMD_FUNC(mapinfo) {
}
else {
sprintf(atcmd_output, msg_txt(1070), // No Save, Save Point: %s,%d,%d
- mapindex_id2name(map[m_id].save.map),map[m_id].save.x,map[m_id].save.y);
+ mapindex_id2name(map[m_id].save.map),map[m_id].save.x,map[m_id].save.y);
clif->message(fd, atcmd_output);
}
}
-
+
strcpy(atcmd_output,msg_txt(1071)); // Weather Flags:
if (map[m_id].flag.snow)
strcat(atcmd_output, msg_txt(1072)); // Snow |
@@ -3941,7 +3898,7 @@ ACMD_FUNC(mapinfo) {
if (map[m_id].flag.nightenabled)
strcat(atcmd_output, msg_txt(1080)); // Displays Night |
clif->message(fd, atcmd_output);
-
+
strcpy(atcmd_output,msg_txt(1081)); // Other Flags:
if (map[m_id].flag.nobranch)
strcat(atcmd_output, msg_txt(1082)); // NoBranch |
@@ -3960,7 +3917,7 @@ ACMD_FUNC(mapinfo) {
if (map[m_id].flag.reset)
strcat(atcmd_output, msg_txt(1089)); // Reset |
clif->message(fd, atcmd_output);
-
+
strcpy(atcmd_output,msg_txt(1090)); // Other Flags:
if (map[m_id].nocommand)
strcat(atcmd_output, msg_txt(1091)); // NoCommand |
@@ -3977,90 +3934,90 @@ ACMD_FUNC(mapinfo) {
if (map[m_id].flag.guildlock)
strcat(atcmd_output, msg_txt(1097)); // GuildLock |
clif->message(fd, atcmd_output);
-
+
switch (list) {
- case 0:
- // Do nothing. It's list 0, no additional display.
- break;
- case 1:
- clif->message(fd, msg_txt(1098)); // ----- Players in Map -----
- iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
- {
- if (pl_sd->mapindex == m_index) {
- sprintf(atcmd_output, msg_txt(1099), // Player '%s' (session #%d) | Location: %d,%d
- pl_sd->status.name, pl_sd->fd, pl_sd->bl.x, pl_sd->bl.y);
- clif->message(fd, atcmd_output);
- }
- }
- mapit_free(iter);
- break;
- case 2:
- clif->message(fd, msg_txt(1100)); // ----- NPCs in Map -----
- for (i = 0; i < map[m_id].npc_num;)
- {
- nd = map[m_id].npc[i];
- switch(nd->ud.dir) {
- case 0: strcpy(direction, msg_txt(1101)); break; // North
- case 1: strcpy(direction, msg_txt(1102)); break; // North West
- case 2: strcpy(direction, msg_txt(1103)); break; // West
- case 3: strcpy(direction, msg_txt(1104)); break; // South West
- case 4: strcpy(direction, msg_txt(1105)); break; // South
- case 5: strcpy(direction, msg_txt(1106)); break; // South East
- case 6: strcpy(direction, msg_txt(1107)); break; // East
- case 7: strcpy(direction, msg_txt(1108)); break; // North East
- case 9: strcpy(direction, msg_txt(1109)); break; // North
- default: strcpy(direction, msg_txt(1110)); break; // Unknown
+ case 0:
+ // Do nothing. It's list 0, no additional display.
+ break;
+ case 1:
+ clif->message(fd, msg_txt(1098)); // ----- Players in Map -----
+ iter = mapit_getallusers();
+ for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
+ {
+ if (pl_sd->mapindex == m_index) {
+ sprintf(atcmd_output, msg_txt(1099), // Player '%s' (session #%d) | Location: %d,%d
+ pl_sd->status.name, pl_sd->fd, pl_sd->bl.x, pl_sd->bl.y);
+ clif->message(fd, atcmd_output);
+ }
}
- if(strcmp(nd->name,nd->exname) == 0)
- sprintf(atcmd_output, msg_txt(1111), // NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d
- ++i, nd->name, direction, nd->class_, nd->bl.x, nd->bl.y);
- else
- sprintf(atcmd_output, msg_txt(1112), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d
- ++i, nd->name, nd->exname, direction, nd->class_, nd->bl.x, nd->bl.y);
- clif->message(fd, atcmd_output);
- }
- break;
- case 3:
- clif->message(fd, msg_txt(1113)); // ----- Chats in Map -----
- iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
- {
- if ((cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL &&
- pl_sd->mapindex == m_index &&
- cd->usersd[0] == pl_sd)
+ mapit_free(iter);
+ break;
+ case 2:
+ clif->message(fd, msg_txt(1100)); // ----- NPCs in Map -----
+ for (i = 0; i < map[m_id].npc_num;)
{
- sprintf(atcmd_output, msg_txt(1114), // Chat: %s | Player: %s | Location: %d %d
- cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y);
- clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_txt(1115), // Users: %d/%d | Password: %s | Public: %s
- cd->users, cd->limit, cd->pass, (cd->pub) ? msg_txt(1116) : msg_txt(1117)); // Yes / No
+ nd = map[m_id].npc[i];
+ switch(nd->ud.dir) {
+ case 0: strcpy(direction, msg_txt(1101)); break; // North
+ case 1: strcpy(direction, msg_txt(1102)); break; // North West
+ case 2: strcpy(direction, msg_txt(1103)); break; // West
+ case 3: strcpy(direction, msg_txt(1104)); break; // South West
+ case 4: strcpy(direction, msg_txt(1105)); break; // South
+ case 5: strcpy(direction, msg_txt(1106)); break; // South East
+ case 6: strcpy(direction, msg_txt(1107)); break; // East
+ case 7: strcpy(direction, msg_txt(1108)); break; // North East
+ case 9: strcpy(direction, msg_txt(1109)); break; // North
+ default: strcpy(direction, msg_txt(1110)); break; // Unknown
+ }
+ if(strcmp(nd->name,nd->exname) == 0)
+ sprintf(atcmd_output, msg_txt(1111), // NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d
+ ++i, nd->name, direction, nd->class_, nd->bl.x, nd->bl.y);
+ else
+ sprintf(atcmd_output, msg_txt(1112), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d
+ ++i, nd->name, nd->exname, direction, nd->class_, nd->bl.x, nd->bl.y);
clif->message(fd, atcmd_output);
}
- }
- mapit_free(iter);
- break;
- default: // normally impossible to arrive here
- clif->message(fd, msg_txt(1118)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
- return -1;
- break;
+ break;
+ case 3:
+ clif->message(fd, msg_txt(1113)); // ----- Chats in Map -----
+ iter = mapit_getallusers();
+ for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
+ {
+ if ((cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL &&
+ pl_sd->mapindex == m_index &&
+ cd->usersd[0] == pl_sd)
+ {
+ sprintf(atcmd_output, msg_txt(1114), // Chat: %s | Player: %s | Location: %d %d
+ cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y);
+ clif->message(fd, atcmd_output);
+ sprintf(atcmd_output, msg_txt(1115), // Users: %d/%d | Password: %s | Public: %s
+ cd->users, cd->limit, cd->pass, (cd->pub) ? msg_txt(1116) : msg_txt(1117)); // Yes / No
+ clif->message(fd, atcmd_output);
+ }
+ }
+ mapit_free(iter);
+ break;
+ default: // normally impossible to arrive here
+ clif->message(fd, msg_txt(1118)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
+ return false;
+ break;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(mount_peco)
+ACMD(mount_peco)
{
nullpo_retr(-1, sd);
-
+
if (sd->disguise) {
clif->message(fd, msg_txt(212)); // Cannot mount while in disguise.
- return -1;
+ return false;
}
-
+
if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && pc_checkskill(sd,RK_DRAGONTRAINING) > 0 ) {
if( !(sd->sc.option&OPTION_DRAGON1) ) {
clif->message(sd->fd,msg_txt(1119)); // You have mounted your Dragon.
@@ -4069,7 +4026,7 @@ ACMD_FUNC(mount_peco)
clif->message(sd->fd,msg_txt(1120)); // You have released your Dragon.
pc_setoption(sd, sd->sc.option&~OPTION_DRAGON1);
}
- return 0;
+ return true;
}
if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && pc_checkskill(sd,RA_WUGRIDER) > 0 ) {
if( !pc_isridingwug(sd) ) {
@@ -4079,7 +4036,7 @@ ACMD_FUNC(mount_peco)
clif->message(sd->fd,msg_txt(1122)); // You have released your Warg.
pc_setoption(sd, sd->sc.option&~OPTION_WUGRIDER);
}
- return 0;
+ return true;
}
if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) {
if( !pc_ismadogear(sd) ) {
@@ -4089,47 +4046,47 @@ ACMD_FUNC(mount_peco)
clif->message(sd->fd,msg_txt(1124)); // You have released your Mado Gear.
pc_setoption(sd, sd->sc.option&~OPTION_MADOGEAR);
}
- return 0;
+ return true;
}
if (!pc_isriding(sd)) { // if actually no peco
-
+
if (!pc_checkskill(sd, KN_RIDING)) {
clif->message(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job.
- return -1;
+ return false;
}
-
+
pc_setoption(sd, sd->sc.option | OPTION_RIDING);
clif->message(fd, msg_txt(102)); // You have mounted a Peco Peco.
} else {//Dismount
pc_setoption(sd, sd->sc.option & ~OPTION_RIDING);
clif->message(fd, msg_txt(214)); // You have released your Peco Peco.
}
-
- return 0;
+
+ return true;
}
/*==========================================
*Spy Commands by Syrus22
*------------------------------------------*/
-ACMD_FUNC(guildspy)
+ACMD(guildspy)
{
char guild_name[NAME_LENGTH];
struct guild *g;
nullpo_retr(-1, sd);
-
+
memset(guild_name, '\0', sizeof(guild_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!enable_spy)
{
clif->message(fd, msg_txt(1125)); // The mapserver has spy command support disabled.
- return -1;
+ return false;
}
if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
clif->message(fd, msg_txt(1126)); // Please enter a guild name/ID (usage: @guildspy <guild_name/ID>).
- return -1;
+ return false;
}
-
+
if ((g = guild_searchname(guild_name)) != NULL || // name first to avoid error when name begin with a number
(g = guild_search(atoi(message))) != NULL) {
if (sd->guildspy == g->guild_id) {
@@ -4143,35 +4100,35 @@ ACMD_FUNC(guildspy)
}
} else {
clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the specified guild is online.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(partyspy)
+ACMD(partyspy)
{
char party_name[NAME_LENGTH];
struct party_data *p;
nullpo_retr(-1, sd);
-
+
memset(party_name, '\0', sizeof(party_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!enable_spy)
{
clif->message(fd, msg_txt(1125)); // The mapserver has spy command support disabled.
- return -1;
+ return false;
}
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
clif->message(fd, msg_txt(1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>).
- return -1;
+ return false;
}
-
+
if ((p = party_searchname(party_name)) != NULL || // name first to avoid error when name begin with a number
(p = party_search(atoi(message))) != NULL) {
if (sd->partyspy == p->party.party_id) {
@@ -4185,20 +4142,20 @@ ACMD_FUNC(partyspy)
}
} else {
clif->message(fd, msg_txt(96)); // Incorrect name/ID, or no one from the specified party is online.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @repairall [Valaris]
*------------------------------------------*/
-ACMD_FUNC(repairall)
+ACMD(repairall)
{
int count, i;
nullpo_retr(-1, sd);
-
+
count = 0;
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].nameid && sd->status.inventory[i].attribute == 1) {
@@ -4207,180 +4164,180 @@ ACMD_FUNC(repairall)
count++;
}
}
-
+
if (count > 0) {
clif->misceffect(&sd->bl, 3);
clif->equiplist(sd);
clif->message(fd, msg_txt(107)); // All items have been repaired.
} else {
clif->message(fd, msg_txt(108)); // No item need to be repaired.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @nuke [Valaris]
*------------------------------------------*/
-ACMD_FUNC(nuke)
+ACMD(nuke)
{
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
-
+
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_txt(1128)); // Please enter a player name (usage: @nuke <char name>).
- return -1;
+ return false;
}
-
+
if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) {
if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kill only lower or same GM level
skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, gettick(), 0);
clif->message(fd, msg_txt(109)); // Player has been nuked!
} else {
clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
- return -1;
+ return false;
}
} else {
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @tonpc
*------------------------------------------*/
-ACMD_FUNC(tonpc)
+ACMD(tonpc)
{
char npcname[NAME_LENGTH+1];
struct npc_data *nd;
-
+
nullpo_retr(-1, sd);
-
+
memset(npcname, 0, sizeof(npcname));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", npcname) < 1) {
clif->message(fd, msg_txt(1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>).
- return -1;
+ return false;
}
-
+
if ((nd = npc_name2id(npcname)) != NULL) {
if (pc_setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == 0)
clif->message(fd, msg_txt(0)); // Warped.
else
- return -1;
+ return false;
} else {
clif->message(fd, msg_txt(111)); // This NPC doesn't exist.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(shownpc)
+ACMD(shownpc)
{
char NPCname[NAME_LENGTH+1];
nullpo_retr(-1, sd);
-
+
memset(NPCname, '\0', sizeof(NPCname));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
clif->message(fd, msg_txt(1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>).
- return -1;
+ return false;
}
-
+
if (npc_name2id(NPCname) != NULL) {
npc_enable(NPCname, 1);
clif->message(fd, msg_txt(110)); // Npc Enabled.
} else {
clif->message(fd, msg_txt(111)); // This NPC doesn't exist.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(hidenpc)
+ACMD(hidenpc)
{
char NPCname[NAME_LENGTH+1];
nullpo_retr(-1, sd);
-
+
memset(NPCname, '\0', sizeof(NPCname));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
clif->message(fd, msg_txt(1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>).
- return -1;
+ return false;
}
-
+
if (npc_name2id(NPCname) == NULL) {
clif->message(fd, msg_txt(111)); // This NPC doesn't exist.
- return -1;
+ return false;
}
-
+
npc_enable(NPCname, 0);
clif->message(fd, msg_txt(112)); // Npc Disabled.
- return 0;
+ return true;
}
-ACMD_FUNC(loadnpc)
+ACMD(loadnpc)
{
FILE *fp;
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1132)); // Please enter a script file name (usage: @loadnpc <file name>).
- return -1;
+ return false;
}
-
+
// check if script file exists
if ((fp = fopen(message, "r")) == NULL) {
clif->message(fd, msg_txt(261));
- return -1;
+ return false;
}
fclose(fp);
-
+
// add to list of script sources and run it
npc_addsrcfile(message);
npc_parsesrcfile(message,true);
npc_read_event_script();
-
+
clif->message(fd, msg_txt(262));
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(unloadnpc)
+ACMD(unloadnpc)
{
struct npc_data *nd;
char NPCname[NAME_LENGTH+1];
nullpo_retr(-1, sd);
-
+
memset(NPCname, '\0', sizeof(NPCname));
-
+
if (!message || !*message || sscanf(message, "%24[^\n]", NPCname) < 1) {
clif->message(fd, msg_txt(1133)); // Please enter a NPC name (usage: @npcoff <NPC_name>).
- return -1;
+ return false;
}
-
+
if ((nd = npc_name2id(NPCname)) == NULL) {
clif->message(fd, msg_txt(111)); // This NPC doesn't exist.
- return -1;
+ return false;
}
-
+
npc_unload_duplicates(nd);
npc_unload(nd,true);
npc_read_event_script();
clif->message(fd, msg_txt(112)); // Npc Disabled.
- return 0;
+ return true;
}
/*==========================================
@@ -4391,17 +4348,17 @@ char* txt_time(unsigned int duration)
int days, hours, minutes, seconds;
char temp[CHAT_SIZE_MAX];
static char temp1[CHAT_SIZE_MAX];
-
+
memset(temp, '\0', sizeof(temp));
memset(temp1, '\0', sizeof(temp1));
-
+
days = duration / (60 * 60 * 24);
duration = duration - (60 * 60 * 24 * days);
hours = duration / (60 * 60);
duration = duration - (60 * 60 * hours);
minutes = duration / 60;
seconds = duration - (60 * minutes);
-
+
if (days == 1)
sprintf(temp, msg_txt(219), days); // %d day
else if (days > 1)
@@ -4418,7 +4375,7 @@ char* txt_time(unsigned int duration)
sprintf(temp1, msg_txt(225), temp, seconds); // %s and %d second
else if (seconds > 1)
sprintf(temp1, msg_txt(226), temp, seconds); // %s and %d seconds
-
+
return temp1;
}
@@ -4426,7 +4383,7 @@ char* txt_time(unsigned int duration)
* @time/@date/@serverdate/@servertime: Display the date/time of the server (by [Yor]
* Calculation management of GM modification (@day/@night GM commands) is done
*------------------------------------------*/
-ACMD_FUNC(servertime)
+ACMD(servertime)
{
const struct TimerData * timer_data;
const struct TimerData * timer_data2;
@@ -4434,15 +4391,15 @@ ACMD_FUNC(servertime)
struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ...
char temp[CHAT_SIZE_MAX];
nullpo_retr(-1, sd);
-
+
memset(temp, '\0', sizeof(temp));
-
+
time(&time_server); // get time in seconds since 1/1/1970
datetime = localtime(&time_server); // convert seconds in structure
// like sprintf, but only for date/time (Sunday, November 02 2003 15:12:52)
strftime(temp, sizeof(temp)-1, msg_txt(230), datetime); // Server time (normal time): %A, %B %d %Y %X.
clif->message(fd, temp);
-
+
if (battle_config.night_duration == 0 && battle_config.day_duration == 0) {
if (night_flag == 0)
clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
@@ -4456,43 +4413,43 @@ ACMD_FUNC(servertime)
clif->message(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight.
} else
clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
- else if (battle_config.day_duration == 0)
- if (night_flag == 0) { // we start with day
- timer_data = get_timer(night_timer_tid);
- sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
- clif->message(fd, temp);
- clif->message(fd, msg_txt(236)); // Game time: After, the game will be in permanent night.
- } else
- clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night.
- else {
- if (night_flag == 0) {
- timer_data = get_timer(night_timer_tid);
- timer_data2 = get_timer(day_timer_tid);
- sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
- clif->message(fd, temp);
- if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0)
- sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s.
- else
- sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s.
- clif->message(fd, temp);
- sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
- clif->message(fd, temp);
- } else {
- timer_data = get_timer(day_timer_tid);
- timer_data2 = get_timer(night_timer_tid);
- sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s.
- clif->message(fd, temp);
- if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0)
- sprintf(temp, msg_txt(239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s.
- else
- sprintf(temp, msg_txt(239), txt_time(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s.
- clif->message(fd, temp);
- sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
- clif->message(fd, temp);
- }
- }
-
- return 0;
+ else if (battle_config.day_duration == 0)
+ if (night_flag == 0) { // we start with day
+ timer_data = get_timer(night_timer_tid);
+ sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
+ clif->message(fd, temp);
+ clif->message(fd, msg_txt(236)); // Game time: After, the game will be in permanent night.
+ } else
+ clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night.
+ else {
+ if (night_flag == 0) {
+ timer_data = get_timer(night_timer_tid);
+ timer_data2 = get_timer(day_timer_tid);
+ sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
+ clif->message(fd, temp);
+ if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0)
+ sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s.
+ else
+ sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s.
+ clif->message(fd, temp);
+ sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
+ clif->message(fd, temp);
+ } else {
+ timer_data = get_timer(day_timer_tid);
+ timer_data2 = get_timer(night_timer_tid);
+ sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s.
+ clif->message(fd, temp);
+ if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0)
+ sprintf(temp, msg_txt(239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s.
+ else
+ sprintf(temp, msg_txt(239), txt_time(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s.
+ clif->message(fd, temp);
+ sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
+ clif->message(fd, temp);
+ }
+ }
+
+ return true;
}
//Added by Coltaro
@@ -4504,7 +4461,7 @@ static void get_jail_time(int jailtime, int* year, int* month, int* day, int* ho
const int factor_month = 43200; //30*24*60 = 43200
const int factor_day = 1440; //24*60 = 1440
const int factor_hour = 60;
-
+
*year = jailtime/factor_year;
jailtime -= *year*factor_year;
*month = jailtime/factor_month;
@@ -4514,7 +4471,7 @@ static void get_jail_time(int jailtime, int* year, int* month, int* day, int* ho
*hour = jailtime/factor_hour;
jailtime -= *hour*factor_hour;
*minute = jailtime;
-
+
*year = *year > 0? *year : 0;
*month = *month > 0? *month : 0;
*day = *day > 0? *day : 0;
@@ -4527,97 +4484,97 @@ static void get_jail_time(int jailtime, int* year, int* month, int* day, int* ho
* @jail <char_name> by [Yor]
* Special warp! No check with nowarp and nowarpto flag
*------------------------------------------*/
-ACMD_FUNC(jail)
+ACMD(jail)
{
struct map_session_data *pl_sd;
int x, y;
unsigned short m_index;
nullpo_retr(-1, sd);
-
+
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_txt(1134)); // Please enter a player name (usage: @jail <char_name>).
- return -1;
+ return false;
}
-
+
if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if (pc_get_group_level(sd) < pc_get_group_level(pl_sd))
{ // you can jail only lower or same GM
clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
- return -1;
+ return false;
}
-
+
if (pl_sd->sc.data[SC_JAILED])
{
clif->message(fd, msg_txt(118)); // Player warped in jails.
- return -1;
+ return false;
}
-
+
switch(rnd() % 2) { //Jail Locations
- case 0:
- m_index = mapindex_name2id(MAP_JAIL);
- x = 24;
- y = 75;
- break;
- default:
- m_index = mapindex_name2id(MAP_JAIL);
- x = 49;
- y = 75;
- break;
+ case 0:
+ m_index = mapindex_name2id(MAP_JAIL);
+ x = 24;
+ y = 75;
+ break;
+ default:
+ m_index = mapindex_name2id(MAP_JAIL);
+ x = 49;
+ y = 75;
+ break;
}
-
+
//Duration of INT_MAX to specify infinity.
sc_start4(&pl_sd->bl,SC_JAILED,100,INT_MAX,m_index,x,y,1000);
clif->message(pl_sd->fd, msg_txt(117)); // GM has send you in jails.
clif->message(fd, msg_txt(118)); // Player warped in jails.
- return 0;
+ return true;
}
/*==========================================
* @unjail/@discharge <char_name> by [Yor]
* Special warp! No check with nowarp and nowarpto flag
*------------------------------------------*/
-ACMD_FUNC(unjail)
+ACMD(unjail)
{
struct map_session_data *pl_sd;
-
+
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
-
+
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_txt(1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>).
- return -1;
+ return false;
}
-
+
if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { // you can jail only lower or same GM
-
+
clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
- return -1;
+ return false;
}
-
+
if (!pl_sd->sc.data[SC_JAILED])
{
clif->message(fd, msg_txt(119)); // This player is not in jails.
- return -1;
+ return false;
}
-
+
//Reset jail time to 1 sec.
sc_start(&pl_sd->bl,SC_JAILED,100,1,1000);
clif->message(pl_sd->fd, msg_txt(120)); // A GM has discharged you from jail.
clif->message(fd, msg_txt(121)); // Player unjailed.
- return 0;
+ return true;
}
-ACMD_FUNC(jailfor)
+ACMD(jailfor)
{
struct map_session_data *pl_sd = NULL;
int year, month, day, hour, minute, value;
@@ -4625,14 +4582,14 @@ ACMD_FUNC(jailfor)
int jailtime = 0,x,y;
short m_index = 0;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%255s %23[^\n]",atcmd_output,atcmd_player_name) < 2) {
clif->message(fd, msg_txt(400)); //Usage: @jailfor <time> <character name>
- return -1;
+ return false;
}
-
+
atcmd_output[sizeof(atcmd_output)-1] = '\0';
-
+
modif_p = atcmd_output;
year = month = day = hour = minute = 0;
while (modif_p[0] != '\0') {
@@ -4667,32 +4624,32 @@ ACMD_FUNC(jailfor)
}
}
}
-
+
if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0) {
clif->message(fd, msg_txt(1136)); // Invalid time for jail command.
- return -1;
+ return false;
}
-
+
if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if (pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
- return -1;
+ return false;
}
-
+
jailtime = year*12*30*24*60 + month*30*24*60 + day*24*60 + hour*60 + minute; //In minutes
-
+
if(jailtime==0) {
clif->message(fd, msg_txt(1136)); // Invalid time for jail command.
- return -1;
+ return false;
}
-
+
//Added by Coltaro
if(pl_sd->sc.data[SC_JAILED] &&
- pl_sd->sc.data[SC_JAILED]->val1 != INT_MAX)
+ pl_sd->sc.data[SC_JAILED]->val1 != INT_MAX)
{ //Update the player's jail time
jailtime += pl_sd->sc.data[SC_JAILED]->val1;
if (jailtime <= 0) {
@@ -4708,9 +4665,9 @@ ACMD_FUNC(jailfor)
}
} else if (jailtime < 0) {
clif->message(fd, msg_txt(1136));
- return -1;
+ return false;
}
-
+
//Jail locations, add more as you wish.
switch(rnd()%2)
{
@@ -4723,56 +4680,56 @@ ACMD_FUNC(jailfor)
x = 24; y = 75;
break;
}
-
+
sc_start4(&pl_sd->bl,SC_JAILED,100,jailtime,m_index,x,y,jailtime?60000:1000); //jailtime = 0: Time was reset to 0. Wait 1 second to warp player out (since it's done in status_change_timer).
- return 0;
+ return true;
}
//By Coltaro
-ACMD_FUNC(jailtime)
+ACMD(jailtime)
{
int year, month, day, hour, minute;
-
+
nullpo_retr(-1, sd);
-
+
if (!sd->sc.data[SC_JAILED]) {
clif->message(fd, msg_txt(1139)); // You are not in jail.
- return -1;
+ return false;
}
-
+
if (sd->sc.data[SC_JAILED]->val1 == INT_MAX) {
clif->message(fd, msg_txt(1140)); // You have been jailed indefinitely.
- return 0;
+ return true;
}
-
+
if (sd->sc.data[SC_JAILED]->val1 <= 0) { // Was not jailed with @jailfor (maybe @jail? or warped there? or got recalled?)
clif->message(fd, msg_txt(1141)); // You have been jailed for an unknown amount of time.
- return -1;
+ return false;
}
-
+
//Get remaining jail time
get_jail_time(sd->sc.data[SC_JAILED]->val1,&year,&month,&day,&hour,&minute);
sprintf(atcmd_output,msg_txt(402),msg_txt(1142),year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes
-
+
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
/*==========================================
* @disguise <mob_id> by [Valaris] (simplified by [Yor])
*------------------------------------------*/
-ACMD_FUNC(disguise)
+ACMD(disguise)
{
int id = 0;
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>).
- return -1;
+ return false;
}
-
+
if ((id = atoi(message)) > 0)
{ //Acquired an ID
if (!mobdb_checkid(id) && !npcdb_checkid(id))
@@ -4785,75 +4742,75 @@ ACMD_FUNC(disguise)
id = nd->class_;
}
}
-
+
if (id == 0)
{
clif->message(fd, msg_txt(123)); // Invalid Monster/NPC name/ID specified.
- return -1;
+ return false;
}
-
+
if(pc_isriding(sd))
{
clif->message(fd, msg_txt(1144)); // Character cannot be disguised while mounted.
- return -1;
+ return false;
}
-
+
pc_disguise(sd, id);
clif->message(fd, msg_txt(122)); // Disguise applied.
-
- return 0;
+
+ return true;
}
/*==========================================
* DisguiseAll
*------------------------------------------*/
-ACMD_FUNC(disguiseall)
+ACMD(disguiseall)
{
int mob_id=0;
struct map_session_data *pl_sd;
struct s_mapiterator* iter;
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>).
- return -1;
+ return false;
}
-
+
if ((mob_id = mobdb_searchname(message)) == 0) // check name first (to avoid possible name begining by a number)
mob_id = atoi(message);
-
+
if (!mobdb_checkid(mob_id) && !npcdb_checkid(mob_id)) { //if mob or npc...
clif->message(fd, msg_txt(123)); // Monster/NPC name/id not found.
- return -1;
+ return false;
}
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
pc_disguise(pl_sd, mob_id);
mapit_free(iter);
-
+
clif->message(fd, msg_txt(122)); // Disguise applied.
- return 0;
+ return true;
}
/*==========================================
* DisguiseGuild
*------------------------------------------*/
-ACMD_FUNC(disguiseguild)
+ACMD(disguiseguild)
{
int id = 0, i;
char monster[NAME_LENGTH], guild[NAME_LENGTH];
struct map_session_data *pl_sd;
struct guild *g;
-
+
memset(monster, '\0', sizeof(monster));
memset(guild, '\0', sizeof(guild));
-
+
if( !message || !*message || sscanf(message, "%23[^,], %23[^\r\n]", monster, guild) < 2 ) {
clif->message(fd, msg_txt(1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>).
- return -1;
+ return false;
}
-
+
if( (id = atoi(monster)) > 0 ) {
if( !mobdb_checkid(id) && !npcdb_checkid(id) )
id = 0;
@@ -4864,30 +4821,30 @@ ACMD_FUNC(disguiseguild)
id = nd->class_;
}
}
-
+
if( id == 0 ) {
clif->message(fd, msg_txt(123)); // Monster/NPC name/id hasn't been found.
- return -1;
+ return false;
}
-
+
if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) {
clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
- return -1;
+ return false;
}
-
+
for( i = 0; i < g->max_member; i++ )
if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) )
pc_disguise(pl_sd, id);
-
+
clif->message(fd, msg_txt(122)); // Disguise applied.
- return 0;
+ return true;
}
/*==========================================
* @undisguise by [Yor]
*------------------------------------------*/
-ACMD_FUNC(undisguise)
+ACMD(undisguise)
{
nullpo_retr(-1, sd);
if (sd->disguise) {
@@ -4895,341 +4852,341 @@ ACMD_FUNC(undisguise)
clif->message(fd, msg_txt(124)); // Undisguise applied.
} else {
clif->message(fd, msg_txt(125)); // You're not disguised.
- return -1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* UndisguiseAll
*------------------------------------------*/
-ACMD_FUNC(undisguiseall)
+ACMD(undisguiseall)
{
struct map_session_data *pl_sd;
struct s_mapiterator* iter;
nullpo_retr(-1, sd);
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
if( pl_sd->disguise )
pc_disguise(pl_sd, 0);
mapit_free(iter);
-
+
clif->message(fd, msg_txt(124)); // Undisguise applied.
-
- return 0;
+
+ return true;
}
/*==========================================
* UndisguiseGuild
*------------------------------------------*/
-ACMD_FUNC(undisguiseguild)
+ACMD(undisguiseguild)
{
char guild_name[NAME_LENGTH];
struct map_session_data *pl_sd;
struct guild *g;
int i;
nullpo_retr(-1, sd);
-
+
memset(guild_name, '\0', sizeof(guild_name));
-
+
if(!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
clif->message(fd, msg_txt(1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>).
- return -1;
+ return false;
}
-
+
if( (g = guild_searchname(guild_name)) == NULL && (g = guild_search(atoi(message))) == NULL ) {
clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
- return -1;
+ return false;
}
-
+
for(i = 0; i < g->max_member; i++)
if( (pl_sd = g->member[i].sd) && pl_sd->disguise )
pc_disguise(pl_sd, 0);
-
+
clif->message(fd, msg_txt(124)); // Undisguise applied.
-
- return 0;
+
+ return true;
}
/*==========================================
* @exp by [Skotlex]
*------------------------------------------*/
-ACMD_FUNC(exp)
+ACMD(exp)
{
char output[CHAT_SIZE_MAX];
double nextb, nextj;
nullpo_retr(-1, sd);
memset(output, '\0', sizeof(output));
-
+
nextb = pc_nextbaseexp(sd);
if (nextb)
nextb = sd->status.base_exp*100.0/nextb;
-
+
nextj = pc_nextjobexp(sd);
if (nextj)
nextj = sd->status.job_exp*100.0/nextj;
-
+
sprintf(output, msg_txt(1148), sd->status.base_level, nextb, sd->status.job_level, nextj); // Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)
clif->message(fd, output);
- return 0;
+ return true;
}
/*==========================================
* @broadcast by [Valaris]
*------------------------------------------*/
-ACMD_FUNC(broadcast)
+ACMD(broadcast)
{
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1149)); // Please enter a message (usage: @broadcast <message>).
- return -1;
+ return false;
}
-
+
sprintf(atcmd_output, "%s: %s", sd->status.name, message);
intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, 0);
-
- return 0;
+
+ return true;
}
/*==========================================
* @localbroadcast by [Valaris]
*------------------------------------------*/
-ACMD_FUNC(localbroadcast)
+ACMD(localbroadcast)
{
nullpo_retr(-1, sd);
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1150)); // Please enter a message (usage: @localbroadcast <message>).
- return -1;
+ return false;
}
-
+
sprintf(atcmd_output, "%s: %s", sd->status.name, message);
-
+
clif->broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP);
-
- return 0;
+
+ return true;
}
/*==========================================
* @email <actual@email> <new@email> by [Yor]
*------------------------------------------*/
-ACMD_FUNC(email)
+ACMD(email)
{
char actual_email[100];
char new_email[100];
nullpo_retr(-1, sd);
-
+
memset(actual_email, '\0', sizeof(actual_email));
memset(new_email, '\0', sizeof(new_email));
-
+
if (!message || !*message || sscanf(message, "%99s %99s", actual_email, new_email) < 2) {
clif->message(fd, msg_txt(1151)); // Please enter 2 emails (usage: @email <actual@email> <new@email>).
- return -1;
+ return false;
}
-
+
if (e_mail_check(actual_email) == 0) {
clif->message(fd, msg_txt(144)); // Invalid actual email. If you have default e-mail, give a@a.com.
- return -1;
+ return false;
} else if (e_mail_check(new_email) == 0) {
clif->message(fd, msg_txt(145)); // Invalid new email. Please enter a real e-mail.
- return -1;
+ return false;
} else if (strcmpi(new_email, "a@a.com") == 0) {
clif->message(fd, msg_txt(146)); // New email must be a real e-mail.
- return -1;
+ return false;
} else if (strcmpi(actual_email, new_email) == 0) {
clif->message(fd, msg_txt(147)); // New email must be different of the actual e-mail.
- return -1;
+ return false;
}
-
+
chrif_changeemail(sd->status.account_id, actual_email, new_email);
clif->message(fd, msg_txt(148)); // Information sended to login-server via char-server.
- return 0;
+ return true;
}
/*==========================================
*@effect
*------------------------------------------*/
-ACMD_FUNC(effect)
+ACMD(effect)
{
int type = 0, flag = 0;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%d", &type) < 1) {
clif->message(fd, msg_txt(1152)); // Please enter an effect number (usage: @effect <effect number>).
- return -1;
+ return false;
}
-
+
clif->specialeffect(&sd->bl, type, (send_target)flag);
clif->message(fd, msg_txt(229)); // Your effect has changed.
- return 0;
+ return true;
}
/*==========================================
* @killer by MouseJstr
* enable killing players even when not in pvp
*------------------------------------------*/
-ACMD_FUNC(killer)
+ACMD(killer)
{
nullpo_retr(-1, sd);
sd->state.killer = !sd->state.killer;
-
+
if(sd->state.killer)
clif->message(fd, msg_txt(241));
else {
clif->message(fd, msg_txt(292));
pc_stop_attack(sd);
}
- return 0;
+ return true;
}
/*==========================================
* @killable by MouseJstr
* enable other people killing you
*------------------------------------------*/
-ACMD_FUNC(killable)
+ACMD(killable)
{
nullpo_retr(-1, sd);
sd->state.killable = !sd->state.killable;
-
+
if(sd->state.killable)
clif->message(fd, msg_txt(242));
else {
clif->message(fd, msg_txt(288));
map_foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);
}
- return 0;
+ return true;
}
/*==========================================
* @skillon by MouseJstr
* turn skills on for the map
*------------------------------------------*/
-ACMD_FUNC(skillon)
+ACMD(skillon)
{
nullpo_retr(-1, sd);
map[sd->bl.m].flag.noskill = 0;
clif->message(fd, msg_txt(244));
- return 0;
+ return true;
}
/*==========================================
* @skilloff by MouseJstr
* Turn skills off on the map
*------------------------------------------*/
-ACMD_FUNC(skilloff)
+ACMD(skilloff)
{
nullpo_retr(-1, sd);
map[sd->bl.m].flag.noskill = 1;
clif->message(fd, msg_txt(243));
- return 0;
+ return true;
}
/*==========================================
* @npcmove by MouseJstr
* move a npc
*------------------------------------------*/
-ACMD_FUNC(npcmove)
+ACMD(npcmove)
{
int x = 0, y = 0, m;
struct npc_data *nd = 0;
nullpo_retr(-1, sd);
memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
-
+
if (!message || !*message || sscanf(message, "%d %d %23[^\n]", &x, &y, atcmd_player_name) < 3) {
clif->message(fd, msg_txt(1153)); // Usage: @npcmove <X> <Y> <npc_name>
- return -1;
+ return false;
}
-
+
if ((nd = npc_name2id(atcmd_player_name)) == NULL)
{
clif->message(fd, msg_txt(111)); // This NPC doesn't exist.
- return -1;
+ return false;
}
-
+
if ((m=nd->bl.m) < 0 || nd->bl.prev == NULL)
{
clif->message(fd, msg_txt(1154)); // NPC is not on this map.
- return -1; //Not on a map.
+ return false; //Not on a map.
}
-
+
x = cap_value(x, 0, map[m].xs-1);
y = cap_value(y, 0, map[m].ys-1);
map_foreachinrange(clif->outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
map_moveblock(&nd->bl, x, y, gettick());
map_foreachinrange(clif->insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
clif->message(fd, msg_txt(1155)); // NPC moved.
-
- return 0;
+
+ return true;
}
/*==========================================
* @addwarp by MouseJstr
* Create a new static warp point.
*------------------------------------------*/
-ACMD_FUNC(addwarp)
+ACMD(addwarp)
{
char mapname[32], warpname[NAME_LENGTH+1];
int x,y;
unsigned short m;
struct npc_data* nd;
-
+
nullpo_retr(-1, sd);
memset(warpname, '\0', sizeof(warpname));
-
+
if (!message || !*message || sscanf(message, "%31s %d %d %23[^\n]", mapname, &x, &y, warpname) < 4) {
clif->message(fd, msg_txt(1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name>
- return -1;
+ return false;
}
-
+
m = mapindex_name2id(mapname);
if( m == 0 )
{
sprintf(atcmd_output, msg_txt(1157), mapname); // Unknown map '%s'.
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
nd = npc_add_warp(warpname, sd->bl.m, sd->bl.x, sd->bl.y, 2, 2, m, x, y);
if( nd == NULL )
- return -1;
-
+ return false;
+
sprintf(atcmd_output, msg_txt(1158), nd->exname); // New warp NPC '%s' created.
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
/*==========================================
* @follow by [MouseJstr]
* Follow a player .. staying no more then 5 spaces away
*------------------------------------------*/
-ACMD_FUNC(follow)
+ACMD(follow)
{
struct map_session_data *pl_sd = NULL;
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
if (sd->followtarget == -1)
- return -1;
-
+ return false;
+
pc_stop_following (sd);
clif->message(fd, msg_txt(1159)); // Follow mode OFF.
- return 0;
+ return true;
}
-
+
if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
{
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if (sd->followtarget == pl_sd->bl.id) {
pc_stop_following (sd);
clif->message(fd, msg_txt(1159)); // Follow mode OFF.
@@ -5237,8 +5194,8 @@ ACMD_FUNC(follow)
pc_follow(sd, pl_sd->bl.id);
clif->message(fd, msg_txt(1160)); // Follow mode ON.
}
-
- return 0;
+
+ return true;
}
@@ -5246,37 +5203,37 @@ ACMD_FUNC(follow)
* @dropall by [MouseJstr]
* Drop all your possession on the ground
*------------------------------------------*/
-ACMD_FUNC(dropall)
+ACMD(dropall)
{
int i;
nullpo_retr(-1, sd);
for (i = 0; i < MAX_INVENTORY; i++) {
- if (sd->status.inventory[i].amount) {
- if(sd->status.inventory[i].equip != 0)
- pc_unequipitem(sd, i, 3);
+ if (sd->status.inventory[i].amount) {
+ if(sd->status.inventory[i].equip != 0)
+ pc_unequipitem(sd, i, 3);
pc_dropitem(sd, i, sd->status.inventory[i].amount);
}
}
- return 0;
+ return true;
}
/*==========================================
* @storeall by [MouseJstr]
* Put everything into storage
*------------------------------------------*/
-ACMD_FUNC(storeall)
+ACMD(storeall)
{
int i;
nullpo_retr(-1, sd);
-
+
if (sd->state.storage_flag != 1)
{ //Open storage.
if( storage_storageopen(sd) == 1 ) {
clif->message(fd, msg_txt(1161)); // You currently cannot open your storage.
- return -1;
+ return false;
}
}
-
+
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) {
if(sd->status.inventory[i].equip != 0)
@@ -5285,60 +5242,60 @@ ACMD_FUNC(storeall)
}
}
storage_storageclose(sd);
-
+
clif->message(fd, msg_txt(1162)); // All items stored.
- return 0;
+ return true;
}
-ACMD_FUNC(clearstorage)
+ACMD(clearstorage)
{
int i, j;
nullpo_retr(-1, sd);
-
+
if (sd->state.storage_flag == 1) {
clif->message(fd, msg_txt(250));
- return -1;
+ return false;
}
-
+
j = sd->status.storage.storage_amount;
for (i = 0; i < j; ++i) {
storage_delitem(sd, i, sd->status.storage.items[i].amount);
}
storage_storageclose(sd);
-
+
clif->message(fd, msg_txt(1394)); // Your storage was cleaned.
- return 0;
+ return true;
}
-ACMD_FUNC(cleargstorage)
+ACMD(cleargstorage)
{
int i, j;
struct guild *g;
struct guild_storage *gstorage;
nullpo_retr(-1, sd);
-
+
g = sd->guild;
-
+
if (g == NULL) {
clif->message(fd, msg_txt(43));
- return -1;
+ return false;
}
-
+
if (sd->state.storage_flag == 1) {
clif->message(fd, msg_txt(250));
- return -1;
+ return false;
}
-
+
if (sd->state.storage_flag == 2) {
clif->message(fd, msg_txt(251));
- return -1;
+ return false;
}
-
+
gstorage = guild2storage2(sd->status.guild_id);
if (gstorage == NULL) {// Doesn't have opened @gstorage yet, so we skip the deletion since *shouldn't* have any item there.
- return -1;
+ return false;
}
-
+
j = gstorage->storage_amount;
gstorage->lock = 1; // Lock @gstorage: do not allow any item to be retrieved or stored from any guild member
for (i = 0; i < j; ++i) {
@@ -5346,34 +5303,34 @@ ACMD_FUNC(cleargstorage)
}
storage_guild_storageclose(sd);
gstorage->lock = 0; // Cleaning done, release lock
-
+
clif->message(fd, msg_txt(1395)); // Your guild storage was cleaned.
- return 0;
+ return true;
}
-ACMD_FUNC(clearcart)
+ACMD(clearcart)
{
int i;
nullpo_retr(-1, sd);
-
+
if (pc_iscarton(sd) == 0) {
clif->message(fd, msg_txt(1396)); // You do not have a cart to be cleaned.
- return -1;
+ return false;
}
-
+
if (sd->state.vending == 1) { //Somehow...
- return -1;
+ return false;
}
-
+
for( i = 0; i < MAX_CART; i++ )
if(sd->status.cart[i].nameid > 0)
pc_cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER);
-
+
clif->clearcart(fd);
clif->updatestatus(sd,SP_CARTINFO);
-
+
clif->message(fd, msg_txt(1397)); // Your cart was cleaned.
- return 0;
+ return true;
}
/*==========================================
@@ -5382,7 +5339,7 @@ ACMD_FUNC(clearcart)
*------------------------------------------*/
#define MAX_SKILLID_PARTIAL_RESULTS 5
#define MAX_SKILLID_PARTIAL_RESULTS_LEN 74 /* "skill " (6) + "%d:" (up to 5) + "%s" (up to 30) + " (%s)" (up to 33) */
-ACMD_FUNC(skillid) {
+ACMD(skillid) {
int skillen, idx, i, found = 0;
DBIterator* iter;
DBKey key;
@@ -5390,12 +5347,12 @@ ACMD_FUNC(skillid) {
char partials[MAX_SKILLID_PARTIAL_RESULTS][MAX_SKILLID_PARTIAL_RESULTS_LEN];
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1163)); // Please enter a skill name to look up (usage: @skillid <skill name>).
- return -1;
+ return false;
}
-
+
skillen = strlen(message);
iter = db_iterator(skilldb_name2id);
@@ -5421,14 +5378,14 @@ ACMD_FUNC(skillid) {
clif->message(fd, partials[i]);
}
- return 0;
+ return true;
}
/*==========================================
* @useskill by [MouseJstr]
* A way of using skills without having to find them in the skills menu
*------------------------------------------*/
-ACMD_FUNC(useskill)
+ACMD(useskill)
{
struct map_session_data *pl_sd = NULL;
struct block_list *bl;
@@ -5436,36 +5393,36 @@ ACMD_FUNC(useskill)
uint16 skill_lv;
char target[100];
nullpo_retr(-1, sd);
-
+
if(!message || !*message || sscanf(message, "%hu %hu %23[^\n]", &skill_id, &skill_lv, target) != 3) {
clif->message(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target>
- return -1;
+ return false;
}
-
+
if(!strcmp(target,"self")) pl_sd = sd; //quick keyword
else if ( (pl_sd = map_nick2sd(target)) == NULL ){
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
{
clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
- return -1;
+ return false;
}
-
+
if (skill_id >= HM_SKILLBASE && skill_id < HM_SKILLBASE+MAX_HOMUNSKILL
&& sd->hd && merc_is_hom_active(sd->hd)) // (If used with @useskill, put the homunc as dest)
bl = &sd->hd->bl;
else
bl = &sd->bl;
-
+
if (skill->get_inf(skill_id)&INF_GROUND_SKILL)
unit_skilluse_pos(bl, pl_sd->bl.x, pl_sd->bl.y, skill_id, skill_lv);
else
unit_skilluse_id(bl, pl_sd->bl.id, skill_id, skill_lv);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -5473,32 +5430,32 @@ ACMD_FUNC(useskill)
* Debug command to locate new skill IDs. It sends the
* three possible skill-effect packets to the area.
*------------------------------------------*/
-ACMD_FUNC(displayskill)
+ACMD(displayskill)
{
struct status_data * status;
unsigned int tick;
uint16 skill_id;
uint16 skill_lv = 1;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%hu %hu", &skill_id, &skill_lv) < 1)
{
clif->message(fd, msg_txt(1166)); // Usage: @displayskill <skill ID> {<skill level>}
- return -1;
+ return false;
}
status = status_get_status_data(&sd->bl);
tick = gettick();
clif->skill_damage(&sd->bl,&sd->bl, tick, status->amotion, status->dmotion, 1, 1, skill_id, skill_lv, 5);
clif->skill_nodamage(&sd->bl, &sd->bl, skill_id, skill_lv, 1);
clif->skill_poseffect(&sd->bl, skill_id, skill_lv, sd->bl.x, sd->bl.y, tick);
- return 0;
+ return true;
}
/*==========================================
* @skilltree by [MouseJstr]
* prints the skill tree for a player required to get to a skill
*------------------------------------------*/
-ACMD_FUNC(skilltree)
+ACMD(skilltree)
{
struct map_session_data *pl_sd = NULL;
uint16 skill_id;
@@ -5506,33 +5463,33 @@ ACMD_FUNC(skilltree)
char target[NAME_LENGTH];
struct skill_tree_entry *ent;
nullpo_retr(-1, sd);
-
+
if(!message || !*message || sscanf(message, "%hu %23[^\r\n]", &skill_id, target) != 2) {
clif->message(fd, msg_txt(1167)); // Usage: @skilltree <skill ID> <target>
- return -1;
+ return false;
}
-
+
if ( (pl_sd = map_nick2sd(target)) == NULL )
{
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
c = pc_calc_skilltree_normalize_job(pl_sd);
c = pc_mapid2jobid(c, pl_sd->status.sex);
-
+
sprintf(atcmd_output, msg_txt(1168), job_name(c), pc_checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points).
clif->message(fd, atcmd_output);
-
+
ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skill_id );
if( j == MAX_SKILL_TREE || skill_tree[c][j].id == 0 )
{
clif->message(fd, msg_txt(1169)); // The player cannot use that skill.
- return 0;
+ return true;
}
-
+
ent = &skill_tree[c][j];
-
+
meets = 1;
for(j=0;j<MAX_PC_SKILL_REQUIRE;j++)
{
@@ -5546,8 +5503,8 @@ ACMD_FUNC(skilltree)
if (meets == 1) {
clif->message(fd, msg_txt(1171)); // The player meets all the requirements for that skill.
}
-
- return 0;
+
+ return true;
}
// Hand a ring with partners name on it to this char
@@ -5556,14 +5513,14 @@ void getring (struct map_session_data* sd)
int flag, item_id;
struct item item_tmp;
item_id = (sd->status.sex) ? WEDDING_RING_M : WEDDING_RING_F;
-
+
memset(&item_tmp, 0, sizeof(item_tmp));
item_tmp.nameid = item_id;
item_tmp.identify = 1;
item_tmp.card[0] = 255;
item_tmp.card[2] = sd->status.partner_id;
item_tmp.card[3] = sd->status.partner_id >> 16;
-
+
if((flag = pc_additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) {
clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
@@ -5574,66 +5531,66 @@ void getring (struct map_session_data* sd)
* @marry by [MouseJstr], fixed by Lupus
* Marry two players
*------------------------------------------*/
-ACMD_FUNC(marry)
+ACMD(marry)
{
struct map_session_data *pl_sd = NULL;
char player_name[NAME_LENGTH] = "";
-
+
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%23s", player_name) != 1) {
clif->message(fd, msg_txt(1172)); // Usage: @marry <char name>
- return -1;
+ return false;
}
-
+
if ((pl_sd = map_nick2sd(player_name)) == NULL) {
clif->message(fd, msg_txt(3));
- return -1;
+ return false;
}
-
+
if (pc_marriage(sd, pl_sd) == 0) {
clif->message(fd, msg_txt(1173)); // They are married... wish them well.
clif->wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus]
getring(sd); // Auto-give named rings (Aru)
getring(pl_sd);
- return 0;
+ return true;
}
-
+
clif->message(fd, msg_txt(1174)); // The two cannot wed because one is either a baby or already married.
- return -1;
+ return false;
}
/*==========================================
* @divorce by [MouseJstr], fixed by [Lupus]
* divorce two players
*------------------------------------------*/
-ACMD_FUNC(divorce)
+ACMD(divorce)
{
nullpo_retr(-1, sd);
-
+
if (pc_divorce(sd) != 0) {
sprintf(atcmd_output, msg_txt(1175), sd->status.name); // '%s' is not married.
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
sprintf(atcmd_output, msg_txt(1176), sd->status.name); // '%s' and his/her partner are now divorced.
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
/*==========================================
* @changelook by [Celest]
*------------------------------------------*/
-ACMD_FUNC(changelook)
+ACMD(changelook)
{
int i, j = 0, k = 0;
int pos[7] = { LOOK_HEAD_TOP,LOOK_HEAD_MID,LOOK_HEAD_BOTTOM,LOOK_WEAPON,LOOK_SHIELD,LOOK_SHOES,LOOK_ROBE };
-
+
if((i = sscanf(message, "%d %d", &j, &k)) < 1) {
clif->message(fd, msg_txt(1177)); // Usage: @changelook {<position>} <view id>
clif->message(fd, msg_txt(1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe
- return -1;
+ return false;
} else if ( i == 2 ) {
if (j < 1 || j > 7)
j = 1;
@@ -5642,170 +5599,149 @@ ACMD_FUNC(changelook)
k = j; // swap
j = LOOK_HEAD_TOP;
}
-
+
clif->changelook(&sd->bl,j,k);
-
- return 0;
+
+ return true;
}
/*==========================================
* @autotrade by durf [Lupus] [Paradox924X]
* Turns on/off Autotrade for a specific player
*------------------------------------------*/
-ACMD_FUNC(autotrade) {
- int i;
+ACMD(autotrade) {
nullpo_retr(-1, sd);
-
+
if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {
clif->message(fd, msg_txt(1179)); // Autotrade is not allowed on this map.
- return -1;
+ return false;
}
-
+
if( pc_isdead(sd) ) {
clif->message(fd, msg_txt(1180)); // You cannot autotrade when dead.
- return -1;
+ return false;
}
-
+
if( !sd->state.vending && !sd->state.buyingstore ) { //check if player is vending or buying
clif->message(fd, msg_txt(549)); // "You should have a shop open to use @autotrade."
- return -1;
+ return false;
}
-
+
sd->state.autotrade = 1;
if( battle_config.at_timeout ) {
int timeout = atoi(message);
status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0);
}
- if( hChSys.ally && sd->status.guild_id ) {
- struct guild *g = sd->guild, *sg;
- if( g ) {
- if( idb_exists(((struct hChSysCh *)g->channel)->users, sd->status.char_id) )
- clif->chsys_left((struct hChSysCh *)g->channel,sd);
- for (i = 0; i < MAX_GUILDALLIANCE; i++) {
- if( g->alliance[i].guild_id && (sg = guild_search(g->alliance[i].guild_id) ) ) {
- if( idb_exists(((struct hChSysCh *)sg->channel)->users, sd->status.char_id) )
- clif->chsys_left((struct hChSysCh *)sg->channel,sd);
- break;
- }
- }
- }
- }
-
- if( sd->channel_count ) {
- for( i = 0; i < sd->channel_count; i++ ) {
- if( sd->channels[i] != NULL )
- clif->chsys_left(sd->channels[i],sd);
- }
- }
+ clif->chsys_quit(sd);
clif->authfail_fd(sd->fd, 15);
-
- return 0;
+
+ return true;
}
/*==========================================
* @changegm by durf (changed by Lupus)
* Changes Master of your Guild to a specified guild member
*------------------------------------------*/
-ACMD_FUNC(changegm)
+ACMD(changegm)
{
struct guild *g;
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
-
+
if (sd->status.guild_id == 0 || (g = sd->guild) == NULL || strcmp(g->master,sd->status.name)) {
clif->message(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
- return -1;
+ return false;
}
-
+
if( map[sd->bl.m].flag.guildlock || map[sd->bl.m].flag.gvg_castle ) {
clif->message(fd, msg_txt(1182)); // You cannot change guild leaders on this map.
- return -1;
+ return false;
}
-
+
if( !message[0] ) {
clif->message(fd, msg_txt(1183)); // Usage: @changegm <guild_member_name>
- return -1;
+ return false;
}
-
+
if((pl_sd=map_nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
clif->message(fd, msg_txt(1184)); // Target character must be online and be a guild member.
- return -1;
+ return false;
}
-
+
guild_gm_change(sd->status.guild_id, pl_sd);
- return 0;
+ return true;
}
/*==========================================
* @changeleader by Skotlex
* Changes the leader of a party.
*------------------------------------------*/
-ACMD_FUNC(changeleader)
+ACMD(changeleader)
{
nullpo_retr(-1, sd);
-
+
if( !message[0] )
{
clif->message(fd, msg_txt(1185)); // Usage: @changeleader <party_member_name>
- return -1;
+ return false;
}
-
+
if (party_changeleader(sd, map_nick2sd((char *) message)))
- return 0;
- return -1;
+ return true;
+ return false;
}
/*==========================================
* @partyoption by Skotlex
* Used to change the item share setting of a party.
*------------------------------------------*/
-ACMD_FUNC(partyoption)
+ACMD(partyoption)
{
struct party_data *p;
int mi, option;
char w1[16], w2[16];
nullpo_retr(-1, sd);
-
+
if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == NULL)
{
clif->message(fd, msg_txt(282));
- return -1;
+ return false;
}
-
+
ARR_FIND( 0, MAX_PARTY, mi, p->data[mi].sd == sd );
if (mi == MAX_PARTY)
- return -1; //Shouldn't happen
-
+ return false; //Shouldn't happen
+
if (!p->party.member[mi].leader)
{
clif->message(fd, msg_txt(282));
- return -1;
+ return false;
}
-
+
if(!message || !*message || sscanf(message, "%15s %15s", w1, w2) < 2)
{
clif->message(fd, msg_txt(1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no>
- return -1;
+ return false;
}
-
+
option = (config_switch(w1)?1:0)|(config_switch(w2)?2:0);
-
+
//Change item share type.
if (option != p->party.item)
party_changeoption(sd, p->party.exp, option);
else
clif->message(fd, msg_txt(286));
-
- return 0;
+
+ return true;
}
/*==========================================
* @autoloot by Upa-Kun
* Turns on/off AutoLoot for a specific player
*------------------------------------------*/
-ACMD_FUNC(autoloot)
+ACMD(autoloot)
{
int rate;
nullpo_retr(-1, sd);
@@ -5823,26 +5759,26 @@ ACMD_FUNC(autoloot)
}
if (rate < 0) rate = 0;
if (rate > 10000) rate = 10000;
-
+
sd->state.autoloot = rate;
if (sd->state.autoloot) {
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1187),((double)sd->state.autoloot)/100.); // Autolooting items with drop rates of %0.02f%% and below.
clif->message(fd, atcmd_output);
}else
clif->message(fd, msg_txt(1188)); // Autoloot is now off.
-
- return 0;
+
+ return true;
}
/*==========================================
* @alootid
*------------------------------------------*/
-ACMD_FUNC(autolootitem)
+ACMD(autolootitem)
{
struct item_data *item_data = NULL;
int i;
int action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset
-
+
if (message && *message) {
if (message[0] == '+') {
message++;
@@ -5855,7 +5791,7 @@ ACMD_FUNC(autolootitem)
else if (!strcmp(message,"reset"))
action = 4;
}
-
+
if (action < 3) // add or remove
{
if ((item_data = itemdb_exists(atoi(message))) == NULL)
@@ -5863,71 +5799,71 @@ ACMD_FUNC(autolootitem)
if (!item_data) {
// No items founds in the DB with Id or Name
clif->message(fd, msg_txt(1189)); // Item not found.
- return -1;
+ return false;
}
}
-
+
switch(action) {
- case 1:
- ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
- if (i != AUTOLOOTITEM_SIZE) {
- clif->message(fd, msg_txt(1190)); // You're already autolooting this item.
- return -1;
- }
- ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == 0);
- if (i == AUTOLOOTITEM_SIZE) {
- clif->message(fd, msg_txt(1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>.
- return -1;
- }
- sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated
- sprintf(atcmd_output, msg_txt(1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d}
- clif->message(fd, atcmd_output);
- sd->state.autolooting = 1;
- break;
- case 2:
- ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
- if (i == AUTOLOOTITEM_SIZE) {
- clif->message(fd, msg_txt(1193)); // You're currently not autolooting this item.
- return -1;
- }
- sd->state.autolootid[i] = 0;
- sprintf(atcmd_output, msg_txt(1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list.
- clif->message(fd, atcmd_output);
- ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
- if (i == AUTOLOOTITEM_SIZE) {
- sd->state.autolooting = 0;
- }
- break;
- case 3:
- sprintf(atcmd_output, msg_txt(1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list.
- clif->message(fd, atcmd_output);
- clif->message(fd, msg_txt(1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>".
- clif->message(fd, msg_txt(1197)); // "@alootid reset" will clear your autolootitem list.
- ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
- if (i == AUTOLOOTITEM_SIZE) {
- clif->message(fd, msg_txt(1198)); // Your autolootitem list is empty.
- } else {
- clif->message(fd, msg_txt(1199)); // Items on your autolootitem list:
- for(i = 0; i < AUTOLOOTITEM_SIZE; i++)
- {
- if (sd->state.autolootid[i] == 0)
- continue;
- if (!(item_data = itemdb_exists(sd->state.autolootid[i]))) {
- ShowDebug("Non-existant item %d on autolootitem list (account_id: %d, char_id: %d)", sd->state.autolootid[i], sd->status.account_id, sd->status.char_id);
- continue;
+ case 1:
+ ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
+ if (i != AUTOLOOTITEM_SIZE) {
+ clif->message(fd, msg_txt(1190)); // You're already autolooting this item.
+ return false;
+ }
+ ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == 0);
+ if (i == AUTOLOOTITEM_SIZE) {
+ clif->message(fd, msg_txt(1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>.
+ return false;
+ }
+ sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated
+ sprintf(atcmd_output, msg_txt(1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d}
+ clif->message(fd, atcmd_output);
+ sd->state.autolooting = 1;
+ break;
+ case 2:
+ ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
+ if (i == AUTOLOOTITEM_SIZE) {
+ clif->message(fd, msg_txt(1193)); // You're currently not autolooting this item.
+ return false;
+ }
+ sd->state.autolootid[i] = 0;
+ sprintf(atcmd_output, msg_txt(1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list.
+ clif->message(fd, atcmd_output);
+ ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
+ if (i == AUTOLOOTITEM_SIZE) {
+ sd->state.autolooting = 0;
+ }
+ break;
+ case 3:
+ sprintf(atcmd_output, msg_txt(1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list.
+ clif->message(fd, atcmd_output);
+ clif->message(fd, msg_txt(1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>".
+ clif->message(fd, msg_txt(1197)); // "@alootid reset" will clear your autolootitem list.
+ ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
+ if (i == AUTOLOOTITEM_SIZE) {
+ clif->message(fd, msg_txt(1198)); // Your autolootitem list is empty.
+ } else {
+ clif->message(fd, msg_txt(1199)); // Items on your autolootitem list:
+ for(i = 0; i < AUTOLOOTITEM_SIZE; i++)
+ {
+ if (sd->state.autolootid[i] == 0)
+ continue;
+ if (!(item_data = itemdb_exists(sd->state.autolootid[i]))) {
+ ShowDebug("Non-existant item %d on autolootitem list (account_id: %d, char_id: %d)", sd->state.autolootid[i], sd->status.account_id, sd->status.char_id);
+ continue;
+ }
+ sprintf(atcmd_output, "'%s'/'%s' {%d}", item_data->name, item_data->jname, item_data->nameid);
+ clif->message(fd, atcmd_output);
}
- sprintf(atcmd_output, "'%s'/'%s' {%d}", item_data->name, item_data->jname, item_data->nameid);
- clif->message(fd, atcmd_output);
}
- }
- break;
- case 4:
- memset(sd->state.autolootid, 0, sizeof(sd->state.autolootid));
- clif->message(fd, msg_txt(1200)); // Your autolootitem list has been reset.
- sd->state.autolooting = 0;
- break;
+ break;
+ case 4:
+ memset(sd->state.autolootid, 0, sizeof(sd->state.autolootid));
+ clif->message(fd, msg_txt(1200)); // Your autolootitem list has been reset.
+ sd->state.autolooting = 0;
+ break;
}
- return 0;
+ return true;
}
/**
* No longer available, keeping here just in case it's back someday. [Ind]
@@ -5935,7 +5871,7 @@ ACMD_FUNC(autolootitem)
/*==========================================
* It is made to rain.
*------------------------------------------*/
-//ACMD_FUNC(rain)
+//ACMD(rain)
//{
// nullpo_retr(-1, sd);
// if (map[sd->bl.m].flag.rain) {
@@ -5947,13 +5883,13 @@ ACMD_FUNC(autolootitem)
// clif->weather(sd->bl.m);
// clif->message(fd, msg_txt(1202)); // It has started to rain.
// }
-// return 0;
+// return true;
//}
/*==========================================
* It is made to snow.
*------------------------------------------*/
-ACMD_FUNC(snow)
+ACMD(snow)
{
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.snow) {
@@ -5965,14 +5901,14 @@ ACMD_FUNC(snow)
clif->weather(sd->bl.m);
clif->message(fd, msg_txt(1204)); // It has started to snow.
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Cherry tree snowstorm is made to fall. (Sakura)
*------------------------------------------*/
-ACMD_FUNC(sakura)
+ACMD(sakura)
{
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.sakura) {
@@ -5984,13 +5920,13 @@ ACMD_FUNC(sakura)
clif->weather(sd->bl.m);
clif->message(fd, msg_txt(1206)); // Cherry tree leaves have begun to fall.
}
- return 0;
+ return true;
}
/*==========================================
* Clouds appear.
*------------------------------------------*/
-ACMD_FUNC(clouds)
+ACMD(clouds)
{
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.clouds) {
@@ -6002,14 +5938,14 @@ ACMD_FUNC(clouds)
clif->weather(sd->bl.m);
clif->message(fd, msg_txt(1208)); // Clouds appear.
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Different type of clouds using effect 516
*------------------------------------------*/
-ACMD_FUNC(clouds2)
+ACMD(clouds2)
{
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.clouds2) {
@@ -6021,14 +5957,14 @@ ACMD_FUNC(clouds2)
clif->weather(sd->bl.m);
clif->message(fd, msg_txt(1210)); // Alternative clouds appear.
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Fog hangs over.
*------------------------------------------*/
-ACMD_FUNC(fog)
+ACMD(fog)
{
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.fog) {
@@ -6040,13 +5976,13 @@ ACMD_FUNC(fog)
clif->weather(sd->bl.m);
clif->message(fd, msg_txt(1212)); // Fog hangs over.
}
- return 0;
+ return true;
}
/*==========================================
* Fallen leaves fall.
*------------------------------------------*/
-ACMD_FUNC(leaves)
+ACMD(leaves)
{
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.leaves) {
@@ -6058,14 +5994,14 @@ ACMD_FUNC(leaves)
clif->weather(sd->bl.m);
clif->message(fd, msg_txt(1214)); // Fallen leaves fall.
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Fireworks appear.
*------------------------------------------*/
-ACMD_FUNC(fireworks)
+ACMD(fireworks)
{
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.fireworks) {
@@ -6077,14 +6013,14 @@ ACMD_FUNC(fireworks)
clif->weather(sd->bl.m);
clif->message(fd, msg_txt(1216)); // Fireworks have launched.
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Clearing Weather Effects by Dexity
*------------------------------------------*/
-ACMD_FUNC(clearweather)
+ACMD(clearweather)
{
nullpo_retr(-1, sd);
/**
@@ -6100,75 +6036,75 @@ ACMD_FUNC(clearweather)
map[sd->bl.m].flag.leaves=0;
clif->weather(sd->bl.m);
clif->message(fd, msg_txt(291));
-
- return 0;
+
+ return true;
}
/*===============================================================
* Sound Command - plays a sound for everyone around! [Codemaster]
*---------------------------------------------------------------*/
-ACMD_FUNC(sound)
+ACMD(sound)
{
char sound_file[100];
-
+
memset(sound_file, '\0', sizeof(sound_file));
-
- if(!message || !*message || sscanf(message, "%99[^\n]", sound_file) < 1) {
+
+ if(!message || !*message || sscanf(message, "%99[^\n]", sound_file) < 1) {
clif->message(fd, msg_txt(1217)); // Please enter a sound filename (usage: @sound <filename>).
- return -1;
+ return false;
}
-
+
if(strstr(sound_file, ".wav") == NULL)
strcat(sound_file, ".wav");
-
+
clif->soundeffectall(&sd->bl, sound_file, 0, AREA);
-
- return 0;
+
+ return true;
}
/*==========================================
* MOB Search
*------------------------------------------*/
-ACMD_FUNC(mobsearch)
+ACMD(mobsearch)
{
char mob_name[100];
int mob_id;
int number = 0;
struct s_mapiterator* it;
-
+
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%99[^\n]", mob_name) < 1) {
clif->message(fd, msg_txt(1218)); // Please enter a monster name (usage: @mobsearch <monster name>).
- return -1;
+ return false;
}
-
+
if ((mob_id = atoi(mob_name)) == 0)
- mob_id = mobdb_searchname(mob_name);
+ mob_id = mobdb_searchname(mob_name);
if(mob_id > 0 && mobdb_checkid(mob_id) == 0){
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1219),mob_name); // Invalid mob ID %s!
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname)
- strcpy(mob_name,mob_db(mob_id)->jname); // --ja--
-// strcpy(mob_name,mob_db(mob_id)->name); // --en--
-
+ strcpy(mob_name,mob_db(mob_id)->jname); // --ja--
+ // strcpy(mob_name,mob_db(mob_id)->name); // --en--
+
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s
clif->message(fd, atcmd_output);
-
+
it = mapit_geteachmob();
for(;;)
{
TBL_MOB* md = (TBL_MOB*)mapit_next(it);
if( md == NULL )
break;// no more mobs
-
+
if( md->bl.m != sd->bl.m )
continue;
if( mob_id != -1 && md->class_ != mob_id )
continue;
-
+
++number;
if( md->spawn_timer == INVALID_TIMER )
snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%3d:%3d] %s", number, md->bl.x, md->bl.y, md->name);
@@ -6177,8 +6113,8 @@ ACMD_FUNC(mobsearch)
clif->message(fd, atcmd_output);
}
mapit_free(it);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -6189,21 +6125,21 @@ static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap)
{
nullpo_ret(bl);
map_clearflooritem(bl);
-
+
return 0;
}
-ACMD_FUNC(cleanmap)
+ACMD(cleanmap)
{
map_foreachinmap(atcommand_cleanfloor_sub, sd->bl.m, BL_ITEM);
clif->message(fd, msg_txt(1221)); // All dropped items have been cleaned up.
- return 0;
+ return true;
}
-ACMD_FUNC(cleanarea)
+ACMD(cleanarea)
{
int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
-
+
if (!message || !*message || sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) < 1) {
map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - (AREA_SIZE * 2), sd->bl.y - (AREA_SIZE * 2), sd->bl.x + (AREA_SIZE * 2), sd->bl.y + (AREA_SIZE * 2), BL_ITEM);
}
@@ -6213,83 +6149,83 @@ ACMD_FUNC(cleanarea)
else if (sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1) == 4) {
map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM);
}
-
+
clif->message(fd, msg_txt(1221)); // All dropped items have been cleaned up.
- return 0;
+ return true;
}
/*==========================================
* make a NPC/PET talk
* @npctalkc [SnakeDrak]
*------------------------------------------*/
-ACMD_FUNC(npctalk)
+ACMD(npctalk)
{
char name[NAME_LENGTH],mes[100],temp[100];
struct npc_data *nd;
bool ifcolor=(*(command + 8) != 'c' && *(command + 8) != 'C')?0:1;
unsigned long color=0;
-
+
if (sd->sc.count && //no "chatting" while muted.
(sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
- return -1;
-
+ (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
+ return false;
+
if(!ifcolor) {
if (!message || !*message || sscanf(message, "%23[^,], %99[^\n]", name, mes) < 2) {
clif->message(fd, msg_txt(1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>).
- return -1;
+ return false;
}
}
else {
if (!message || !*message || sscanf(message, "%lx %23[^,], %99[^\n]", &color, name, mes) < 3) {
clif->message(fd, msg_txt(1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>).
- return -1;
+ return false;
}
}
-
+
if (!(nd = npc_name2id(name))) {
clif->message(fd, msg_txt(111)); // This NPC doesn't exist
- return -1;
+ return false;
}
-
+
strtok(name, "#"); // discard extra name identifier if present
snprintf(temp, sizeof(temp), "%s : %s", name, mes);
-
+
if(ifcolor) clif->messagecolor(&nd->bl,color,temp);
else clif->disp_overhead(&nd->bl, temp);
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(pettalk)
+ACMD(pettalk)
{
char mes[100],temp[100];
struct pet_data *pd;
-
+
nullpo_retr(-1, sd);
-
+
if ( battle_config.min_chat_delay ) {
if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 )
- return 0;
+ return true;
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
}
-
+
if(!sd->status.pet_id || !(pd=sd->pd))
{
clif->message(fd, msg_txt(184));
- return -1;
+ return false;
}
-
+
if (sd->sc.count && //no "chatting" while muted.
(sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
- return -1;
-
+ (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
+ return false;
+
if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
clif->message(fd, msg_txt(1224)); // Please enter a message (usage: @pettalk <message>).
- return -1;
+ return false;
}
-
+
if (message[0] == '/')
{// pet emotion processing
const char* emo[] = {
@@ -6309,35 +6245,35 @@ ACMD_FUNC(pettalk)
if( i < ARRAYLENGTH(emo) )
{
if (sd->emotionlasttime + 1 >= time(NULL)) { // not more than 1 per second
- sd->emotionlasttime = time(NULL);
- return 0;
+ sd->emotionlasttime = time(NULL);
+ return true;
}
sd->emotionlasttime = time(NULL);
-
+
clif->emotion(&pd->bl, i);
- return 0;
+ return true;
}
}
-
+
snprintf(temp, sizeof temp ,"%s : %s", pd->pet.name, mes);
clif->disp_overhead(&pd->bl, temp);
-
- return 0;
+
+ return true;
}
/// @users - displays the number of players present on each map (and percentage)
/// #users displays on the target user instead of self
-ACMD_FUNC(users)
+ACMD(users)
{
char buf[CHAT_SIZE_MAX];
int i;
int users[MAX_MAPINDEX];
int users_all;
struct s_mapiterator* iter;
-
+
memset(users, 0, sizeof(users));
users_all = 0;
-
+
// count users on each map
iter = mapit_getallusers();
for(;;)
@@ -6345,81 +6281,81 @@ ACMD_FUNC(users)
struct map_session_data* sd2 = (struct map_session_data*)mapit_next(iter);
if( sd2 == NULL )
break;// no more users
-
+
if( sd2->mapindex >= MAX_MAPINDEX )
continue;// invalid mapindex
-
+
if( users[sd2->mapindex] < INT_MAX ) ++users[sd2->mapindex];
if( users_all < INT_MAX ) ++users_all;
}
mapit_free(iter);
-
+
// display results for each map
for( i = 0; i < MAX_MAPINDEX; ++i )
{
if( users[i] == 0 )
continue;// empty
-
+
safesnprintf(buf, sizeof(buf), "%s: %d (%.2f%%)", mapindex_id2name(i), users[i], (float)(100.0f*users[i]/users_all));
clif->message(sd->fd, buf);
}
-
+
// display overall count
safesnprintf(buf, sizeof(buf), "all: %d", users_all);
clif->message(sd->fd, buf);
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(reset)
+ACMD(reset)
{
pc_resetstate(sd);
pc_resetskill(sd,1);
sprintf(atcmd_output, msg_txt(208), sd->status.name); // '%s' skill and stats points reseted!
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-ACMD_FUNC(summon)
+ACMD(summon)
{
char name[NAME_LENGTH];
int mob_id = 0;
int duration = 0;
struct mob_data *md;
unsigned int tick=gettick();
-
+
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%23s %d", name, &duration) < 1)
{
clif->message(fd, msg_txt(1225)); // Please enter a monster name (usage: @summon <monster name> {duration}).
- return -1;
+ return false;
}
-
+
if (duration < 1)
duration =1;
else if (duration > 60)
duration =60;
-
+
if ((mob_id = atoi(name)) == 0)
mob_id = mobdb_searchname(name);
if(mob_id == 0 || mobdb_checkid(mob_id) == 0)
{
clif->message(fd, msg_txt(40)); // Invalid monster ID or name.
- return -1;
+ return false;
}
-
+
md = mob_once_spawn_sub(&sd->bl, sd->bl.m, -1, -1, "--ja--", mob_id, "", SZ_SMALL, AI_NONE);
-
+
if(!md)
- return -1;
-
+ return false;
+
md->master_id=sd->bl.id;
md->special_state.ai=1;
md->deletetimer=add_timer(tick+(duration*60000),mob_timer_delete,md->bl.id,0);
@@ -6428,8 +6364,8 @@ ACMD_FUNC(summon)
sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
clif->skill_poseffect(&sd->bl,AM_CALLHOMUN,1,md->bl.x,md->bl.y,tick);
clif->message(fd, msg_txt(39)); // All monster summoned!
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -6437,116 +6373,116 @@ ACMD_FUNC(summon)
* Temporarily move player to another group
* Useful during beta testing to allow players to use GM commands for short periods of time
*------------------------------------------*/
-ACMD_FUNC(adjgroup)
+ACMD(adjgroup)
{
int new_group = 0;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%d", &new_group) != 1) {
clif->message(fd, msg_txt(1226)); // Usage: @adjgroup <group_id>
- return -1;
+ return false;
}
-
+
if (!pc_group_exists(new_group)) {
clif->message(fd, msg_txt(1227)); // Specified group does not exist.
- return -1;
+ return false;
}
-
+
sd->group_id = new_group;
pc_group_pc_load(sd);/* update cache */
clif->message(fd, msg_txt(1228)); // Group changed successfully.
clif->message(sd->fd, msg_txt(1229)); // Your group has changed.
- return 0;
+ return true;
}
/*==========================================
* @trade by [MouseJstr]
* Open a trade window with a remote player
*------------------------------------------*/
-ACMD_FUNC(trade)
+ACMD(trade)
{
struct map_session_data *pl_sd = NULL;
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1230)); // Please enter a player name (usage: @trade <char name>).
- return -1;
+ return false;
}
-
+
if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
{
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
trade_traderequest(sd, pl_sd);
- return 0;
+ return true;
}
/*==========================================
* @setbattleflag by [MouseJstr]
* set a battle_config flag without having to reboot
*------------------------------------------*/
-ACMD_FUNC(setbattleflag)
+ACMD(setbattleflag)
{
char flag[128], value[128];
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%127s %127s", flag, value) != 2) {
- clif->message(fd, msg_txt(1231)); // Usage: @setbattleflag <flag> <value>
- return -1;
+ clif->message(fd, msg_txt(1231)); // Usage: @setbattleflag <flag> <value>
+ return false;
}
-
+
if (battle->config_set_value(flag, value) == 0) {
clif->message(fd, msg_txt(1232)); // Unknown battle_config flag.
- return -1;
+ return false;
}
-
+
clif->message(fd, msg_txt(1233)); // Set battle_config as requested.
-
- return 0;
+
+ return true;
}
/*==========================================
* @unmute [Valaris]
*------------------------------------------*/
-ACMD_FUNC(unmute)
+ACMD(unmute)
{
struct map_session_data *pl_sd = NULL;
nullpo_retr(-1, sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1234)); // Please enter a player name (usage: @unmute <char name>).
- return -1;
+ return false;
}
-
+
if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
{
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if(!pl_sd->sc.data[SC_NOCHAT]) {
clif->message(sd->fd,msg_txt(1235)); // Player is not muted.
- return -1;
+ return false;
}
-
+
pl_sd->status.manner = 0;
status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER);
clif->message(sd->fd,msg_txt(1236)); // Player unmuted.
-
- return 0;
+
+ return true;
}
/*==========================================
* @uptime by MC Cameri
*------------------------------------------*/
-ACMD_FUNC(uptime)
+ACMD(uptime)
{
unsigned long seconds = 0, day = 24*60*60, hour = 60*60,
- minute = 60, days = 0, hours = 0, minutes = 0;
+ minute = 60, days = 0, hours = 0, minutes = 0;
nullpo_retr(-1, sd);
-
+
seconds = get_uptime();
days = seconds/day;
seconds -= (seconds/day>0)?(seconds/day)*day:0;
@@ -6554,18 +6490,18 @@ ACMD_FUNC(uptime)
seconds -= (seconds/hour>0)?(seconds/hour)*hour:0;
minutes = seconds/minute;
seconds -= (seconds/minute>0)?(seconds/minute)*minute:0;
-
+
snprintf(atcmd_output, sizeof(atcmd_output), msg_txt(245), days, hours, minutes, seconds);
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
/*==========================================
* @changesex <sex>
* => Changes one's sex. Argument sex can be 0 or 1, m or f, male or female.
*------------------------------------------*/
-ACMD_FUNC(changesex)
+ACMD(changesex)
{
int i;
nullpo_retr(-1, sd);
@@ -6574,38 +6510,38 @@ ACMD_FUNC(changesex)
for( i=0; i<EQI_MAX; i++ )
if( sd->equip_index[i] >= 0 ) pc_unequipitem(sd, sd->equip_index[i], 3);
chrif_changesex(sd);
- return 0;
+ return true;
}
/*================================================
* @mute - Mutes a player for a set amount of time
*------------------------------------------------*/
-ACMD_FUNC(mute)
+ACMD(mute)
{
struct map_session_data *pl_sd = NULL;
int manner;
nullpo_retr(-1, sd);
-
+
if (!message || !*message || sscanf(message, "%d %23[^\n]", &manner, atcmd_player_name) < 1) {
clif->message(fd, msg_txt(1237)); // Usage: @mute <time> <char name>
- return -1;
+ return false;
}
-
+
if ( (pl_sd = map_nick2sd(atcmd_player_name)) == NULL )
{
clif->message(fd, msg_txt(3)); // Character not found.
- return -1;
+ return false;
}
-
+
if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
{
clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
- return -1;
+ return false;
}
-
+
clif->manner_message(sd, 0);
clif->manner_message(pl_sd, 5);
-
+
if( pl_sd->status.manner < manner ) {
pl_sd->status.manner -= manner;
sc_start(&pl_sd->bl,SC_NOCHAT,100,0,0);
@@ -6613,45 +6549,45 @@ ACMD_FUNC(mute)
pl_sd->status.manner = 0;
status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER);
}
-
+
clif->GM_silence(sd, pl_sd, (manner > 0 ? 1 : 0));
-
- return 0;
+
+ return true;
}
/*==========================================
* @refresh (like @jumpto <<yourself>>)
*------------------------------------------*/
-ACMD_FUNC(refresh)
+ACMD(refresh)
{
nullpo_retr(-1, sd);
clif->refresh(sd);
- return 0;
+ return true;
}
-ACMD_FUNC(refreshall)
+ACMD(refreshall)
{
struct map_session_data* iter_sd;
struct s_mapiterator* iter;
nullpo_retr(-1, sd);
-
+
iter = mapit_getallusers();
for (iter_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); iter_sd = (TBL_PC*)mapit_next(iter))
clif->refresh(iter_sd);
mapit_free(iter);
- return 0;
+ return true;
}
/*==========================================
* @identify
* => GM's magnifier.
*------------------------------------------*/
-ACMD_FUNC(identify)
+ACMD(identify)
{
int i,num;
-
+
nullpo_retr(-1, sd);
-
+
for(i=num=0;i<MAX_INVENTORY;i++){
if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify!=1){
num++;
@@ -6662,76 +6598,76 @@ ACMD_FUNC(identify)
} else {
clif->message(fd,msg_txt(1238)); // There are no items to appraise.
}
- return 0;
+ return true;
}
/*==========================================
* @gmotd (Global MOTD)
* by davidsiaw :P
*------------------------------------------*/
-ACMD_FUNC(gmotd)
+ACMD(gmotd)
{
FILE* fp;
-
+
if( ( fp = fopen(motd_txt, "r") ) != NULL )
{
char buf[CHAT_SIZE_MAX];
size_t len;
-
+
while( fgets(buf, sizeof(buf), fp) )
{
if( buf[0] == '/' && buf[1] == '/' )
{
continue;
}
-
+
len = strlen(buf);
-
+
while( len && ( buf[len-1] == '\r' || buf[len-1] == '\n' ) )
{// strip trailing EOL characters
len--;
}
-
+
if( len )
{
buf[len] = 0;
-
+
intif_broadcast(buf, len+1, 0);
}
}
fclose(fp);
}
- return 0;
+ return true;
}
-ACMD_FUNC(misceffect)
+ACMD(misceffect)
{
int effect = 0;
nullpo_retr(-1, sd);
if (!message || !*message)
- return -1;
+ return false;
if (sscanf(message, "%d", &effect) < 1)
- return -1;
+ return false;
clif->misceffect(&sd->bl,effect);
-
- return 0;
+
+ return true;
}
/*==========================================
* MAIL SYSTEM
*------------------------------------------*/
-ACMD_FUNC(mail)
+ACMD(mail)
{
nullpo_ret(sd);
mail_openmail(sd);
- return 0;
+ return true;
}
/*==========================================
* Show Monster DB Info v 1.0
* originally by [Lupus]
*------------------------------------------*/
-ACMD_FUNC(mobinfo)
+ACMD(mobinfo)
{
unsigned char msize[3][7] = {"Small", "Medium", "Large"};
unsigned char mrace[12][11] = {"Formless", "Undead", "Beast", "Plant", "Insect", "Fish", "Demon", "Demi-Human", "Angel", "Dragon", "Boss", "Non-Boss"};
@@ -6741,15 +6677,15 @@ ACMD_FUNC(mobinfo)
struct mob_db *mob, *mob_array[MAX_SEARCH];
int count;
int i, j, k;
-
+
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(atcmd_output2, '\0', sizeof(atcmd_output2));
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>).
- return -1;
+ return false;
}
-
+
// If monster identifier/name argument is a name
if ((i = mobdb_checkid(atoi(message))))
{
@@ -6757,12 +6693,12 @@ ACMD_FUNC(mobinfo)
count = 1;
} else
count = mobdb_searchname_array(mob_array, MAX_SEARCH, message);
-
+
if (!count) {
clif->message(fd, msg_txt(40)); // Invalid monster ID or name.
- return -1;
+ return false;
}
-
+
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count);
clif->message(fd, atcmd_output);
@@ -6770,7 +6706,7 @@ ACMD_FUNC(mobinfo)
}
for (k = 0; k < count; k++) {
mob = mob_array[k];
-
+
// stats
if (mob->mexp)
sprintf(atcmd_output, msg_txt(1240), mob->name, mob->jname, mob->sprite, mob->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d)
@@ -6780,14 +6716,14 @@ ACMD_FUNC(mobinfo)
sprintf(atcmd_output, msg_txt(1242), mob->lv, mob->status.max_hp, mob->base_exp, mob->job_exp,MOB_HIT(mob), MOB_FLEE(mob)); // Lv:%d HP:%d Base EXP:%u Job EXP:%u HIT:%d FLEE:%d
clif->message(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1243), // DEF:%d MDEF:%d STR:%d AGI:%d VIT:%d INT:%d DEX:%d LUK:%d
- mob->status.def, mob->status.mdef,mob->status.str, mob->status.agi,
- mob->status.vit, mob->status.int_, mob->status.dex, mob->status.luk);
+ mob->status.def, mob->status.mdef,mob->status.str, mob->status.agi,
+ mob->status.vit, mob->status.int_, mob->status.dex, mob->status.luk);
clif->message(fd, atcmd_output);
-
+
sprintf(atcmd_output, msg_txt(1244), // ATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d)
- mob->status.rhw.atk, mob->status.rhw.atk2, mob->status.rhw.range,
- mob->range2 , mob->range3, msize[mob->status.size],
- mrace[mob->status.race], melement[mob->status.def_ele], mob->status.ele_lv);
+ mob->status.rhw.atk, mob->status.rhw.atk2, mob->status.rhw.range,
+ mob->range2 , mob->range3, msize[mob->status.size],
+ mrace[mob->status.race], melement[mob->status.def_ele], mob->status.ele_lv);
clif->message(fd, atcmd_output);
// drops
clif->message(fd, msg_txt(1245)); // Drops:
@@ -6798,7 +6734,7 @@ ACMD_FUNC(mobinfo)
if (mob->dropitem[i].nameid <= 0 || mob->dropitem[i].p < 1 || (item_data = itemdb_exists(mob->dropitem[i].nameid)) == NULL)
continue;
droprate = mob->dropitem[i].p;
-
+
if (item_data->slot)
sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)droprate / 100);
else
@@ -6837,53 +6773,53 @@ ACMD_FUNC(mobinfo)
clif->message(fd, atcmd_output);
}
}
- return 0;
+ return true;
}
/*=========================================
-* @showmobs by KarLaeda
-* => For 15 sec displays the mobs on minimap
-*------------------------------------------*/
-ACMD_FUNC(showmobs)
+ * @showmobs by KarLaeda
+ * => For 15 sec displays the mobs on minimap
+ *------------------------------------------*/
+ACMD(showmobs)
{
char mob_name[100];
int mob_id;
int number = 0;
struct s_mapiterator* it;
-
+
nullpo_retr(-1, sd);
-
+
if(sscanf(message, "%99[^\n]", mob_name) < 0)
- return -1;
-
+ return false;
+
if((mob_id = atoi(mob_name)) == 0)
mob_id = mobdb_searchname(mob_name);
if(mob_id > 0 && mobdb_checkid(mob_id) == 0){
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1250),mob_name); // Invalid mob id %s!
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
-
+
if(mob_db(mob_id)->status.mode&MD_BOSS && !pc_has_permission(sd, PC_PERM_SHOW_BOSS)){ // If player group does not have access to boss mobs.
clif->message(fd, msg_txt(1251)); // Can't show boss mobs!
- return 0;
+ return true;
}
-
+
if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname)
strcpy(mob_name,mob_db(mob_id)->jname); // --ja--
- //strcpy(mob_name,mob_db(mob_id)->name); // --en--
-
+ //strcpy(mob_name,mob_db(mob_id)->name); // --en--
+
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1252), // Mob Search... %s %s
- mob_name, mapindex_id2name(sd->mapindex));
+ mob_name, mapindex_id2name(sd->mapindex));
clif->message(fd, atcmd_output);
-
+
it = mapit_geteachmob();
for(;;)
{
TBL_MOB* md = (TBL_MOB*)mapit_next(it);
if( md == NULL )
break;// no more mobs
-
+
if( md->bl.m != sd->bl.m )
continue;
if( mob_id != -1 && md->class_ != mob_id )
@@ -6892,360 +6828,360 @@ ACMD_FUNC(showmobs)
continue; // hide slaves and player summoned mobs
if( md->spawn_timer != INVALID_TIMER )
continue; // hide mobs waiting for respawn
-
+
++number;
clif->viewpoint(sd, 1, 0, md->bl.x, md->bl.y, number, 0xFFFFFF);
}
mapit_free(it);
-
- return 0;
+
+ return true;
}
/*==========================================
* homunculus level up [orn]
*------------------------------------------*/
-ACMD_FUNC(homlevel)
+ACMD(homlevel)
{
TBL_HOM * hd;
int level = 0;
-
+
nullpo_retr(-1, sd);
-
+
if ( !message || !*message || ( level = atoi(message) ) < 1 ) {
clif->message(fd, msg_txt(1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>).
- return -1;
+ return false;
}
-
+
if ( !merc_is_hom_active(sd->hd) ) {
clif->message(fd, msg_txt(1254)); // You do not have a homunculus.
- return -1;
+ return false;
}
-
+
hd = sd->hd;
-
+
if ( battle_config.hom_max_level == hd->homunculus.level ) // Already reach maximum level
- return 0;
-
+ return true;
+
do{
hd->homunculus.exp += hd->exp_next;
}while( hd->homunculus.level < level && merc_hom_levelup(hd) );
-
+
status_calc_homunculus(hd,0);
status_percent_heal(&hd->bl, 100, 100);
clif->specialeffect(&hd->bl,568,AREA);
- return 0;
+ return true;
}
/*==========================================
* homunculus evolution H [orn]
*------------------------------------------*/
-ACMD_FUNC(homevolution)
+ACMD(homevolution)
{
nullpo_retr(-1, sd);
-
+
if ( !merc_is_hom_active(sd->hd) ) {
clif->message(fd, msg_txt(1254)); // You do not have a homunculus.
- return -1;
+ return false;
}
-
+
if ( !merc_hom_evolution(sd->hd) ) {
clif->message(fd, msg_txt(1255)); // Your homunculus doesn't evolve.
- return -1;
+ return false;
}
clif->homskillinfoblock(sd);
- return 0;
+ return true;
}
-ACMD_FUNC(hommutate)
+ACMD(hommutate)
{
int homun_id, m_class = 0, m_id;
nullpo_retr(-1, sd);
-
+
if (!merc_is_hom_active(sd->hd)) {
clif->message(fd, msg_txt(1254)); // You do not have a homunculus.
- return -1;
+ return false;
}
-
+
if (!message || !*message) {
homun_id = 6048 + (rnd() % 4);
} else {
homun_id = atoi(message);
}
-
+
m_class = hom_class2mapid(sd->hd->homunculus.class_);
m_id = hom_class2mapid(homun_id);
-
+
if (m_class != -1 && m_id != -1 && m_class&HOM_EVO && m_id&HOM_S && sd->hd->homunculus.level >= 99) {
hom_mutate(sd->hd, homun_id);
} else {
clif->emotion(&sd->hd->bl, E_SWT);
}
- return 0;
+ return true;
}
/*==========================================
* call choosen homunculus [orn]
*------------------------------------------*/
-ACMD_FUNC(makehomun)
+ACMD(makehomun)
{
int homunid;
nullpo_retr(-1, sd);
-
+
if ( sd->status.hom_id ) {
clif->message(fd, msg_txt(450));
- return -1;
+ return false;
}
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>).
- return -1;
+ return false;
}
-
+
homunid = atoi(message);
if( homunid < HM_CLASS_BASE || homunid > HM_CLASS_BASE + MAX_HOMUNCULUS_CLASS - 1 )
{
clif->message(fd, msg_txt(1257)); // Invalid Homunculus ID.
- return -1;
+ return false;
}
-
+
merc_create_homunculus_request(sd,homunid);
- return 0;
+ return true;
}
/*==========================================
* modify homunculus intimacy [orn]
*------------------------------------------*/
-ACMD_FUNC(homfriendly)
+ACMD(homfriendly)
{
int friendly = 0;
-
+
nullpo_retr(-1, sd);
-
+
if ( !merc_is_hom_active(sd->hd) ) {
clif->message(fd, msg_txt(1254)); // You do not have a homunculus.
- return -1;
+ return false;
}
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>).
- return -1;
+ return false;
}
-
+
friendly = atoi(message);
friendly = cap_value(friendly, 0, 1000);
-
+
sd->hd->homunculus.intimacy = friendly * 100 ;
clif->send_homdata(sd,SP_INTIMATE,friendly);
- return 0;
+ return true;
}
/*==========================================
* modify homunculus hunger [orn]
*------------------------------------------*/
-ACMD_FUNC(homhungry)
+ACMD(homhungry)
{
int hungry = 0;
-
+
nullpo_retr(-1, sd);
-
+
if ( !merc_is_hom_active(sd->hd) ) {
clif->message(fd, msg_txt(1254)); // You do not have a homunculus.
- return -1;
+ return false;
}
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>).
- return -1;
+ return false;
}
-
+
hungry = atoi(message);
hungry = cap_value(hungry, 0, 100);
-
+
sd->hd->homunculus.hunger = hungry;
clif->send_homdata(sd,SP_HUNGRY,hungry);
- return 0;
+ return true;
}
/*==========================================
* make the homunculus speak [orn]
*------------------------------------------*/
-ACMD_FUNC(homtalk)
+ACMD(homtalk)
{
char mes[100],temp[100];
-
+
nullpo_retr(-1, sd);
-
+
if ( battle_config.min_chat_delay ) {
if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 )
- return 0;
+ return true;
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
}
-
+
if (sd->sc.count && //no "chatting" while muted.
(sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
- return -1;
-
+ (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
+ return false;
+
if ( !merc_is_hom_active(sd->hd) ) {
clif->message(fd, msg_txt(1254)); // You do not have a homunculus.
- return -1;
+ return false;
}
-
+
if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
clif->message(fd, msg_txt(1260)); // Please enter a message (usage: @homtalk <message>).
- return -1;
+ return false;
}
-
+
snprintf(temp, sizeof temp ,"%s : %s", sd->hd->homunculus.name, mes);
clif->disp_overhead(&sd->hd->bl, temp);
-
- return 0;
+
+ return true;
}
/*==========================================
* Show homunculus stats
*------------------------------------------*/
-ACMD_FUNC(hominfo)
+ACMD(hominfo)
{
struct homun_data *hd;
struct status_data *status;
nullpo_retr(-1, sd);
-
+
if ( !merc_is_hom_active(sd->hd) ) {
clif->message(fd, msg_txt(1254)); // You do not have a homunculus.
- return -1;
+ return false;
}
-
+
hd = sd->hd;
status = status_get_status_data(&hd->bl);
clif->message(fd, msg_txt(1261)); // Homunculus stats:
-
+
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1262), // HP: %d/%d - SP: %d/%d
- status->hp, status->max_hp, status->sp, status->max_sp);
+ status->hp, status->max_hp, status->sp, status->max_sp);
clif->message(fd, atcmd_output);
-
+
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1263), // ATK: %d - MATK: %d~%d
- status->rhw.atk2 +status->batk, status->matk_min, status->matk_max);
+ status->rhw.atk2 +status->batk, status->matk_min, status->matk_max);
clif->message(fd, atcmd_output);
-
+
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1264), // Hungry: %d - Intimacy: %u
- hd->homunculus.hunger, hd->homunculus.intimacy/100);
+ hd->homunculus.hunger, hd->homunculus.intimacy/100);
clif->message(fd, atcmd_output);
-
+
snprintf(atcmd_output, sizeof(atcmd_output) ,
- msg_txt(1265), // Stats: Str %d / Agi %d / Vit %d / Int %d / Dex %d / Luk %d
- status->str, status->agi, status->vit,
- status->int_, status->dex, status->luk);
+ msg_txt(1265), // Stats: Str %d / Agi %d / Vit %d / Int %d / Dex %d / Luk %d
+ status->str, status->agi, status->vit,
+ status->int_, status->dex, status->luk);
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(homstats)
+ACMD(homstats)
{
struct homun_data *hd;
struct s_homunculus_db *db;
struct s_homunculus *hom;
int lv, min, max, evo;
-
+
nullpo_retr(-1, sd);
-
+
if ( !merc_is_hom_active(sd->hd) ) {
clif->message(fd, msg_txt(1254)); // You do not have a homunculus.
- return -1;
+ return false;
}
-
+
hd = sd->hd;
-
+
hom = &hd->homunculus;
db = hd->homunculusDB;
lv = hom->level;
-
+
snprintf(atcmd_output, sizeof(atcmd_output) ,
- msg_txt(1266), lv, db->name); // Homunculus growth stats (Lv %d %s):
+ msg_txt(1266), lv, db->name); // Homunculus growth stats (Lv %d %s):
clif->message(fd, atcmd_output);
lv--; //Since the first increase is at level 2.
-
+
evo = (hom->class_ == db->evo_class);
min = db->base.HP +lv*db->gmin.HP +(evo?db->emin.HP:0);
max = db->base.HP +lv*db->gmax.HP +(evo?db->emax.HP:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1267), hom->max_hp, min, max); // Max HP: %d (%d~%d)
clif->message(fd, atcmd_output);
-
+
min = db->base.SP +lv*db->gmin.SP +(evo?db->emin.SP:0);
max = db->base.SP +lv*db->gmax.SP +(evo?db->emax.SP:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1268), hom->max_sp, min, max); // Max SP: %d (%d~%d)
clif->message(fd, atcmd_output);
-
+
min = db->base.str +lv*(db->gmin.str/10) +(evo?db->emin.str:0);
max = db->base.str +lv*(db->gmax.str/10) +(evo?db->emax.str:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1269), hom->str/10, min, max); // Str: %d (%d~%d)
clif->message(fd, atcmd_output);
-
+
min = db->base.agi +lv*(db->gmin.agi/10) +(evo?db->emin.agi:0);
max = db->base.agi +lv*(db->gmax.agi/10) +(evo?db->emax.agi:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1270), hom->agi/10, min, max); // Agi: %d (%d~%d)
clif->message(fd, atcmd_output);
-
+
min = db->base.vit +lv*(db->gmin.vit/10) +(evo?db->emin.vit:0);
max = db->base.vit +lv*(db->gmax.vit/10) +(evo?db->emax.vit:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1271), hom->vit/10, min, max); // Vit: %d (%d~%d)
clif->message(fd, atcmd_output);
-
+
min = db->base.int_ +lv*(db->gmin.int_/10) +(evo?db->emin.int_:0);
max = db->base.int_ +lv*(db->gmax.int_/10) +(evo?db->emax.int_:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1272), hom->int_/10, min, max); // Int: %d (%d~%d)
clif->message(fd, atcmd_output);
-
+
min = db->base.dex +lv*(db->gmin.dex/10) +(evo?db->emin.dex:0);
max = db->base.dex +lv*(db->gmax.dex/10) +(evo?db->emax.dex:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1273), hom->dex/10, min, max); // Dex: %d (%d~%d)
clif->message(fd, atcmd_output);
-
+
min = db->base.luk +lv*(db->gmin.luk/10) +(evo?db->emin.luk:0);
max = db->base.luk +lv*(db->gmax.luk/10) +(evo?db->emax.luk:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1274), hom->luk/10, min, max); // Luk: %d (%d~%d)
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(homshuffle)
+ACMD(homshuffle)
{
nullpo_retr(-1, sd);
-
+
if(!sd->hd)
- return -1; // nothing to do
-
+ return false; // nothing to do
+
if(!merc_hom_shuffle(sd->hd))
- return -1;
-
+ return false;
+
clif->message(sd->fd, msg_txt(1275)); // Homunculus stats altered.
- atcommand_homstats(fd, sd, command, message); //Print out the new stats
- return 0;
+ atcommand_homstats(fd, sd, command, message, info); //Print out the new stats
+ return true;
}
/*==========================================
* Show Items DB Info v 1.0
* originally by [Lupus]
*------------------------------------------*/
-ACMD_FUNC(iteminfo)
+ACMD(iteminfo)
{
struct item_data *item_data, *item_array[MAX_SEARCH];
int i, count = 1;
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>).
- return -1;
+ return false;
}
if ((item_array[0] = itemdb_exists(atoi(message))) == NULL)
count = itemdb_searchname_array(item_array, MAX_SEARCH, message);
-
+
if (!count) {
clif->message(fd, msg_txt(19)); // Invalid item ID or name.
- return -1;
+ return false;
}
-
+
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches
clif->message(fd, atcmd_output);
@@ -7254,15 +7190,15 @@ ACMD_FUNC(iteminfo)
for (i = 0; i < count; i++) {
item_data = item_array[i];
sprintf(atcmd_output, msg_txt(1277), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s
- item_data->name,item_data->jname,item_data->slot,item_data->nameid,
- itemdb_typename(item_data->type),
- (item_data->script==NULL)? msg_txt(1278) : msg_txt(1279) // None / With script
- );
+ item_data->name,item_data->jname,item_data->slot,item_data->nameid,
+ itemdb_typename(item_data->type),
+ (item_data->script==NULL)? msg_txt(1278) : msg_txt(1279) // None / With script
+ );
clif->message(fd, atcmd_output);
-
+
sprintf(atcmd_output, msg_txt(1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f
clif->message(fd, atcmd_output);
-
+
if (item_data->maxchance == -1)
strcpy(atcmd_output, msg_txt(1281)); // - Available in the shops only.
else if (!battle_config.atcommand_mobinfo_type && item_data->maxchance)
@@ -7270,31 +7206,31 @@ ACMD_FUNC(iteminfo)
else
strcpy(atcmd_output, msg_txt(1283)); // - Monsters don't drop this item.
clif->message(fd, atcmd_output);
-
+
}
- return 0;
+ return true;
}
/*==========================================
* Show who drops the item.
*------------------------------------------*/
-ACMD_FUNC(whodrops)
+ACMD(whodrops)
{
struct item_data *item_data, *item_array[MAX_SEARCH];
int i,j, count = 1;
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>).
- return -1;
+ return false;
}
if ((item_array[0] = itemdb_exists(atoi(message))) == NULL)
count = itemdb_searchname_array(item_array, MAX_SEARCH, message);
-
+
if (!count) {
clif->message(fd, msg_txt(19)); // Invalid item ID or name.
- return -1;
+ return false;
}
-
+
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches
clif->message(fd, atcmd_output);
@@ -7304,14 +7240,14 @@ ACMD_FUNC(whodrops)
item_data = item_array[i];
sprintf(atcmd_output, msg_txt(1285), item_data->jname,item_data->slot); // Item: '%s'[%d]
clif->message(fd, atcmd_output);
-
+
if (item_data->mob[0].chance == 0) {
strcpy(atcmd_output, msg_txt(1286)); // - Item is not dropped by mobs.
clif->message(fd, atcmd_output);
} else {
sprintf(atcmd_output, msg_txt(1287), MAX_SEARCH); // - Common mobs with highest drop chance (only max %d are listed):
clif->message(fd, atcmd_output);
-
+
for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++)
{
sprintf(atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.);
@@ -7319,20 +7255,20 @@ ACMD_FUNC(whodrops)
}
}
}
- return 0;
+ return true;
}
-ACMD_FUNC(whereis)
+ACMD(whereis)
{
struct mob_db *mob, *mob_array[MAX_SEARCH];
int count;
int i, j, k;
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>).
- return -1;
+ return false;
}
-
+
// If monster identifier/name argument is a name
if ((i = mobdb_checkid(atoi(message))))
{
@@ -7340,12 +7276,12 @@ ACMD_FUNC(whereis)
count = 1;
} else
count = mobdb_searchname_array(mob_array, MAX_SEARCH, message);
-
+
if (!count) {
clif->message(fd, msg_txt(40)); // Invalid monster ID or name.
- return -1;
+ return false;
}
-
+
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count);
clif->message(fd, atcmd_output);
@@ -7355,7 +7291,7 @@ ACMD_FUNC(whereis)
mob = mob_array[k];
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1289), mob->jname); // %s spawns in:
clif->message(fd, atcmd_output);
-
+
for (i = 0; i < ARRAYLENGTH(mob->spawn) && mob->spawn[i].qty; i++)
{
j = map_mapindex2mapid(mob->spawn[i].mapindex);
@@ -7366,14 +7302,14 @@ ACMD_FUNC(whereis)
if (i == 0)
clif->message(fd, msg_txt(1290)); // This monster does not spawn normally.
}
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(version) {
+ACMD(version) {
const char *git = get_git_hash();
const char *svn = get_svn_revision();
-
+
if ( git[0] != HERC_UNKNOWN_VER ) {
sprintf(atcmd_output,msg_txt(1295),git); // Git Hash '%s'
clif->message(fd,atcmd_output);
@@ -7382,8 +7318,8 @@ ACMD_FUNC(version) {
clif->message(fd,atcmd_output);
} else
clif->message(fd,msg_txt(1296)); // Cannot determine version
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -7391,15 +7327,15 @@ ACMD_FUNC(version) {
*------------------------------------------*/
static int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
{
-
+
int time, id;
struct map_session_data *pl_sd = (struct map_session_data *)bl;
if (pl_sd == NULL)
return 0;
-
+
id = va_arg(ap, int);
time = va_arg(ap, int);
-
+
if (id != bl->id && !pc_get_group_level(pl_sd)) {
pl_sd->status.manner -= time;
if (pl_sd->status.manner < 0)
@@ -7410,113 +7346,113 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
return 0;
}
-ACMD_FUNC(mutearea)
+ACMD(mutearea)
{
int time;
nullpo_ret(sd);
-
+
if (!message || !*message) {
clif->message(fd, msg_txt(1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>).
- return -1;
+ return false;
}
-
+
time = atoi(message);
-
+
map_foreachinarea(atcommand_mutearea_sub,sd->bl.m,
- sd->bl.x-AREA_SIZE, sd->bl.y-AREA_SIZE,
- sd->bl.x+AREA_SIZE, sd->bl.y+AREA_SIZE, BL_PC, sd->bl.id, time);
-
- return 0;
+ sd->bl.x-AREA_SIZE, sd->bl.y-AREA_SIZE,
+ sd->bl.x+AREA_SIZE, sd->bl.y+AREA_SIZE, BL_PC, sd->bl.id, time);
+
+ return true;
}
-ACMD_FUNC(rates)
+ACMD(rates)
{
char buf[CHAT_SIZE_MAX];
-
+
nullpo_ret(sd);
memset(buf, '\0', sizeof(buf));
-
+
snprintf(buf, CHAT_SIZE_MAX, msg_txt(1298), // Experience rates: Base %.2fx / Job %.2fx
- battle_config.base_exp_rate/100., battle_config.job_exp_rate/100.);
+ battle_config.base_exp_rate/100., battle_config.job_exp_rate/100.);
clif->message(fd, buf);
snprintf(buf, CHAT_SIZE_MAX, msg_txt(1299), // Normal Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
- battle_config.item_rate_common/100., battle_config.item_rate_heal/100., battle_config.item_rate_use/100., battle_config.item_rate_equip/100., battle_config.item_rate_card/100.);
+ battle_config.item_rate_common/100., battle_config.item_rate_heal/100., battle_config.item_rate_use/100., battle_config.item_rate_equip/100., battle_config.item_rate_card/100.);
clif->message(fd, buf);
snprintf(buf, CHAT_SIZE_MAX, msg_txt(1300), // Boss Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
- battle_config.item_rate_common_boss/100., battle_config.item_rate_heal_boss/100., battle_config.item_rate_use_boss/100., battle_config.item_rate_equip_boss/100., battle_config.item_rate_card_boss/100.);
+ battle_config.item_rate_common_boss/100., battle_config.item_rate_heal_boss/100., battle_config.item_rate_use_boss/100., battle_config.item_rate_equip_boss/100., battle_config.item_rate_card_boss/100.);
clif->message(fd, buf);
snprintf(buf, CHAT_SIZE_MAX, msg_txt(1301), // Other Drop Rates: MvP %.2fx / Card-Based %.2fx / Treasure %.2fx
- battle_config.item_rate_mvp/100., battle_config.item_rate_adddrop/100., battle_config.item_rate_treasure/100.);
+ battle_config.item_rate_mvp/100., battle_config.item_rate_adddrop/100., battle_config.item_rate_treasure/100.);
clif->message(fd, buf);
-
- return 0;
+
+ return true;
}
/*==========================================
* @me by lordalfa
* => Displays the OUTPUT string on top of the Visible players Heads.
*------------------------------------------*/
-ACMD_FUNC(me)
+ACMD(me)
{
char tempmes[CHAT_SIZE_MAX];
nullpo_retr(-1, sd);
-
+
memset(tempmes, '\0', sizeof(tempmes));
memset(atcmd_output, '\0', sizeof(atcmd_output));
-
+
if (sd->sc.count && //no "chatting" while muted.
(sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
- return -1;
-
+ (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
+ return false;
+
if (!message || !*message || sscanf(message, "%199[^\n]", tempmes) < 0) {
clif->message(fd, msg_txt(1302)); // Please enter a message (usage: @me <message>).
- return -1;
+ return false;
}
-
+
sprintf(atcmd_output, msg_txt(270), sd->status.name, tempmes); // *%s %s*
clif->disp_overhead(&sd->bl, atcmd_output);
-
- return 0;
-
+
+ return true;
+
}
/*==========================================
* @size
* => Resize your character sprite. [Valaris]
*------------------------------------------*/
-ACMD_FUNC(size)
+ACMD(size)
{
int size = 0;
nullpo_retr(-1, sd);
-
+
size = cap_value(atoi(message),SZ_SMALL,SZ_BIG);
-
+
if(sd->state.size) {
sd->state.size = SZ_SMALL;
pc_setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT);
}
-
+
sd->state.size = size;
if( size == SZ_MEDIUM )
clif->specialeffect(&sd->bl,420,AREA);
else if( size == SZ_BIG )
clif->specialeffect(&sd->bl,422,AREA);
-
+
clif->message(fd, msg_txt(1303)); // Size change applied.
- return 0;
+ return true;
}
-ACMD_FUNC(sizeall)
+ACMD(sizeall)
{
int size;
struct map_session_data *pl_sd;
struct s_mapiterator* iter;
-
+
size = atoi(message);
size = cap_value(size,0,2);
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) {
if( pl_sd->state.size != size ) {
@@ -7524,7 +7460,7 @@ ACMD_FUNC(sizeall)
pl_sd->state.size = SZ_SMALL;
pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
}
-
+
pl_sd->state.size = size;
if( size == SZ_MEDIUM )
clif->specialeffect(&pl_sd->bl,420,AREA);
@@ -7533,40 +7469,40 @@ ACMD_FUNC(sizeall)
}
}
mapit_free(iter);
-
+
clif->message(fd, msg_txt(1303)); // Size change applied.
- return 0;
+ return true;
}
-ACMD_FUNC(sizeguild)
+ACMD(sizeguild)
{
int size = 0, i;
char guild[NAME_LENGTH];
struct map_session_data *pl_sd;
struct guild *g;
nullpo_retr(-1, sd);
-
+
memset(guild, '\0', sizeof(guild));
-
+
if( !message || !*message || sscanf(message, "%d %23[^\n]", &size, guild) < 2 ) {
clif->message(fd, msg_txt(1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>).
- return -1;
+ return false;
}
-
+
if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) {
clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
- return -1;
+ return false;
}
-
+
size = cap_value(size,SZ_SMALL,SZ_BIG);
-
+
for( i = 0; i < g->max_member; i++ ) {
if( (pl_sd = g->member[i].sd) && pl_sd->state.size != size ) {
if( pl_sd->state.size ) {
pl_sd->state.size = SZ_SMALL;
pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
}
-
+
pl_sd->state.size = size;
if( size == SZ_MEDIUM )
clif->specialeffect(&pl_sd->bl,420,AREA);
@@ -7574,19 +7510,19 @@ ACMD_FUNC(sizeguild)
clif->specialeffect(&pl_sd->bl,422,AREA);
}
}
-
+
clif->message(fd, msg_txt(1303)); // Size change applied.
- return 0;
+ return true;
}
/*==========================================
* @monsterignore
* => Makes monsters ignore you. [Valaris]
*------------------------------------------*/
-ACMD_FUNC(monsterignore)
+ACMD(monsterignore)
{
nullpo_retr(-1, sd);
-
+
if (!sd->state.monster_ignore) {
sd->state.monster_ignore = 1;
clif->message(sd->fd, msg_txt(1305)); // You are now immune to attacks.
@@ -7594,17 +7530,17 @@ ACMD_FUNC(monsterignore)
sd->state.monster_ignore = 0;
clif->message(sd->fd, msg_txt(1306)); // Returned to normal state.
}
-
- return 0;
+
+ return true;
}
/*==========================================
* @fakename
* => Gives your character a fake name. [Valaris]
*------------------------------------------*/
-ACMD_FUNC(fakename)
+ACMD(fakename)
{
nullpo_retr(-1, sd);
-
+
if( !message || !*message )
{
if( sd->fakename[0] )
@@ -7612,43 +7548,43 @@ ACMD_FUNC(fakename)
sd->fakename[0] = '\0';
clif->charnameack(0, &sd->bl);
clif->message(sd->fd, msg_txt(1307)); // Returned to real name.
- return 0;
+ return true;
}
-
+
clif->message(sd->fd, msg_txt(1308)); // You must enter a name.
- return -1;
+ return false;
}
-
+
if( strlen(message) < 2 )
{
clif->message(sd->fd, msg_txt(1309)); // Fake name must be at least two characters.
- return -1;
+ return false;
}
-
+
safestrncpy(sd->fakename, message, sizeof(sd->fakename));
clif->charnameack(0, &sd->bl);
clif->message(sd->fd, msg_txt(1310)); // Fake name enabled.
-
- return 0;
+
+ return true;
}
/*==========================================
* Ragnarok Resources
*------------------------------------------*/
-ACMD_FUNC(mapflag) {
+ACMD(mapflag) {
#define checkflag( cmd ) if ( map[ sd->bl.m ].flag.cmd ) clif->message(sd->fd,#cmd)
#define setflag( cmd ) \
- if ( strcmp( flag_name , #cmd ) == 0 ){\
- map[ sd->bl.m ].flag.cmd = flag;\
- sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s value = %hd",#cmd,flag?"On":"Off",flag);\
- clif->message(sd->fd,atcmd_output);\
- return 0;\
- }
- char flag_name[100];
+if ( strcmp( flag_name , #cmd ) == 0 ){\
+map[ sd->bl.m ].flag.cmd = flag;\
+sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s value = %hd",#cmd,flag?"On":"Off",flag);\
+clif->message(sd->fd,atcmd_output);\
+return true;\
+}
+ char flag_name[100];
short flag=0,i;
nullpo_retr(-1, sd);
memset(flag_name, '\0', sizeof(flag_name));
-
+
if (!message || !*message || (sscanf(message, "%99s %hd", flag_name, &flag) < 1)) {
clif->message(sd->fd,msg_txt(1311)); // Enabled Mapflags in this map:
clif->message(sd->fd,"----------------------------------");
@@ -7660,7 +7596,7 @@ ACMD_FUNC(mapflag) {
checkflag(notrade); checkflag(noskill); checkflag(nowarp); checkflag(nowarpto);
checkflag(noicewall); checkflag(snow); checkflag(clouds); checkflag(clouds2);
checkflag(fog); checkflag(fireworks); checkflag(sakura); checkflag(leaves);
- checkflag(nogo); checkflag(nobaseexp);
+ checkflag(nobaseexp);
checkflag(nojobexp); checkflag(nomobloot); checkflag(nomvploot); checkflag(nightenabled);
checkflag(nodrop); checkflag(novending); checkflag(loadevent);
checkflag(nochat); checkflag(partylock); checkflag(guildlock); checkflag(src4instance);
@@ -7670,7 +7606,7 @@ ACMD_FUNC(mapflag) {
return 1;
}
for (i = 0; flag_name[i]; i++) flag_name[i] = (char)tolower(flag_name[i]); //lowercase
-
+
if ( strcmp( flag_name , "gvg" ) == 0 ) {
if( flag && !map[sd->bl.m].flag.gvg )
map_zone_change2(sd->bl.m,strdb_get(zone_db, MAP_ZONE_GVG_NAME));
@@ -7696,7 +7632,7 @@ ACMD_FUNC(mapflag) {
setflag(notrade); setflag(noskill); setflag(nowarp); setflag(nowarpto);
setflag(noicewall); setflag(snow); setflag(clouds); setflag(clouds2);
setflag(fog); setflag(fireworks); setflag(sakura); setflag(leaves);
- setflag(nogo); setflag(nobaseexp);
+ setflag(nobaseexp);
setflag(nojobexp); setflag(nomobloot); setflag(nomvploot); setflag(nightenabled);
setflag(nodrop); setflag(novending); setflag(loadevent);
setflag(nochat); setflag(partylock); setflag(guildlock); setflag(src4instance);
@@ -7709,56 +7645,56 @@ ACMD_FUNC(mapflag) {
clif->message(sd->fd,"nobranch, noexppenalty, pvp, pvp_noparty, pvp_noguild, pvp_nightmaredrop,");
clif->message(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,");
clif->message(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,");
- clif->message(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot,");
+ clif->message(sd->fd,"fog, fireworks, sakura, leaves, nobaseexp, nojobexp, nomobloot,");
clif->message(sd->fd,"nomvploot, nightenabled, nodrop, novending, loadevent, nochat, partylock,");
clif->message(sd->fd,"guildlock, src4instance");
-
+
#undef checkflag
#undef setflag
-
- return 0;
+
+ return true;
}
/*===================================
* Remove some messages
*-----------------------------------*/
-ACMD_FUNC(showexp)
+ACMD(showexp)
{
if (sd->state.showexp) {
sd->state.showexp = 0;
clif->message(fd, msg_txt(1316)); // Gained exp will not be shown.
- return 0;
+ return true;
}
-
+
sd->state.showexp = 1;
clif->message(fd, msg_txt(1317)); // Gained exp is now shown.
- return 0;
+ return true;
}
-ACMD_FUNC(showzeny)
+ACMD(showzeny)
{
if (sd->state.showzeny) {
sd->state.showzeny = 0;
clif->message(fd, msg_txt(1318)); // Gained zeny will not be shown.
- return 0;
+ return true;
}
-
+
sd->state.showzeny = 1;
clif->message(fd, msg_txt(1319)); // Gained zeny is now shown.
- return 0;
+ return true;
}
-ACMD_FUNC(showdelay)
+ACMD(showdelay)
{
if (sd->state.showdelay) {
sd->state.showdelay = 0;
clif->message(fd, msg_txt(1320)); // Skill delay failures will not be shown.
- return 0;
+ return true;
}
-
+
sd->state.showdelay = 1;
clif->message(fd, msg_txt(1321)); // Skill delay failures are now shown.
- return 0;
+ return true;
}
/*==========================================
@@ -7770,78 +7706,78 @@ ACMD_FUNC(showdelay)
* @reject - reject invitation
* @leave - leave duel
*------------------------------------------*/
-ACMD_FUNC(invite)
+ACMD(invite)
{
unsigned int did = sd->duel_group;
struct map_session_data *target_sd = map_nick2sd((char *)message);
-
+
if(did == 0) {
// "Duel: @invite without @duel."
clif->message(fd, msg_txt(350));
- return 0;
+ return true;
}
-
+
if(duel_list[did].max_players_limit > 0 &&
- duel_list[did].members_count >= duel_list[did].max_players_limit) {
-
+ duel_list[did].members_count >= duel_list[did].max_players_limit) {
+
// "Duel: Limit of players is reached."
clif->message(fd, msg_txt(351));
- return 0;
+ return true;
}
-
+
if(target_sd == NULL) {
// "Duel: Player not found."
clif->message(fd, msg_txt(352));
- return 0;
+ return true;
}
-
+
if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
// "Duel: Player already in duel."
clif->message(fd, msg_txt(353));
- return 0;
+ return true;
}
-
+
if(battle_config.duel_only_on_same_map && target_sd->bl.m != sd->bl.m)
{
sprintf(atcmd_output, msg_txt(364), message);
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
-
+
duel_invite(did, sd, target_sd);
// "Duel: Invitation has been sent."
clif->message(fd, msg_txt(354));
- return 0;
+ return true;
}
-ACMD_FUNC(duel)
+ACMD(duel)
{
unsigned int maxpl = 0;
-
+
if(sd->duel_group > 0) {
duel_showinfo(sd->duel_group, sd);
- return 0;
+ return true;
}
-
+
if(sd->duel_invite > 0) {
// "Duel: @duel without @reject."
clif->message(fd, msg_txt(355));
- return 0;
+ return true;
}
-
+
if(!duel_checktime(sd)) {
char output[CHAT_SIZE_MAX];
// "Duel: You can take part in duel only one time per %d minutes."
sprintf(output, msg_txt(356), battle_config.duel_time_interval);
clif->message(fd, output);
- return 0;
+ return true;
}
-
+
if( message[0] ) {
if(sscanf(message, "%d", &maxpl) >= 1) {
if(maxpl < 2 || maxpl > 65535) {
clif->message(fd, msg_txt(357)); // "Duel: Invalid value."
- return 0;
+ return true;
}
duel_create(sd, maxpl);
} else {
@@ -7852,7 +7788,7 @@ ACMD_FUNC(duel)
if((newduel = duel_create(sd, 2)) != -1) {
if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
clif->message(fd, msg_txt(353)); // "Duel: Player already in duel."
- return 0;
+ return true;
}
duel_invite(newduel, sd, target_sd);
clif->message(fd, msg_txt(354)); // "Duel: Invitation has been sent."
@@ -7860,87 +7796,87 @@ ACMD_FUNC(duel)
} else {
// "Duel: Player not found."
clif->message(fd, msg_txt(352));
- return 0;
+ return true;
}
}
} else
duel_create(sd, 0);
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(leave)
+ACMD(leave)
{
if(sd->duel_group <= 0) {
// "Duel: @leave without @duel."
clif->message(fd, msg_txt(358));
- return 0;
+ return true;
}
-
+
duel_leave(sd->duel_group, sd);
clif->message(fd, msg_txt(359)); // "Duel: You left the duel."
- return 0;
+ return true;
}
-ACMD_FUNC(accept)
+ACMD(accept)
{
if(!duel_checktime(sd)) {
char output[CHAT_SIZE_MAX];
// "Duel: You can take part in duel only one time per %d minutes."
sprintf(output, msg_txt(356), battle_config.duel_time_interval);
clif->message(fd, output);
- return 0;
+ return true;
}
-
+
if(sd->duel_invite <= 0) {
// "Duel: @accept without invititation."
clif->message(fd, msg_txt(360));
- return 0;
+ return true;
}
-
+
if( duel_list[sd->duel_invite].max_players_limit > 0 && duel_list[sd->duel_invite].members_count >= duel_list[sd->duel_invite].max_players_limit )
{
// "Duel: Limit of players is reached."
clif->message(fd, msg_txt(351));
- return 0;
+ return true;
}
-
+
duel_accept(sd->duel_invite, sd);
// "Duel: Invitation has been accepted."
clif->message(fd, msg_txt(361));
- return 0;
+ return true;
}
-ACMD_FUNC(reject)
+ACMD(reject)
{
if(sd->duel_invite <= 0) {
// "Duel: @reject without invititation."
clif->message(fd, msg_txt(362));
- return 0;
+ return true;
}
-
+
duel_reject(sd->duel_invite, sd);
// "Duel: Invitation has been rejected."
clif->message(fd, msg_txt(363));
- return 0;
+ return true;
}
/*===================================
* Cash Points
*-----------------------------------*/
-ACMD_FUNC(cash)
+ACMD(cash)
{
char output[128];
int value;
int ret=0;
nullpo_retr(-1, sd);
-
+
if( !message || !*message || (value = atoi(message)) == 0 ) {
clif->message(fd, msg_txt(1322)); // Please enter an amount.
- return -1;
+ return false;
}
-
+
if( !strcmpi(command+1,"cash") )
{
if( value > 0 ) {
@@ -7973,70 +7909,70 @@ ACMD_FUNC(cash)
else clif->message(fd, msg_txt(41)); // Unable to decrease the number/value.
}
}
-
- return 0;
+
+ return true;
}
// @clone/@slaveclone/@evilclone <playername> [Valaris]
-ACMD_FUNC(clone)
+ACMD(clone)
{
int x=0,y=0,flag=0,master=0,i=0;
struct map_session_data *pl_sd=NULL;
-
+
if (!message || !*message) {
clif->message(sd->fd,msg_txt(1323)); // You must enter a player name or ID.
- return 0;
+ return true;
}
-
+
if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) {
clif->message(fd, msg_txt(3)); // Character not found.
- return 0;
+ return true;
}
-
+
if(pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
clif->message(fd, msg_txt(126)); // Cannot clone a player of higher GM level than yourself.
- return 0;
+ return true;
}
-
+
if (strcmpi(command+1, "clone") == 0)
flag = 1;
else if (strcmpi(command+1, "slaveclone") == 0) {
flag = 2;
if(pc_isdead(sd)){
clif->message(fd, msg_txt(129+flag*2));
- return 0;
+ return true;
}
master = sd->bl.id;
if (battle_config.atc_slave_clone_limit
&& mob_countslave(&sd->bl) >= battle_config.atc_slave_clone_limit) {
clif->message(fd, msg_txt(127)); // You've reached your slave clones limit.
- return 0;
+ return true;
}
}
-
+
do {
x = sd->bl.x + (rnd() % 10 - 5);
y = sd->bl.y + (rnd() % 10 - 5);
} while (map_getcell(sd->bl.m,x,y,CELL_CHKNOPASS) && i++ < 10);
-
+
if (i >= 10) {
x = sd->bl.x;
y = sd->bl.y;
}
-
+
if((x = mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, 0, flag?1:0, 0)) > 0) {
clif->message(fd, msg_txt(128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned.
- return 0;
+ return true;
}
clif->message(fd, msg_txt(129+flag*2)); // Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone.
- return 0;
+ return true;
}
/*=====================================
* Autorejecting Invites/Deals [LuzZza]
* Usage: @noask
*-------------------------------------*/
-ACMD_FUNC(noask)
+ACMD(noask)
{
if(sd->state.noask) {
clif->message(fd, msg_txt(391)); // Autorejecting is deactivated.
@@ -8045,58 +7981,58 @@ ACMD_FUNC(noask)
clif->message(fd, msg_txt(390)); // Autorejecting is activated.
sd->state.noask = 1;
}
-
- return 0;
+
+ return true;
}
/*=====================================
* Send a @request message to all GMs of lowest_gm_level.
* Usage: @request <petition>
*-------------------------------------*/
-ACMD_FUNC(request)
+ACMD(request)
{
if (!message || !*message) {
clif->message(sd->fd,msg_txt(277)); // Usage: @request <petition/message to online GMs>.
- return -1;
+ return false;
}
-
+
sprintf(atcmd_output, msg_txt(278), message); // (@request): %s
intif_wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output);
clif->disp_onlyself(sd, atcmd_output, strlen(atcmd_output));
clif->message(sd->fd,msg_txt(279)); // @request sent.
- return 0;
+ return true;
}
/*==========================================
* Feel (SG save map) Reset [HiddenDragon]
*------------------------------------------*/
-ACMD_FUNC(feelreset)
+ACMD(feelreset)
{
pc_resetfeel(sd);
clif->message(fd, msg_txt(1324)); // Reset 'Feeling' maps.
-
- return 0;
+
+ return true;
}
/*==========================================
* AUCTION SYSTEM
*------------------------------------------*/
-ACMD_FUNC(auction)
+ACMD(auction)
{
nullpo_ret(sd);
-
+
clif->auction_openwindow(sd);
-
- return 0;
+
+ return true;
}
/*==========================================
* Kill Steal Protection
*------------------------------------------*/
-ACMD_FUNC(ksprotection)
+ACMD(ksprotection)
{
nullpo_retr(-1,sd);
-
+
if( sd->state.noks ) {
sd->state.noks = 0;
clif->message(fd, msg_txt(1325)); // [ K.S Protection Inactive ]
@@ -8121,15 +8057,15 @@ ACMD_FUNC(ksprotection)
else
clif->message(fd, msg_txt(1329)); // Usage: @noks <self|party|guild>
}
- return 0;
+ return true;
}
/*==========================================
* Map Kill Steal Protection Setting
*------------------------------------------*/
-ACMD_FUNC(allowks)
+ACMD(allowks)
{
nullpo_retr(-1,sd);
-
+
if( map[sd->bl.m].flag.allowks ) {
map[sd->bl.m].flag.allowks = 0;
clif->message(fd, msg_txt(1330)); // [ Map K.S Protection Active ]
@@ -8137,27 +8073,27 @@ ACMD_FUNC(allowks)
map[sd->bl.m].flag.allowks = 1;
clif->message(fd, msg_txt(1331)); // [ Map K.S Protection Inactive ]
}
- return 0;
+ return true;
}
-ACMD_FUNC(resetstat)
+ACMD(resetstat)
{
nullpo_retr(-1, sd);
-
+
pc_resetstate(sd);
sprintf(atcmd_output, msg_txt(207), sd->status.name);
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
-ACMD_FUNC(resetskill)
+ACMD(resetskill)
{
nullpo_retr(-1,sd);
-
+
pc_resetskill(sd,1);
sprintf(atcmd_output, msg_txt(206), sd->status.name);
clif->message(fd, atcmd_output);
- return 0;
+ return true;
}
/*==========================================
@@ -8165,16 +8101,16 @@ ACMD_FUNC(resetskill)
* #cartlist: Displays contents of target's cart.
* #itemlist: Displays contents of target's inventory.
*------------------------------------------*/
-ACMD_FUNC(itemlist)
+ACMD(itemlist)
{
int i, j, count, counter;
const char* location;
const struct item* items;
int size;
StringBuf buf;
-
+
nullpo_retr(-1, sd);
-
+
if( strcmp(command+1, "storagelist") == 0 )
{
location = "storage";
@@ -8182,49 +8118,49 @@ ACMD_FUNC(itemlist)
size = MAX_STORAGE;
}
else
- if( strcmp(command+1, "cartlist") == 0 )
- {
- location = "cart";
- items = sd->status.cart;
- size = MAX_CART;
- }
- else
- if( strcmp(command+1, "itemlist") == 0 )
- {
- location = "inventory";
- items = sd->status.inventory;
- size = MAX_INVENTORY;
- }
- else
- return 1;
-
+ if( strcmp(command+1, "cartlist") == 0 )
+ {
+ location = "cart";
+ items = sd->status.cart;
+ size = MAX_CART;
+ }
+ else
+ if( strcmp(command+1, "itemlist") == 0 )
+ {
+ location = "inventory";
+ items = sd->status.inventory;
+ size = MAX_INVENTORY;
+ }
+ else
+ return 1;
+
StringBuf_Init(&buf);
-
+
count = 0; // total slots occupied
counter = 0; // total items found
for( i = 0; i < size; ++i )
{
const struct item* it = &items[i];
struct item_data* itd;
-
+
if( it->nameid == 0 || (itd = itemdb_exists(it->nameid)) == NULL )
continue;
-
+
counter += it->amount;
count++;
-
+
if( count == 1 )
{
StringBuf_Printf(&buf, msg_txt(1332), location, sd->status.name); // ------ %s items list of '%s' ------
clif->message(fd, StringBuf_Value(&buf));
StringBuf_Clear(&buf);
}
-
+
if( it->refine )
StringBuf_Printf(&buf, "%d %s %+d (%s, id: %d)", it->amount, itd->jname, it->refine, itd->name, it->nameid);
else
StringBuf_Printf(&buf, "%d %s (%s, id: %d)", it->amount, itd->jname, itd->name, it->nameid);
-
+
if( it->equip )
{
char equipstr[CHAT_SIZE_MAX];
@@ -8261,10 +8197,10 @@ ACMD_FUNC(itemlist)
equipstr[strlen(equipstr) - 2] = '\0';
StringBuf_AppendStr(&buf, equipstr);
}
-
+
clif->message(fd, StringBuf_Value(&buf));
StringBuf_Clear(&buf);
-
+
if( it->card[0] == CARD0_PET )
{// pet egg
if (it->card[3])
@@ -8273,60 +8209,60 @@ ACMD_FUNC(itemlist)
StringBuf_Printf(&buf, msg_txt(1349), (unsigned int)MakeDWord(it->card[1], it->card[2])); // -> (pet egg, pet id: %u, unnamed)
}
else
- if(it->card[0] == CARD0_FORGE)
- {// forged item
- StringBuf_Printf(&buf, msg_txt(1350), (unsigned int)MakeDWord(it->card[2], it->card[3]), it->card[1]>>8, it->card[1]&0x0f); // -> (crafted item, creator id: %u, star crumbs %d, element %d)
- }
- else
- if(it->card[0] == CARD0_CREATE)
- {// created item
- StringBuf_Printf(&buf, msg_txt(1351), (unsigned int)MakeDWord(it->card[2], it->card[3])); // -> (produced item, creator id: %u)
- }
- else
- {// normal item
- int counter2 = 0;
-
- for( j = 0; j < itd->slot; ++j )
- {
- struct item_data* card;
-
- if( it->card[j] == 0 || (card = itemdb_exists(it->card[j])) == NULL )
- continue;
-
- counter2++;
-
- if( counter2 == 1 )
- StringBuf_AppendStr(&buf, msg_txt(1352)); // -> (card(s):
-
- if( counter2 != 1 )
- StringBuf_AppendStr(&buf, ", ");
-
- StringBuf_Printf(&buf, "#%d %s (id: %d)", counter2, card->jname, card->nameid);
+ if(it->card[0] == CARD0_FORGE)
+ {// forged item
+ StringBuf_Printf(&buf, msg_txt(1350), (unsigned int)MakeDWord(it->card[2], it->card[3]), it->card[1]>>8, it->card[1]&0x0f); // -> (crafted item, creator id: %u, star crumbs %d, element %d)
}
-
- if( counter2 > 0 )
- StringBuf_AppendStr(&buf, ")");
- }
-
+ else
+ if(it->card[0] == CARD0_CREATE)
+ {// created item
+ StringBuf_Printf(&buf, msg_txt(1351), (unsigned int)MakeDWord(it->card[2], it->card[3])); // -> (produced item, creator id: %u)
+ }
+ else
+ {// normal item
+ int counter2 = 0;
+
+ for( j = 0; j < itd->slot; ++j )
+ {
+ struct item_data* card;
+
+ if( it->card[j] == 0 || (card = itemdb_exists(it->card[j])) == NULL )
+ continue;
+
+ counter2++;
+
+ if( counter2 == 1 )
+ StringBuf_AppendStr(&buf, msg_txt(1352)); // -> (card(s):
+
+ if( counter2 != 1 )
+ StringBuf_AppendStr(&buf, ", ");
+
+ StringBuf_Printf(&buf, "#%d %s (id: %d)", counter2, card->jname, card->nameid);
+ }
+
+ if( counter2 > 0 )
+ StringBuf_AppendStr(&buf, ")");
+ }
+
if( StringBuf_Length(&buf) > 0 )
clif->message(fd, StringBuf_Value(&buf));
-
+
StringBuf_Clear(&buf);
}
-
+
if( count == 0 )
StringBuf_Printf(&buf, msg_txt(1353), location); // No item found in this player's %s.
else
StringBuf_Printf(&buf, msg_txt(1354), counter, count, location); // %d item(s) found in %d %s slots.
-
+
clif->message(fd, StringBuf_Value(&buf));
-
+
StringBuf_Destroy(&buf);
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(stats)
+ACMD(stats)
{
char job_jobname[100];
char output[CHAT_SIZE_MAX];
@@ -8353,10 +8289,10 @@ ACMD_FUNC(stats)
{ "JobChangeLvl (3rd) - %d", 0 },
{ NULL, 0 }
};
-
+
memset(job_jobname, '\0', sizeof(job_jobname));
memset(output, '\0', sizeof(output));
-
+
//direct array initialization with variables is not standard C compliant.
output_table[0].value = sd->status.base_level;
output_table[1].format = job_jobname;
@@ -8375,34 +8311,34 @@ ACMD_FUNC(stats)
output_table[13].value = sd->status.skill_point;
output_table[14].value = sd->change_level_2nd;
output_table[15].value = sd->change_level_3rd;
-
+
sprintf(job_jobname, "Job - %s %s", job_name(sd->status.class_), "(level %d)");
sprintf(output, msg_txt(53), sd->status.name); // '%s' stats:
-
+
clif->message(fd, output);
-
+
for (i = 0; output_table[i].format != NULL; i++) {
sprintf(output, output_table[i].format, output_table[i].value);
clif->message(fd, output);
}
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(delitem)
+ACMD(delitem)
{
char item_name[100];
int nameid, amount = 0, total, idx;
struct item_data* id;
-
+
nullpo_retr(-1, sd);
-
+
if( !message || !*message || ( sscanf(message, "\"%99[^\"]\" %d", item_name, &amount) < 2 && sscanf(message, "%99s %d", item_name, &amount) < 2 ) || amount < 1 )
{
clif->message(fd, msg_txt(1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>).
- return -1;
+ return false;
}
-
+
if( ( id = itemdb_searchname(item_name) ) != NULL || ( id = itemdb_exists(atoi(item_name)) ) != NULL )
{
nameid = id->nameid;
@@ -8410,29 +8346,29 @@ ACMD_FUNC(delitem)
else
{
clif->message(fd, msg_txt(19)); // Invalid item ID or name.
- return -1;
+ return false;
}
-
+
total = amount;
-
+
// delete items
while( amount && ( idx = pc_search_inventory(sd, nameid) ) != -1 )
{
int delamount = ( amount < sd->status.inventory[idx].amount ) ? amount : sd->status.inventory[idx].amount;
-
+
if( sd->inventory_data[idx]->type == IT_PETEGG && sd->status.inventory[idx].card[0] == CARD0_PET )
{// delete pet
intif_delete_petdata(MakeDWord(sd->status.inventory[idx].card[1], sd->status.inventory[idx].card[2]));
}
pc_delitem(sd, idx, delamount, 0, 0, LOG_TYPE_COMMAND);
-
+
amount-= delamount;
}
-
+
// notify target
sprintf(atcmd_output, msg_txt(113), total-amount); // %d item(s) removed by a GM.
clif->message(sd->fd, atcmd_output);
-
+
// notify source
if( amount == total )
{
@@ -8448,18 +8384,18 @@ ACMD_FUNC(delitem)
sprintf(atcmd_output, msg_txt(114), total); // %d item(s) removed from the player.
clif->message(fd, atcmd_output);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Custom Fonts
*------------------------------------------*/
-ACMD_FUNC(font)
+ACMD(font)
{
int font_id;
nullpo_retr(-1,sd);
-
+
font_id = atoi(message);
if( font_id == 0 )
{
@@ -8485,8 +8421,8 @@ ACMD_FUNC(font)
}
else
clif->message(fd, msg_txt(1361)); // Already using this font.
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -8499,15 +8435,15 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
AtCommandInfo* cmd;
DBIterator *iter = db_iterator(atcommand_db);
int count = 0;
-
+
memset(line_buff,' ',CHATBOX_SIZE);
line_buff[CHATBOX_SIZE-1] = 0;
-
+
clif->message(fd, msg_txt(273)); // "Commands available:"
-
+
for (cmd = dbi_first(iter); dbi_exists(iter); cmd = dbi_next(iter)) {
unsigned int slen = 0;
-
+
switch( type ) {
case COMMAND_CHARCOMMAND:
if( cmd->char_groups[sd->group_pos] == 0 )
@@ -8520,10 +8456,10 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
default:
continue;
}
-
-
+
+
slen = strlen(cmd->command);
-
+
// flush the text buffer if this command won't fit into it
if ( slen + cur - line_buff >= CHATBOX_SIZE )
{
@@ -8532,41 +8468,41 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
memset(line_buff,' ',CHATBOX_SIZE);
line_buff[CHATBOX_SIZE-1] = 0;
}
-
+
memcpy(cur,cmd->command,slen);
cur += slen+(10-slen%10);
-
+
count++;
}
dbi_destroy(iter);
clif->message(fd,line_buff);
-
+
sprintf(atcmd_output, msg_txt(274), count); // "%d commands found."
clif->message(fd, atcmd_output);
-
+
return;
}
/*==========================================
* @commands Lists available @ commands to you
*------------------------------------------*/
-ACMD_FUNC(commands)
+ACMD(commands)
{
atcommand_commands_sub(sd, fd, COMMAND_ATCOMMAND);
- return 0;
+ return true;
}
/*==========================================
* @charcommands Lists available # commands to you
*------------------------------------------*/
-ACMD_FUNC(charcommands)
+ACMD(charcommands)
{
atcommand_commands_sub(sd, fd, COMMAND_CHARCOMMAND);
- return 0;
+ return true;
}
/* for new mounts */
-ACMD_FUNC(mount2) {
-
+ACMD(mount2) {
+
clif->message(sd->fd,msg_txt(1362)); // NOTICE: If you crash with mount your LUA is outdated.
if( !(sd->sc.option&OPTION_MOUNTING) ) {
clif->message(sd->fd,msg_txt(1363)); // You have mounted.
@@ -8575,72 +8511,72 @@ ACMD_FUNC(mount2) {
clif->message(sd->fd,msg_txt(1364)); // You have released your mount.
pc_setoption(sd, sd->sc.option&~OPTION_MOUNTING);
}
- return 0;
+ return true;
}
-ACMD_FUNC(accinfo) {
+ACMD(accinfo) {
char query[NAME_LENGTH];
-
+
if (!message || !*message || strlen(message) > NAME_LENGTH ) {
clif->message(fd, msg_txt(1365)); // Usage: @accinfo/@accountinfo <account_id/char name>
clif->message(fd, msg_txt(1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario".
- return -1;
+ return false;
}
-
+
//remove const type
safestrncpy(query, message, NAME_LENGTH);
-
+
intif_request_accinfo( sd->fd, sd->bl.id, pc_get_group_level(sd), query );
-
- return 0;
+
+ return true;
}
/* [Ind] */
-ACMD_FUNC(set) {
+ACMD(set) {
char reg[32], val[128];
struct script_data* data;
int toset = 0, len;
bool is_str = false;
-
+
if( !message || !*message || (toset = sscanf(message, "%31s %128[^\n]s", reg, val)) < 1 ) {
clif->message(fd, msg_txt(1367)); // Usage: @set <variable name> <value>
clif->message(fd, msg_txt(1368)); // Usage: ex. "@set PoringCharVar 50"
clif->message(fd, msg_txt(1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String"
clif->message(fd, msg_txt(1370)); // Usage: ex. "@set PoringCharVarSTR$" outputs its value, Super Duper String.
- return -1;
+ return false;
}
-
+
/* disabled variable types (they require a proper script state to function, so allowing them would crash the server) */
if( reg[0] == '.' ) {
clif->message(fd, msg_txt(1371)); // NPC variables may not be used with @set.
- return -1;
+ return false;
} else if( reg[0] == '\'' ) {
clif->message(fd, msg_txt(1372)); // Instance variables may not be used with @set.
- return -1;
+ return false;
}
-
+
is_str = ( reg[strlen(reg) - 1] == '$' ) ? true : false;
-
+
if( ( len = strlen(val) ) > 1 ) {
if( val[0] == '"' && val[len-1] == '"') {
val[len-1] = '\0'; //Strip quotes.
memmove(val, val+1, len-1);
}
}
-
+
if( toset >= 2 ) {/* we only set the var if there is an val, otherwise we only output the value */
if( is_str )
set_var(sd, reg, (void*) val);
else
- set_var(sd, reg, (void*)__64BPRTSIZE((atoi(val))));
-
+ set_var(sd, reg, (void*)__64BPTRSIZE((atoi(val))));
+
}
-
+
CREATE(data, struct script_data,1);
-
-
+
+
if( is_str ) {// string variable
-
+
switch( reg[0] ) {
case '@':
data->u.str = pc_readregstr(sd, add_str(reg));
@@ -8658,7 +8594,7 @@ ACMD_FUNC(set) {
data->u.str = pc_readglobalreg_str(sd, reg);
break;
}
-
+
if( data->u.str == NULL || data->u.str[0] == '\0' ) {// empty string
data->type = C_CONSTSTR;
data->u.str = "";
@@ -8666,9 +8602,9 @@ ACMD_FUNC(set) {
data->type = C_STR;
data->u.str = aStrdup(data->u.str);
}
-
+
} else {// integer variable
-
+
data->type = C_INT;
switch( reg[0] ) {
case '@':
@@ -8687,10 +8623,10 @@ ACMD_FUNC(set) {
data->u.num = pc_readglobalreg(sd, reg);
break;
}
-
+
}
-
-
+
+
switch( data->type ) {
case C_INT:
sprintf(atcmd_output,msg_txt(1373),reg,data->u.num); // %s value is now :%d
@@ -8705,23 +8641,23 @@ ACMD_FUNC(set) {
sprintf(atcmd_output,msg_txt(1376),reg,data->type); // %s data type is not supported :%u
break;
}
-
+
clif->message(fd, atcmd_output);
-
+
aFree(data);
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(reloadquestdb) {
+ACMD(reloadquestdb) {
do_reload_quest();
clif->message(fd, msg_txt(1377)); // Quest database has been reloaded.
- return 0;
+ return true;
}
-ACMD_FUNC(addperm) {
+ACMD(addperm) {
int perm_size = ARRAYLENGTH(pc_g_permission_name);
bool add = (strcmpi(command+1, "addperm") == 0) ? true : false;
int i;
-
+
if( !message || !*message ) {
sprintf(atcmd_output, msg_txt(1378),command); // Usage: %s <permission_name>
clif->message(fd, atcmd_output);
@@ -8730,11 +8666,11 @@ ACMD_FUNC(addperm) {
sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name);
clif->message(fd, atcmd_output);
}
- return -1;
+ return false;
}
-
+
ARR_FIND(0, perm_size, i, strcmpi(pc_g_permission_name[i].name, message) == 0);
-
+
if( i == perm_size ) {
sprintf(atcmd_output,msg_txt(1380),message); // '%s' is not a known permission.
clif->message(fd, atcmd_output);
@@ -8743,13 +8679,13 @@ ACMD_FUNC(addperm) {
sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name);
clif->message(fd, atcmd_output);
}
- return -1;
+ return false;
}
-
+
if( add && (sd->permissions&pc_g_permission_name[i].permission) ) {
sprintf(atcmd_output, msg_txt(1381),sd->status.name,pc_g_permission_name[i].name); // User '%s' already possesses the '%s' permission.
clif->message(fd, atcmd_output);
- return -1;
+ return false;
} else if ( !add && !(sd->permissions&pc_g_permission_name[i].permission) ) {
sprintf(atcmd_output, msg_txt(1382),sd->status.name,pc_g_permission_name[i].name); // User '%s' doesn't possess the '%s' permission.
clif->message(fd, atcmd_output);
@@ -8761,106 +8697,106 @@ ACMD_FUNC(addperm) {
clif->message(fd, atcmd_output);
}
}
-
- return -1;
+
+ return false;
}
-
+
if( add )
sd->permissions |= pc_g_permission_name[i].permission;
else
sd->permissions &=~ pc_g_permission_name[i].permission;
-
-
+
+
sprintf(atcmd_output, msg_txt(1384),sd->status.name); // User '%s' permissions updated successfully. The changes are temporary.
clif->message(fd, atcmd_output);
-
- return 0;
+
+ return true;
}
-ACMD_FUNC(unloadnpcfile) {
-
+ACMD(unloadnpcfile) {
+
if( !message || !*message ) {
clif->message(fd, msg_txt(1385)); // Usage: @unloadnpcfile <file name>
- return -1;
+ return false;
}
-
+
if( npc_unloadfile(message) )
clif->message(fd, msg_txt(1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed.
else {
clif->message(fd, msg_txt(1387)); // File not found.
- return -1;
+ return false;
}
- return 0;
+ return true;
}
-ACMD_FUNC(cart) {
+ACMD(cart) {
#define MC_CART_MDFY(x) \
- sd->status.skill[MC_PUSHCART].id = x?MC_PUSHCART:0; \
- sd->status.skill[MC_PUSHCART].lv = x?1:0; \
- sd->status.skill[MC_PUSHCART].flag = x?1:0;
-
+sd->status.skill[MC_PUSHCART].id = x?MC_PUSHCART:0; \
+sd->status.skill[MC_PUSHCART].lv = x?1:0; \
+sd->status.skill[MC_PUSHCART].flag = x?1:0;
+
int val = atoi(message);
bool need_skill = pc_checkskill(sd, MC_PUSHCART) ? false : true;
-
+
if( !message || !*message || val < 0 || val > MAX_CARTS ) {
sprintf(atcmd_output, msg_txt(1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>).
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
-
+
if( val == 0 && !pc_iscarton(sd) ) {
clif->message(fd, msg_txt(1391)); // You do not possess a cart to be removed
- return -1;
+ return false;
}
-
+
if( need_skill ) {
MC_CART_MDFY(1);
}
-
+
if( pc_setcart(sd, val) ) {
if( need_skill ) {
MC_CART_MDFY(0);
}
- return -1;/* @cart failed */
+ return false;/* @cart failed */
}
-
+
if( need_skill ) {
MC_CART_MDFY(0);
}
-
+
clif->message(fd, msg_txt(1392)); // Cart Added
-
- return 0;
- #undef MC_CART_MDFY
+
+ return true;
+#undef MC_CART_MDFY
}
/* [Ind/Hercules] */
-ACMD_FUNC(join) {
+ACMD(join) {
struct hChSysCh *channel;
char name[HCHSYS_NAME_LENGTH], pass[HCHSYS_NAME_LENGTH];
if( !message || !*message || sscanf(message, "%s %s", name, pass) < 1 ) {
sprintf(atcmd_output, msg_txt(1399),command); // Unknown Channel (usage: %s <#channel_name>)
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
if( hChSys.local && strcmpi(name + 1, hChSys.local_name) == 0 ) {
if( !map[sd->bl.m].channel ) {
clif->chsys_mjoin(sd);
- return 0;
+ return true;
} else
channel = map[sd->bl.m].channel;
} else if( hChSys.ally && sd->status.guild_id && strcmpi(name + 1, hChSys.ally_name) == 0 ) {
struct guild *g = sd->guild;
- if( !g ) return -1;/* unlikely, but we wont let it crash anyway. */
+ if( !g ) return false;/* unlikely, but we wont let it crash anyway. */
channel = (struct hChSysCh *)g->channel;
} else if( !( channel = strdb_get(clif->channel_db, name + 1) ) ) {
sprintf(atcmd_output, msg_txt(1400),name,command); // Unknown Channel '%s' (usage: %s <#channel_name>)
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
if( idb_exists(channel->users, sd->status.char_id) ) {
sprintf(atcmd_output, msg_txt(1434),name); // You're already in the '%s' channel
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
if( channel->pass[0] != '\0' && strcmp(channel->pass,pass) != 0 ) {
if( pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
@@ -8868,10 +8804,16 @@ ACMD_FUNC(join) {
} else {
sprintf(atcmd_output, msg_txt(1401),name,command); // '%s' Channel is password protected (usage: %s <#channel_name> <password>)
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
}
+ if( channel->banned && idb_exists(channel->banned, sd->status.account_id) ) {
+ sprintf(atcmd_output, msg_txt(1438),name); // You cannot join the '%s' channel because you've been banned from it
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
if( !( channel->opt & hChSys_OPT_ANNOUNCE_JOIN ) ) {
sprintf(atcmd_output, msg_txt(1403),name); // You're now in the '%s' channel
clif->message(fd, atcmd_output);
@@ -8879,7 +8821,7 @@ ACMD_FUNC(join) {
clif->chsys_join(channel,sd);
- return 0;
+ return true;
}
/* [Ind/Hercules] */
static inline void atcmd_channel_help(int fd, const char *command, bool can_create) {
@@ -8911,10 +8853,29 @@ static inline void atcmd_channel_help(int fd, const char *command, bool can_crea
sprintf(atcmd_output, msg_txt(1429),command);// -- %s unbind
clif->message(fd, atcmd_output);
clif->message(fd, msg_txt(1430));// - unbinds your global chat from its attached channel (if binded)
-
+ sprintf(atcmd_output, msg_txt(1429),command);// -- %s unbind
+ clif->message(fd, atcmd_output);
+ if( can_create ) {
+ sprintf(atcmd_output, msg_txt(1456),command);// -- %s ban <channel name> <character name>
+ clif->message(fd, atcmd_output);
+ clif->message(fd, msg_txt(1457));// - bans <character name> from <channel name> channel
+ sprintf(atcmd_output, msg_txt(1458),command);// -- %s banlist <channel name>
+ clif->message(fd, atcmd_output);
+ clif->message(fd, msg_txt(1459));// - lists all banned characters from <channel name> channel
+ sprintf(atcmd_output, msg_txt(1460),command);// -- %s unban <channel name> <character name>
+ clif->message(fd, atcmd_output);
+ clif->message(fd, msg_txt(1461));// - unbans <character name> from <channel name> channel
+ sprintf(atcmd_output, msg_txt(1467),command);// -- %s unbanall <channel name>
+ clif->message(fd, atcmd_output);
+ clif->message(fd, msg_txt(1468));// - unbans everyone from <channel name>
+ sprintf(atcmd_output, msg_txt(1462),command);// -- %s setopt <channel name> <option name> <option value>
+ clif->message(fd, atcmd_output);
+ clif->message(fd, msg_txt(1463));// - adds or removes <option name> with <option value> to <channel name> channel
+ }
+
}
/* [Ind/Hercules] */
-ACMD_FUNC(channel) {
+ACMD(channel) {
struct hChSysCh *channel;
char key[HCHSYS_NAME_LENGTH], sub1[HCHSYS_NAME_LENGTH], sub2[HCHSYS_NAME_LENGTH], sub3[HCHSYS_NAME_LENGTH];
unsigned char k = 0;
@@ -8922,29 +8883,29 @@ ACMD_FUNC(channel) {
if( !message || !*message || sscanf(message, "%s %s %s %s", key, sub1, sub2, sub3) < 1 ) {
atcmd_channel_help(fd,command,( hChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ));
- return 0;
+ return true;
}
if( strcmpi(key,"create") == 0 && ( hChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) ) {
if( sub1[0] != '#' ) {
clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
- return -1;
+ return false;
} else if ( strlen(sub1) < 3 || strlen(sub1) > HCHSYS_NAME_LENGTH ) {
sprintf(atcmd_output, msg_txt(1406), HCHSYS_NAME_LENGTH);// Channel length must be between 3 and %d
clif->message(fd, atcmd_output);
- return -1;
+ return false;
} else if ( sub3[0] != '\0' ) {
clif->message(fd, msg_txt(1408)); // Channel password may not contain spaces
- return -1;
+ return false;
}
if( strcmpi(sub1 + 1,hChSys.local_name) == 0 || strcmpi(sub1 + 1,hChSys.ally_name) == 0 || strdb_exists(clif->channel_db, sub1 + 1) ) {
sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
CREATE( channel, struct hChSysCh, 1 );
-
+
clif->chsys_create(channel,sub1 + 1,sub2,0);
channel->owner = sd->status.char_id;
@@ -8982,12 +8943,12 @@ ACMD_FUNC(channel) {
}
if( hChSys.ally && sd->status.guild_id ) {
struct guild *g = sd->guild;
- if( !g ) return -1;
+ if( !g ) { dbi_destroy(iter); return false; }
sprintf(atcmd_output, msg_txt(1409), hChSys.ally_name, db_size(((struct hChSysCh *)g->channel)->users));// - #%s ( %d users )
clif->message(fd, atcmd_output);
}
for(channel = dbi_first(iter); dbi_exists(iter); channel = dbi_next(iter)) {
- if( show_all || channel->type == hChSys_PUBLIC ) {
+ if( show_all || channel->type == hChSys_PUBLIC || channel->type == hChSys_IRC ) {
sprintf(atcmd_output, msg_txt(1409), channel->name, db_size(channel->users));// - #%s ( %d users )
clif->message(fd, atcmd_output);
}
@@ -8998,19 +8959,19 @@ ACMD_FUNC(channel) {
if( sub1[0] != '#' ) {
clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
- return -1;
+ return false;
}
if( !(channel = strdb_get(clif->channel_db, sub1 + 1)) ) {
sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
if( channel->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
sprintf(atcmd_output, msg_txt(1412), sub1);// You're not the owner of channel '%s'
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
for( k = 0; k < hChSys.colors_count; k++ ) {
@@ -9020,7 +8981,7 @@ ACMD_FUNC(channel) {
if( k == hChSys.colors_count ) {
sprintf(atcmd_output, msg_txt(1411), sub2);// Unknown color '%s'
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
channel->color = k;
sprintf(atcmd_output, msg_txt(1413),sub1,hChSys.colors_name[k]);// '%s' channel color updated to '%s'
@@ -9029,7 +8990,7 @@ ACMD_FUNC(channel) {
if( sub1[0] != '#' ) {
clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
- return -1;
+ return false;
}
for(k = 0; k < sd->channel_count; k++) {
@@ -9039,7 +9000,7 @@ ACMD_FUNC(channel) {
if( k == sd->channel_count ) {
sprintf(atcmd_output, msg_txt(1425),sub1);// You're not part of the '%s' channel
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
clif->chsys_left(sd->channels[k],sd);
sprintf(atcmd_output, msg_txt(1425),sub1); // You've left the '%s' channel
@@ -9048,7 +9009,7 @@ ACMD_FUNC(channel) {
if( sub1[0] != '#' ) {
clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
- return -1;
+ return false;
}
for(k = 0; k < sd->channel_count; k++) {
@@ -9058,7 +9019,7 @@ ACMD_FUNC(channel) {
if( k == sd->channel_count ) {
sprintf(atcmd_output, msg_txt(1425),sub1);// You're not part of the '%s' channel
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
sd->gcbind = sd->channels[k];
@@ -9068,21 +9029,301 @@ ACMD_FUNC(channel) {
if( sd->gcbind == NULL ) {
clif->message(fd, msg_txt(1432));// Your global chat is not binded to any channel
- return -1;
+ return false;
}
sprintf(atcmd_output, msg_txt(1433),sd->gcbind->name); // Your global chat is now unbinded from the '#%s' channel
clif->message(fd, atcmd_output);
-
+
sd->gcbind = NULL;
+ } else if ( strcmpi(key,"ban") == 0 ) {
+ struct map_session_data *pl_sd = NULL;
+ struct hChSysBanEntry *entry = NULL;
+
+ if( sub1[0] != '#' ) {
+ clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
+ return false;
+ }
+
+ if( !(channel = strdb_get(clif->channel_db, sub1 + 1)) ) {
+ sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( channel->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
+ sprintf(atcmd_output, msg_txt(1412), sub1);// You're not the owner of channel '%s'
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( sub2[0] == '\0' || ( pl_sd = map_nick2sd(sub2) ) == NULL ) {
+ sprintf(atcmd_output, msg_txt(1434), sub2);// Player '%s' was not found
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( pc_has_permission(pl_sd, PC_PERM_HCHSYS_ADMIN) ) {
+ clif->message(fd, msg_txt(1464)); // Ban failed, not possible to ban this user.
+ return false;
+ }
+
+ if( channel->banned && idb_exists(channel->banned,pl_sd->status.account_id) ) {
+ sprintf(atcmd_output, msg_txt(1465), pl_sd->status.name);// Player '%s' is already banned from this channel
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( !channel->banned )
+ channel->banned = idb_alloc(DB_OPT_BASE|DB_OPT_ALLOW_NULL_DATA|DB_OPT_RELEASE_DATA);
+
+ CREATE(entry, struct hChSysBanEntry, 1);
+
+ safestrncpy(entry->name, pl_sd->status.name, NAME_LENGTH);
+
+ idb_put(channel->banned, pl_sd->status.account_id, entry);
+
+ clif->chsys_left(channel,pl_sd);
+
+ sprintf(atcmd_output, msg_txt(1437),pl_sd->status.name,sub1); // Player '%s' has now been banned from '%s' channel
+ clif->message(fd, atcmd_output);
+ } else if ( strcmpi(key,"unban") == 0 ) {
+ struct map_session_data *pl_sd = NULL;
+
+ if( sub1[0] != '#' ) {
+ clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
+ return false;
+ }
+
+ if( !(channel = strdb_get(clif->channel_db, sub1 + 1)) ) {
+ sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( channel->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
+ sprintf(atcmd_output, msg_txt(1412), sub1);// You're not the owner of channel '%s'
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( !channel->banned ) {
+ sprintf(atcmd_output, msg_txt(1439), sub1);// Channel '%s' has no banned players
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( sub2[0] == '\0' || ( pl_sd = map_nick2sd(sub2) ) == NULL ) {
+ sprintf(atcmd_output, msg_txt(1434), sub2);// Player '%s' was not found
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( !idb_exists(channel->banned,pl_sd->status.account_id) ) {
+ sprintf(atcmd_output, msg_txt(1440), pl_sd->status.name);// Player '%s' is not banned from this channel
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ idb_remove(channel->banned, pl_sd->status.account_id);
+
+ if( !db_size(channel->banned) ) {
+ db_destroy(channel->banned);
+ channel->banned = NULL;
+ }
+
+ sprintf(atcmd_output, msg_txt(1441),pl_sd->status.name,sub1); // Player '%s' has now been unbanned from the '%s' channel
+ clif->message(fd, atcmd_output);
+ } else if ( strcmpi(key,"unbanall") == 0 ) {
+ if( sub1[0] != '#' ) {
+ clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
+ return false;
+ }
+
+ if( !(channel = strdb_get(clif->channel_db, sub1 + 1)) ) {
+ sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( channel->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
+ sprintf(atcmd_output, msg_txt(1412), sub1);// You're not the owner of channel '%s'
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( !channel->banned ) {
+ sprintf(atcmd_output, msg_txt(1439), sub1);// Channel '%s' has no banned players
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ db_destroy(channel->banned);
+ channel->banned = NULL;
+
+ sprintf(atcmd_output, msg_txt(1442),sub1); // Removed all bans from '%s' channel
+ clif->message(fd, atcmd_output);
+ } else if ( strcmpi(key,"banlist") == 0 ) {
+ DBIterator *iter = NULL;
+ DBKey key;
+ DBData *data;
+ bool isA = pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)?true:false;
+ if( sub1[0] != '#' ) {
+ clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
+ return false;
+ }
+
+ if( !(channel = strdb_get(clif->channel_db, sub1 + 1)) ) {
+ sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( channel->owner != sd->status.char_id && !isA ) {
+ sprintf(atcmd_output, msg_txt(1412), sub1);// You're not the owner of channel '%s'
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( !channel->banned ) {
+ sprintf(atcmd_output, msg_txt(1439), sub1);// Channel '%s' has no banned players
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+ sprintf(atcmd_output, msg_txt(1443), channel->name);// -- '%s' ban list
+ clif->message(fd, atcmd_output);
+
+ iter = db_iterator(channel->banned);
+
+ for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) {
+ struct hChSysBanEntry * entry = db_data2ptr(data);
+
+ if( !isA )
+ sprintf(atcmd_output, msg_txt(1444), entry->name);// - %s %s
+ else
+ sprintf(atcmd_output, msg_txt(1445), entry->name, key.i);// - %s (%d)
+
+ clif->message(fd, atcmd_output);
+ }
+
+ dbi_destroy(iter);
+
+ } else if ( strcmpi(key,"setopt") == 0 ) {
+ const char* opt_str[3] = {
+ "None",
+ "JoinAnnounce",
+ "MessageDelay",
+ };
+
+ if( sub1[0] != '#' ) {
+ clif->message(fd, msg_txt(1405));// Channel name must start with a '#'
+ return false;
+ }
+
+ if( !(channel = strdb_get(clif->channel_db, sub1 + 1)) ) {
+ sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( channel->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
+ sprintf(atcmd_output, msg_txt(1412), sub1);// You're not the owner of channel '%s'
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+
+ if( sub2[0] == '\0' ) {
+ clif->message(fd, msg_txt(1446));// You need to input a option
+ return false;
+ }
+
+ for( k = 1; k < 3; k++ ) {
+ if( strcmpi(sub2,opt_str[k]) == 0 )
+ break;
+ }
+
+ if( k == 3 ) {
+ sprintf(atcmd_output, msg_txt(1447), sub2);// '%s' is not a known channel option
+ clif->message(fd, atcmd_output);
+ clif->message(fd, msg_txt(1448)); // -- Available options
+ for( k = 1; k < 3; k++ ) {
+ sprintf(atcmd_output, msg_txt(1444), opt_str[k]);// - '%s'
+ clif->message(fd, atcmd_output);
+ }
+ return false;
+ }
+
+ if( sub3[0] == '\0' ) {
+ if ( k == hChSys_OPT_MSG_DELAY ) {
+ sprintf(atcmd_output, msg_txt(1466), opt_str[k]);// For '%s' you need the amount of seconds (from 0 to 10)
+ clif->message(fd, atcmd_output);
+ return false;
+ } else if( channel->opt & k ) {
+ sprintf(atcmd_output, msg_txt(1449), opt_str[k],opt_str[k]); // option '%s' is already enabled, if you'd like to disable it type '@channel setopt %s 0'
+ clif->message(fd, atcmd_output);
+ return false;
+ } else {
+ channel->opt |= k;
+ sprintf(atcmd_output, msg_txt(1450), opt_str[k],channel->name);//option '%s' is now enabled for channel '%s'
+ clif->message(fd, atcmd_output);
+ return true;
+ }
+ } else {
+ int v = atoi(sub3);
+ if( k == hChSys_OPT_MSG_DELAY ) {
+ if( v < 0 || v > 10 ) {
+ sprintf(atcmd_output, msg_txt(1451), v, opt_str[k]);// value '%d' for option '%s' is out of range (limit is 0-10)
+ clif->message(fd, atcmd_output);
+ return false;
+ }
+ if( v == 0 ) {
+ channel->opt &=~ k;
+ channel->msg_delay = 0;
+ sprintf(atcmd_output, msg_txt(1453), opt_str[k],channel->name,v);// option '%s' is now disabled for channel '%s'
+ clif->message(fd, atcmd_output);
+ return true;
+ } else {
+ channel->opt |= k;
+ channel->msg_delay = v;
+ sprintf(atcmd_output, msg_txt(1452), opt_str[k],channel->name,v);// option '%s' is now enabled for channel '%s' with %d seconds
+ clif->message(fd, atcmd_output);
+ return true;
+ }
+ } else {
+ if( v ) {
+ if( channel->opt & k ) {
+ sprintf(atcmd_output, msg_txt(1449), opt_str[k],opt_str[k]); // option '%s' is already enabled, if you'd like to disable it type '@channel opt %s 0'
+ clif->message(fd, atcmd_output);
+ return false;
+ } else {
+ channel->opt |= k;
+ sprintf(atcmd_output, msg_txt(1454), opt_str[k],channel->name);//option '%s' is now enabled for channel '%s'
+ clif->message(fd, atcmd_output);
+ }
+ } else {
+ if( !(channel->opt & k) ) {
+ sprintf(atcmd_output, msg_txt(1454), opt_str[k],channel->name); // option '%s' is not enabled on channel '%s'
+ clif->message(fd, atcmd_output);
+ return false;
+ } else {
+ channel->opt &=~ k;
+ sprintf(atcmd_output, msg_txt(1453), opt_str[k],channel->name);// option '%s' is now disabled for channel '%s'
+ clif->message(fd, atcmd_output);
+ return true;
+ }
+ }
+ }
+
+ }
+
} else {
atcmd_channel_help(fd,command,( hChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ));
}
- return 0;
+ return true;
}
/* debug only, delete after */
-ACMD_FUNC(fontcolor) {
+ACMD(fontcolor) {
unsigned char k;
if( !message || !*message ) {
@@ -9099,13 +9340,13 @@ ACMD_FUNC(fontcolor) {
safestrncpy((char*)WFIFOP(fd,12), mout, msg_len);
WFIFOSET(fd, msg_len + 12);
}
- return -1;
+ return false;
}
if( message[0] == '0' ) {
sd->fontcolor = 0;
pc_disguise(sd,0);
- return 0;
+ return true;
}
for( k = 0; k < hChSys.colors_count; k++ ) {
@@ -9115,19 +9356,35 @@ ACMD_FUNC(fontcolor) {
if( k == hChSys.colors_count ) {
sprintf(atcmd_output, msg_txt(1411), message);// Unknown color '%s'
clif->message(fd, atcmd_output);
- return -1;
+ return false;
}
sd->fontcolor = k + 1;
pc_disguise(sd,sd->status.class_);
+
+ return true;
+}
+ACMD(searchstore){
+ int val = atoi(message);
+
+ switch( val ) {
+ case 0://EFFECTTYPE_NORMAL
+ case 1://EFFECTTYPE_CASH
+ break;
+ default:
+ val = 0;
+ break;
+ }
- return 0;
+ searchstore->open(sd, 99, val);
+
+ return true;
}
/**
* Fills the reference of available commands in atcommand DBMap
**/
-#define ACMD_DEF(x) { #x, atcommand_ ## x, NULL, NULL }
-#define ACMD_DEF2(x2, x) { x2, atcommand_ ## x, NULL, NULL }
+#define ACMD_DEF(x) { #x, atcommand_ ## x, NULL, NULL, NULL, true }
+#define ACMD_DEF2(x2, x) { x2, atcommand_ ## x, NULL, NULL, NULL, true }
void atcommand_basecommands(void) {
/**
* Command reference list, place the base of your commands here
@@ -9385,20 +9642,22 @@ void atcommand_basecommands(void) {
ACMD_DEF(mount2),
ACMD_DEF(join),
ACMD_DEF(channel),
- ACMD_DEF(fontcolor)
+ ACMD_DEF(fontcolor),
+ ACMD_DEF(searchstore),
};
- AtCommandInfo* atcommand;
+ AtCommandInfo* cmd;
int i;
for( i = 0; i < ARRAYLENGTH(atcommand_base); i++ ) {
- if(atcommand_exists(atcommand_base[i].command)) { // Should not happen if atcommand_base[] array is OK
+ if(atcommand->exists(atcommand_base[i].command)) { // Should not happen if atcommand_base[] array is OK
ShowDebug("atcommand_basecommands: duplicate ACMD_DEF for '%s'.\n", atcommand_base[i].command);
continue;
}
- CREATE(atcommand, AtCommandInfo, 1);
- safestrncpy(atcommand->command, atcommand_base[i].command, sizeof(atcommand->command));
- atcommand->func = atcommand_base[i].func;
- strdb_put(atcommand_db, atcommand->command, atcommand);
+ CREATE(cmd, AtCommandInfo, 1);
+ safestrncpy(cmd->command, atcommand_base[i].command, sizeof(cmd->command));
+ cmd->func = atcommand_base[i].func;
+ cmd->help = NULL;/* start as null dear */
+ strdb_put(atcommand_db, cmd->command, cmd);
}
return;
}
@@ -9406,9 +9665,8 @@ void atcommand_basecommands(void) {
/*==========================================
* Command lookup functions
*------------------------------------------*/
-bool atcommand_exists(const char* name)
-{
- return strdb_exists(atcommand_db, name);
+AtCommandInfo* atcommand_exists(const char* name) {
+ return strdb_get(atcommand_db, name);
}
static AtCommandInfo* get_atcommandinfo_byname(const char *name)
@@ -9427,12 +9685,12 @@ static const char* atcommand_checkalias(const char *aliasname)
}
/// AtCommand suggestion
-static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand) {
+static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool is_atcmd_cmd) {
DBIterator* atcommand_iter;
DBIterator* alias_iter;
AtCommandInfo* command_info = NULL;
AliasInfo* alias_info = NULL;
- AtCommandType type = atcommand ? COMMAND_ATCOMMAND : COMMAND_CHARCOMMAND;
+ AtCommandType type = is_atcmd_cmd ? COMMAND_ATCOMMAND : COMMAND_CHARCOMMAND;
char* full_match[MAX_SUGGESTIONS];
char* suggestions[MAX_SUGGESTIONS];
char* match;
@@ -9448,7 +9706,7 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
// Build the matches
for (command_info = dbi_first(atcommand_iter); dbi_exists(atcommand_iter); command_info = dbi_next(atcommand_iter)) {
match = strstr(command_info->command, name);
- can_use = pc_can_use_command(sd, command_info->command, type);
+ can_use = atcommand->can_use2(sd, command_info->command, type);
if ( prefix_count < MAX_SUGGESTIONS && match == command_info->command && can_use ) {
suggestions[prefix_count] = command_info->command;
++prefix_count;
@@ -9461,7 +9719,7 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
for (alias_info = dbi_first(alias_iter); dbi_exists(alias_iter); alias_info = dbi_next(alias_iter)) {
match = strstr(alias_info->alias, name);
- can_use = pc_can_use_command(sd, alias_info->command->command, type);
+ can_use = atcommand->can_use2(sd, alias_info->command->command,type);
if ( prefix_count < MAX_SUGGESTIONS && match == alias_info->alias && can_use) {
suggestions[prefix_count] = alias_info->alias;
++prefix_count;
@@ -9523,11 +9781,11 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
return true;
// skip 10/11-langtype's codepage indicator, if detected
- if ( message[0] == '|' && strlen(message) >= 4 && (message[3] == atcommand_symbol || message[3] == charcommand_symbol) )
+ if ( message[0] == '|' && strlen(message) >= 4 && (message[3] == atcommand->at_symbol || message[3] == atcommand->char_symbol) )
message += 3;
//Should display as a normal message
- if ( *message != atcommand_symbol && *message != charcommand_symbol )
+ if ( *message != atcommand->at_symbol && *message != atcommand->char_symbol )
return false;
// type value 0 = server invoked: bypass restrictions
@@ -9540,7 +9798,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
}
}
- if (*message == charcommand_symbol) {
+ if (*message == atcommand->char_symbol) {
do {
int x, y, z;
@@ -9578,12 +9836,12 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
return false;/* display as normal message */
}
- sprintf(output, msg_txt(1388), charcommand_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>).
+ sprintf(output, msg_txt(1388), atcommand->char_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>).
clif->message(fd, output);
return true;
} while(0);
}
- else if (*message == atcommand_symbol) {
+ else if (*message == atcommand->at_symbol) {
//atcmd_msg is constructed above differently for charcommands
//it's copied from message if not a charcommand so it can
//pass through the rest of the code compatible with both symbols
@@ -9599,27 +9857,31 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
params[0] = '\0';
// @commands (script based)
- if(type == 1 && atcmd_binding_count > 0) {
+ if(type == 1 && atcommand->binding_count > 0) {
struct atcmd_binding_data * binding;
- // Check if the command initiated is a character command
- if (*message == charcommand_symbol &&
- (ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) {
- sprintf(output, msg_txt(1389), command); // %s failed. Player not found.
- clif->message(fd, output);
- return true;
- }
-
// Get atcommand binding
- binding = get_atcommandbind_byname(command);
+ binding = atcommand->get_bind_byname(command);
// Check if the binding isn't NULL and there is a NPC event, level of usage met, et cetera
if( binding != NULL && binding->npc_event[0] &&
- ((*atcmd_msg == atcommand_symbol && pc_get_group_level(sd) >= binding->level) ||
- (*atcmd_msg == charcommand_symbol && pc_get_group_level(sd) >= binding->level2)))
+ ((*atcmd_msg == atcommand->at_symbol && pc_get_group_level(sd) >= binding->group_lv) ||
+ (*atcmd_msg == atcommand->char_symbol && pc_get_group_level(sd) >= binding->group_lv_char)))
{
// Check if self or character invoking; if self == character invoked, then self invoke.
- bool invokeFlag = ((*atcmd_msg == atcommand_symbol) ? 1 : 0);
+ bool invokeFlag = ((*atcmd_msg == atcommand->at_symbol) ? 1 : 0);
+
+ // Check if the command initiated is a character command
+ if (*message == atcommand->char_symbol &&
+ (ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) {
+ sprintf(output, msg_txt(1389), command); // %s failed. Player not found.
+ clif->message(fd, output);
+ return true;
+ }
+
+ if( binding->log ) /* log only if this command should be logged [Ind/Hercules] */
+ logs->atcommand(sd, atcmd_msg);
+
npc_do_atcmd_event((invokeFlag ? sd : ssd), command, params, binding->npc_event);
return true;
}
@@ -9631,7 +9893,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission
sprintf(output, msg_txt(153), command); // "%s is Unknown Command."
clif->message(fd, output);
- atcommand_get_suggestions(sd, command + 1, *message == atcommand_symbol);
+ atcommand_get_suggestions(sd, command + 1, *message == atcommand->at_symbol);
return true;
} else
return false;
@@ -9639,18 +9901,28 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
// type == 1 : player invoked
if (type == 1) {
- if ((*command == atcommand_symbol && info->at_groups[sd->group_pos] == 0) ||
- (*command == charcommand_symbol && info->char_groups[sd->group_pos] == 0) ) {
+ int i;
+ if ((*command == atcommand->at_symbol && info->at_groups[sd->group_pos] == 0) ||
+ (*command == atcommand->char_symbol && info->char_groups[sd->group_pos] == 0) ) {
return false;
}
if( pc_isdead(sd) && pc_has_permission(sd,PC_PERM_DISABLE_CMD_DEAD) ) {
clif->message(fd, msg_txt(1393)); // You can't use commands while dead
return true;
}
+ for(i = 0; i < map[sd->bl.m].zone->disabled_commands_count; i++) {
+ if( info->func == map[sd->bl.m].zone->disabled_commands[i]->cmd ) {
+ if( sd->group_level < map[sd->bl.m].zone->disabled_commands[i]->group_lv ) {
+ clif->colormes(sd->fd,COLOR_RED,"This command is disabled in this area");
+ return true;
+ } else
+ break;/* already found the matching command, no need to keep checking -- just go on */
+ }
+ }
}
-
+
// Check if target is valid only if confirmed that player can use command.
- if (*message == charcommand_symbol &&
+ if (*message == atcommand->char_symbol &&
(ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) {
sprintf(output, msg_txt(1389), command); // %s failed. Player not found.
clif->message(fd, output);
@@ -9658,18 +9930,14 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
}
//Attempt to use the command
- if ( (info->func(fd, (*atcmd_msg == atcommand_symbol) ? sd : ssd, command, params) != 0) )
- {
+ if ( (info->func(fd, (*atcmd_msg == atcommand->at_symbol) ? sd : ssd, command, params,info) != true) ) {
sprintf(output,msg_txt(154), command); // %s failed.
clif->message(fd, output);
return true;
}
- //Log only if successful.
- if ( *atcmd_msg == atcommand_symbol )
- log_atcommand(sd, atcmd_msg);
- else if ( *atcmd_msg == charcommand_symbol )
- log_atcommand(sd, message);
+ if( info->log ) /* log only if this command should be logged [Ind/Hercules] */
+ logs->atcommand(sd, *atcmd_msg == atcommand->at_symbol ? atcmd_msg : message);
return true;
}
@@ -9677,9 +9945,9 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
/*==========================================
*
*------------------------------------------*/
-static void atcommand_config_read(const char* config_filename)
-{
- config_setting_t *aliases = NULL, *help = NULL;
+static void atcommand_config_read(const char* config_filename) {
+ config_t atcommand_config;
+ config_setting_t *aliases = NULL, *help = NULL, *nolog = NULL;
const char *symbol = NULL;
int num_aliases = 0;
@@ -9692,8 +9960,8 @@ static void atcommand_config_read(const char* config_filename)
*symbol != '/' && // symbol of client commands
*symbol != '%' && // symbol of party chat
*symbol != '$' && // symbol of guild chat
- *symbol != charcommand_symbol)
- atcommand_symbol = *symbol;
+ *symbol != atcommand->char_symbol)
+ atcommand->at_symbol = *symbol;
}
if (config_lookup_string(&atcommand_config, "charcommand_symbol", &symbol)) {
@@ -9701,8 +9969,8 @@ static void atcommand_config_read(const char* config_filename)
*symbol != '/' && // symbol of client commands
*symbol != '%' && // symbol of party chat
*symbol != '$' && // symbol of guild chat
- *symbol != atcommand_symbol)
- charcommand_symbol = *symbol;
+ *symbol != atcommand->at_symbol)
+ atcommand->char_symbol = *symbol;
}
// Command aliases
@@ -9721,11 +9989,10 @@ static void atcommand_config_read(const char* config_filename)
if (config_setting_type(command) != CONFIG_TYPE_ARRAY)
continue;
commandname = config_setting_name(command);
- if (!atcommand_exists(commandname)) {
+ if ( !( commandinfo = atcommand_exists(commandname) ) ) {
ShowConfigWarning(command, "atcommand_config_read: can not set alias for non-existent command %s", commandname);
continue;
}
- commandinfo = get_atcommandinfo_byname(commandname);
alias_count = config_setting_length(command);
for (j = 0; j < alias_count; ++j) {
const char *alias = config_setting_get_string_elem(command, j);
@@ -9745,6 +10012,26 @@ static void atcommand_config_read(const char* config_filename)
}
}
+ nolog = config_lookup(&atcommand_config, "nolog");
+ if (nolog != NULL) {
+ int i = 0;
+ int count = config_setting_length(nolog);
+
+ for (i = 0; i < count; ++i) {
+ config_setting_t *command;
+ const char *commandname = NULL;
+ AtCommandInfo *commandinfo = NULL;
+
+ command = config_setting_get_elem(nolog, i);
+ commandname = config_setting_name(command);
+ if ( !( commandinfo = atcommand_exists(commandname) ) ) {
+ ShowConfigWarning(command, "atcommand_config_read: can not disable logging for non-existent command %s", commandname);
+ continue;
+ }
+ commandinfo->log = false;
+ }
+ }
+
// Commands help
// We only check if all commands exist
help = config_lookup(&atcommand_config, "help");
@@ -9755,15 +10042,26 @@ static void atcommand_config_read(const char* config_filename)
for (i = 0; i < count; ++i) {
config_setting_t *command;
const char *commandname;
+ AtCommandInfo *commandinfo = NULL;
command = config_setting_get_elem(help, i);
commandname = config_setting_name(command);
- if (!atcommand_exists(commandname))
+ if ( !( commandinfo = atcommand_exists(commandname) ) )
ShowConfigWarning(command, "atcommand_config_read: command %s does not exist", commandname);
+ else {
+ if( commandinfo->help == NULL ) {
+ const char *str = config_setting_get_string(command);
+ int len = strlen(str);
+ commandinfo->help = aMalloc( len * sizeof(char) );
+ safestrncpy(commandinfo->help, str, len);
+ }
+ }
}
}
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' command aliases in '"CL_WHITE"%s"CL_RESET"'.\n", num_aliases, config_filename);
+
+ config_destroy(&atcommand_config);
return;
}
void atcommand_db_load_groups(int* group_ids) {
@@ -9790,6 +10088,33 @@ void atcommand_db_load_groups(int* group_ids) {
return;
}
+bool atcommand_can_use(struct map_session_data *sd, const char *command) {
+ AtCommandInfo *info = get_atcommandinfo_byname(atcommand_checkalias(command + 1));
+
+ if (info == NULL)
+ return false;
+
+ if ((*command == atcommand->at_symbol && info->at_groups[sd->group_pos] != 0) ||
+ (*command == atcommand->char_symbol && info->char_groups[sd->group_pos] != 0) ) {
+ return true;
+ }
+
+ return false;
+}
+bool atcommand_can_use2(struct map_session_data *sd, const char *command, AtCommandType type) {
+ AtCommandInfo *info = get_atcommandinfo_byname(atcommand_checkalias(command));
+
+ if (info == NULL)
+ return false;
+
+ if ((type == COMMAND_ATCOMMAND && info->at_groups[sd->group_pos] != 0) ||
+ (type == COMMAND_CHARCOMMAND && info->char_groups[sd->group_pos] != 0) ) {
+ return true;
+ }
+
+ return false;
+}
+
void atcommand_db_clear(void) {
if (atcommand_db != NULL) {
@@ -9799,6 +10124,8 @@ void atcommand_db_clear(void) {
for (cmd = dbi_first(iter); dbi_exists(iter); cmd = dbi_next(iter)) {
aFree(cmd->at_groups);
aFree(cmd->char_groups);
+ if( cmd->help != NULL )
+ aFree(cmd->help);
}
dbi_destroy(iter);
@@ -9807,8 +10134,6 @@ void atcommand_db_clear(void) {
}
if (atcommand_alias_db != NULL)
db_destroy(atcommand_alias_db);
-
- config_destroy(&atcommand_config);
}
void atcommand_doload(void) {
@@ -9820,9 +10145,29 @@ void atcommand_doload(void) {
}
void do_init_atcommand(void) {
+ atcommand->at_symbol = '@';
+ atcommand->char_symbol = '#';
+ atcommand->binding_count = 0;
+
atcommand_doload();
}
void do_final_atcommand(void) {
atcommand_db_clear();
}
+
+void atcommand_defaults(void) {
+ atcommand = &atcommand_s;
+
+ atcommand->init = do_init_atcommand;
+ atcommand->final = do_final_atcommand;
+
+ atcommand->parse = is_atcommand;
+ atcommand->can_use = atcommand_can_use;
+ atcommand->can_use2 = atcommand_can_use2;
+ atcommand->load_groups = atcommand_db_load_groups;
+ atcommand->exists = atcommand_exists;
+ atcommand->msg_read = msg_config_read;
+ atcommand->final_msg = do_final_msg;
+ atcommand->get_bind_byname = get_atcommandbind_byname;
+}
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index 8affa4c26..cea59a416 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -1,51 +1,89 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _ATCOMMAND_H_
#define _ATCOMMAND_H_
+/**
+ * Declarations
+ **/
struct map_session_data;
+struct AtCommandInfo;
-//This is the distance at which @autoloot works,
-//if the item drops farther from the player than this,
-//it will not be autolooted. [Skotlex]
-//Note: The range is unlimited unless this define is set.
-//#define AUTOLOOT_DISTANCE AREA_SIZE
-
-extern char atcommand_symbol;
-extern char charcommand_symbol;
+/**
+ * Defines
+ **/
+#define ATCOMMAND_LENGTH 50
+#define MAX_MSG 1500
+/**
+ * Enumerations
+ **/
typedef enum {
COMMAND_ATCOMMAND = 1,
COMMAND_CHARCOMMAND = 2,
} AtCommandType;
-typedef int (*AtCommandFunc)(const int fd, struct map_session_data* sd, const char* command, const char* message);
-
-bool is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type);
-
-void do_init_atcommand(void);
-void do_final_atcommand(void);
-void atcommand_db_load_groups(int* group_ids);
+/**
+ * Typedef
+ **/
+typedef bool (*AtCommandFunc)(const int fd, struct map_session_data* sd, const char* command, const char* message,struct AtCommandInfo *info);
+typedef struct AtCommandInfo AtCommandInfo;
+typedef struct AliasInfo AliasInfo;
-bool atcommand_exists(const char* name);
-
-const char* msg_txt(int msg_number);
-int msg_config_read(const char* cfgName);
-void do_final_msg(void);
+/**
+ * Structures
+ **/
+struct AliasInfo {
+ AtCommandInfo *command;
+ char alias[ATCOMMAND_LENGTH];
+};
-extern int atcmd_binding_count;
+struct AtCommandInfo {
+ char command[ATCOMMAND_LENGTH];
+ AtCommandFunc func;
+ char *at_groups;/* quick @commands "can-use" lookup */
+ char *char_groups;/* quick @charcommands "can-use" lookup */
+ char *help;/* quick access to this @command's help string */
+ bool log;/* whether to log this command or not, regardless of group settings */
+};
-// @commands (script based)
struct atcmd_binding_data {
- char command[50];
- char npc_event[50];
- int level;
- int level2;
+ char command[ATCOMMAND_LENGTH];
+ char npc_event[ATCOMMAND_LENGTH];
+ int group_lv;
+ int group_lv_char;
+ bool log;
};
-struct atcmd_binding_data** atcmd_binding;
+/**
+ * Interface
+ **/
+struct atcommand_interface {
+ unsigned char at_symbol;
+ unsigned char char_symbol;
+ /* atcommand binding */
+ struct atcmd_binding_data** binding;
+ int binding_count;
+ /* */
+ void (*init) (void);
+ void (*final) (void);
+ /* */
+ bool (*parse) (const int fd, struct map_session_data* sd, const char* message, int type);
+ bool (*can_use) (struct map_session_data *sd, const char *command);
+ bool (*can_use2) (struct map_session_data *sd, const char *command, AtCommandType type);
+ void (*load_groups) (int* group_ids);
+ AtCommandInfo* (*exists) (const char* name);
+ int (*msg_read) (const char* cfgName);
+ void (*final_msg) (void);
+ /* atcommand binding */
+ struct atcmd_binding_data* (*get_bind_byname) (const char* name);
+} atcommand_s;
-struct atcmd_binding_data* get_atcommandbind_byname(const char* name);
+struct atcommand_interface *atcommand;
+
+const char* msg_txt(int msg_number);
+void atcommand_defaults(void);
#endif /* _ATCOMMAND_H_ */
diff --git a/src/map/battle.c b/src/map/battle.c
index d06e02f6c..372616f83 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -988,7 +988,6 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
status_change_end(bl,SC_VOICEOFSIREN,INVALID_TIMER);
}
-
//Finally damage reductions....
// Assumptio doubles the def & mdef on RE mode, otherwise gives a reduction on the final damage. [Igniz]
#ifndef RENEWAL
@@ -1039,7 +1038,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
#ifdef RENEWAL
if(sc->data[SC_ENERGYCOAT] && (flag&BF_WEAPON || flag&BF_MAGIC) && skill_id != WS_CARTTERMINATION)
#else
- if(sc->data[SC_ENERGYCOAT] && flag&BF_WEAPON && skill_id != WS_CARTTERMINATION)
+ if(sc->data[SC_ENERGYCOAT] && (flag&BF_WEAPON && skill_id != WS_CARTTERMINATION))
#endif
{
struct status_data *status = status_get_status_data(bl);
@@ -1143,7 +1142,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if( sc && sc->data[SC__SHADOWFORM] ) {
struct block_list *s_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2);
- if( !s_bl ) { // If the shadow form target is not present remove the sc.
+ if( !s_bl || s_bl->m != bl->m ) { // If the shadow form target is not present remove the sc.
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
} else if( status_isdead(s_bl) || !battle->check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both.
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
@@ -1833,7 +1832,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.div_ = skill->get_num(GS_CHAINACTION,skill_lv);
wd.type = 0x08;
}
- else if(sc && sc->data[SC_FEARBREEZE] && sd->weapontype1==W_BOW
+ else if(sc && sc->data[SC_FEARBREEZE] && sd->weapontype1==W_BOW
&& (i = sd->equip_index[EQI_AMMO]) >= 0 && sd->inventory_data[i] && sd->status.inventory[i].amount > 1){
int chance = rand()%100;
wd.type = 0x08;
@@ -1909,10 +1908,13 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if (rnd()%1000 < cri)
flag.cri = 1;
}
- if (flag.cri)
- {
+ if (flag.cri) {
wd.type = 0x0a;
+#ifdef RENEWAL
+ flag.hit = 1;
+#else
flag.idef = flag.idef2 = flag.hit = 1;
+#endif
} else { //Check for Perfect Hit
if(sd && sd->bonus.perfect_hit > 0 && rnd()%100 < sd->bonus.perfect_hit)
flag.hit = 1;
@@ -3041,7 +3043,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if( sc->data[SC_EDP] ){
switch(skill_id){
case AS_SPLASHER: case AS_VENOMKNIFE:
+#ifndef RENEWAL_EDP
case AS_GRIMTOOTH:
+#endif
break;
#ifndef RENEWAL_EDP
case ASC_BREAKER: case ASC_METEORASSAULT: break;
@@ -3372,9 +3376,26 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if(skill_id == CR_GRANDCROSS || skill_id == NPC_GRANDDARKNESS)
return wd; //Enough, rest is not needed.
-
- if (sd)
- {
+#ifndef HMAP_ZONE_DAMAGE_CAP_TYPE
+ if( src && skill_id ) {
+ for(i = 0; i < map[src->m].zone->capped_skills_count; i++) {
+ if( skill_id == map[src->m].zone->capped_skills[i]->nameid && (map[src->m].zone->capped_skills[i]->type & src->type) ) {
+ if( src->type == BL_MOB && map[src->m].zone->capped_skills[i]->subtype != MZS_NONE ) {
+ if( (((TBL_MOB*)src)->status.mode&MD_BOSS) && !(map[src->m].zone->disabled_skills[i]->subtype&MZS_BOSS) )
+ continue;
+ if( ((TBL_MOB*)src)->special_state.clone && !(map[src->m].zone->disabled_skills[i]->subtype&MZS_CLONE) )
+ continue;
+ }
+ if( wd.damage > map[src->m].zone->capped_skills[i]->cap )
+ wd.damage = map[src->m].zone->capped_skills[i]->cap;
+ if( wd.damage2 > map[src->m].zone->capped_skills[i]->cap )
+ wd.damage2 = map[src->m].zone->capped_skills[i]->cap;
+ break;
+ }
+ }
+ }
+#endif
+ if (sd) {
if (skill_id != CR_SHIELDBOOMERANG) //Only Shield boomerang doesn't takes the Star Crumbs bonus.
ATK_ADD2(wd.div_*sd->right_weapon.star, wd.div_*sd->left_weapon.star);
if (skill_id==MO_FINGEROFFENSIVE) { //The finger offensive spheres on moment of attack do count. [Skotlex]
@@ -3387,21 +3408,23 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.damage = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, 2, wd.flag);
if( flag.lh )
wd.damage2 = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage2, 3, wd.flag);
-
+#ifdef RENEWAL
+ if( flag.cri )
+ ATK_ADDRATE(sd->bonus.crit_atk_rate>=100?sd->bonus.crit_atk_rate-60:40);
+#endif
if( skill_id == CR_SHIELDBOOMERANG || skill_id == PA_SHIELDCHAIN )
{ //Refine bonus applies after cards and elements.
short index= sd->equip_index[EQI_HAND_L];
if( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_ARMOR )
ATK_ADD(10*sd->status.inventory[index].refine);
}
- } //if (sd)
+ }
//Card Fix, tsd side
- if(tsd)
+ if(tsd) //if player on player then it was already measured above
wd.damage = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, flag.lh, wd.flag);
- if( flag.infdef )
- { //Plants receive 1 damage when hit
+ if( flag.infdef ) { //Plants receive 1 damage when hit
short class_ = status_get_class(target);
if( flag.hit || wd.damage > 0 )
wd.damage = wd.div_; // In some cases, right hand no need to have a weapon to increase damage
@@ -4063,6 +4086,25 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
MATK_ADD(50);
}
}
+#ifndef HMAP_ZONE_DAMAGE_CAP_TYPE
+ if( src && skill_id ) {
+ for(i = 0; i < map[src->m].zone->capped_skills_count; i++) {
+ if( skill_id == map[src->m].zone->capped_skills[i]->nameid && (map[src->m].zone->capped_skills[i]->type & src->type) ) {
+ if( src->type == BL_MOB && map[src->m].zone->capped_skills[i]->subtype != MZS_NONE ) {
+ if( (((TBL_MOB*)src)->status.mode&MD_BOSS) && !(map[src->m].zone->disabled_skills[i]->subtype&MZS_BOSS) )
+ continue;
+ if( ((TBL_MOB*)src)->special_state.clone && !(map[src->m].zone->disabled_skills[i]->subtype&MZS_CLONE) )
+ continue;
+ }
+ if( ad.damage > map[src->m].zone->capped_skills[i]->cap )
+ ad.damage = map[src->m].zone->capped_skills[i]->cap;
+ if( ad.damage2 > map[src->m].zone->capped_skills[i]->cap )
+ ad.damage2 = map[src->m].zone->capped_skills[i]->cap;
+ break;
+ }
+ }
+ }
+#endif
#ifdef RENEWAL
ad.damage = battle->calc_cardfix(BF_MAGIC, src, target, nk, s_ele, 0, ad.damage, 0, ad.flag);
#endif
@@ -4446,8 +4488,26 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
md.dmg_lv=ATK_FLEE;
}
}
-
- md.damage = battle->calc_cardfix(BF_MISC, src, target, nk, s_ele, 0, md.damage, 0, md.flag);
+#ifndef HMAP_ZONE_DAMAGE_CAP_TYPE
+ if( src && skill_id ) {
+ for(i = 0; i < map[src->m].zone->capped_skills_count; i++) {
+ if( skill_id == map[src->m].zone->capped_skills[i]->nameid && (map[src->m].zone->capped_skills[i]->type & src->type) ) {
+ if( src->type == BL_MOB && map[src->m].zone->capped_skills[i]->subtype != MZS_NONE ) {
+ if( (((TBL_MOB*)src)->status.mode&MD_BOSS) && !(map[src->m].zone->disabled_skills[i]->subtype&MZS_BOSS) )
+ continue;
+ if( ((TBL_MOB*)src)->special_state.clone && !(map[src->m].zone->disabled_skills[i]->subtype&MZS_CLONE) )
+ continue;
+ }
+ if( md.damage > map[src->m].zone->capped_skills[i]->cap )
+ md.damage = map[src->m].zone->capped_skills[i]->cap;
+ if( md.damage2 > map[src->m].zone->capped_skills[i]->cap )
+ md.damage2 = map[src->m].zone->capped_skills[i]->cap;
+ break;
+ }
+ }
+ }
+#endif
+ md.damage = battle->calc_cardfix(BF_MISC, src, target, nk, s_ele, 0, md.damage, 0, md.flag);
if (sd && (i = pc_skillatk_bonus(sd, skill_id)))
md.damage += md.damage*i/100;
@@ -4522,6 +4582,28 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
memset(&d,0,sizeof(d));
break;
}
+
+#ifdef HMAP_ZONE_DAMAGE_CAP_TYPE
+ if( bl && skill_id ) {
+ int i;
+ for(i = 0; i < map[bl->m].zone->capped_skills_count; i++) {
+ if( skill_id == map[bl->m].zone->capped_skills[i]->nameid && (map[bl->m].zone->capped_skills[i]->type & bl->type) ) {
+ if( bl->type == BL_MOB && map[bl->m].zone->capped_skills[i]->subtype != MZS_NONE ) {
+ if( (((TBL_MOB*)bl)->status.mode&MD_BOSS) && !(map[bl->m].zone->disabled_skills[i]->subtype&MZS_BOSS) )
+ continue;
+ if( ((TBL_MOB*)bl)->special_state.clone && !(map[bl->m].zone->disabled_skills[i]->subtype&MZS_CLONE) )
+ continue;
+ }
+ if( d.damage > map[bl->m].zone->capped_skills[i]->cap )
+ d.damage = map[bl->m].zone->capped_skills[i]->cap;
+ if( d.damage2 > map[bl->m].zone->capped_skills[i]->cap )
+ d.damage2 = map[bl->m].zone->capped_skills[i]->cap;
+ break;
+ }
+ }
+ }
+#endif
+
if( d.damage + d.damage2 < 1 ) { //Miss/Absorbed
//Weapon attacks should go through to cause additional effects.
if (d.dmg_lv == ATK_DEF /*&& attack_type&(BF_MAGIC|BF_MISC)*/) // Isn't it that additional effects don't apply if miss?
@@ -5782,8 +5864,6 @@ static const struct _battle_data {
{ "status_cast_cancel", &battle_config.sc_castcancel, BL_NUL, BL_NUL, BL_ALL, },
{ "pc_status_def_rate", &battle_config.pc_sc_def_rate, 100, 0, INT_MAX, },
{ "mob_status_def_rate", &battle_config.mob_sc_def_rate, 100, 0, INT_MAX, },
- { "pc_luk_status_def", &battle_config.pc_luk_sc_def, 300, 1, INT_MAX, },
- { "mob_luk_status_def", &battle_config.mob_luk_sc_def, 300, 1, INT_MAX, },
{ "pc_max_status_def", &battle_config.pc_max_sc_def, 100, 0, INT_MAX, },
{ "mob_max_status_def", &battle_config.mob_max_sc_def, 100, 0, INT_MAX, },
{ "sg_miracle_skill_ratio", &battle_config.sg_miracle_skill_ratio, 1, 0, 10000, },
@@ -5869,7 +5949,7 @@ void Hercules_report(char* date, char *time_c) {
enum config_table {
C_CIRCULAR_AREA = 0x0001,
C_CELLNOSTACK = 0x0002,
- C_BETA_THREAD_TEST = 0x0004,
+ //C_BETA_THREAD_TEST = 0x0004, (free slot)
C_SCRIPT_CALLFUNC_CHECK = 0x0008,
C_OFFICIAL_WALKPATH = 0x0010,
C_RENEWAL = 0x0020,
@@ -5900,10 +5980,6 @@ void Hercules_report(char* date, char *time_c) {
config |= C_CELLNOSTACK;
#endif
-#ifdef BETA_THREAD_TEST
- config |= C_BETA_THREAD_TEST;
-#endif
-
#ifdef SCRIPT_CALLFUNC_CHECK
config |= C_SCRIPT_CALLFUNC_CHECK;
#endif
@@ -5940,15 +6016,15 @@ void Hercules_report(char* date, char *time_c) {
config |= C_RENEWAL_ASPD;
#endif
-/* not a ifdef because SECURE_NPCTIMEOUT is always defined, but either as 0 or higher */
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
config |= C_SECURE_NPCTIMEOUT;
#endif
+
/* non-define part */
if( db_use_sqldbs )
config |= C_SQL_DBS;
- if( log_config.sql_logs )
+ if( logs->config.sql_logs )
config |= C_SQL_LOGS;
#define BFLAG_LENGTH 35
@@ -6100,8 +6176,10 @@ int battle_config_read(const char* cfgName)
count--;
- if (count == 0)
+ if (count == 0) {
battle->config_adjust();
+ clif->bc_ready();
+ }
return 0;
}
@@ -6166,4 +6244,4 @@ void battle_defaults(void) {
battle->config_adjust = battle_adjust_conf;
battle->get_enemy_area = battle_getenemyarea;
battle->damage_area = battle_damage_area;
-} \ No newline at end of file
+}
diff --git a/src/map/battle.h b/src/map/battle.h
index 54f941de8..8b1f757f5 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -381,8 +381,6 @@ struct Battle_Config {
int sc_castcancel; // [Skotlex]
int pc_sc_def_rate; // [Skotlex]
int mob_sc_def_rate;
- int pc_luk_sc_def;
- int mob_luk_sc_def;
int pc_max_sc_def;
int mob_max_sc_def;
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index fb186917b..0b59e8f1e 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/cbasetypes.h"
#include "../common/db.h" // ARR_FIND
@@ -12,6 +13,7 @@
#include "clif.h" // clif->buyingstore_*
#include "log.h" // log_pick_pc, log_zeny
#include "pc.h" // struct map_session_data
+#include "chrif.h"
/// constants (client-side restrictions)
@@ -230,7 +232,7 @@ void buyingstore_open(struct map_session_data* sd, int account_id)
return;
}
- if( !searchstore_queryremote(sd, account_id) && ( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) )
+ if( !searchstore->queryremote(sd, account_id) && ( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) )
{// out of view range
return;
}
@@ -270,13 +272,13 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
return;
}
- if( !searchstore_queryremote(sd, account_id) && ( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) )
+ if( !searchstore->queryremote(sd, account_id) && ( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) )
{// out of view range
clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
return;
}
- searchstore_clearremote(sd);
+ searchstore->clearremote(sd);
if( pl_sd->status.zeny < pl_sd->buyingstore.zenylimit )
{// buyer lost zeny in the mean time? fix the limit
@@ -381,6 +383,11 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
clif->buyingstore_update_item(pl_sd, nameid, amount);
}
+ if( save_settings&128 ) {
+ chrif_save(sd, 0);
+ chrif_save(pl_sd, 0);
+ }
+
// check whether or not there is still something to buy
ARR_FIND( 0, pl_sd->buyingstore.slots, i, pl_sd->buyingstore.items[i].amount != 0 );
if( i == pl_sd->buyingstore.slots )
@@ -463,7 +470,7 @@ bool buyingstore_searchall(struct map_session_data* sd, const struct s_search_st
;
}
- if( !searchstore_result(s->search_sd, sd->buyer_id, sd->status.account_id, sd->message, it->nameid, it->amount, it->price, buyingstore_blankslots, 0) )
+ if( !searchstore->result(s->search_sd, sd->buyer_id, sd->status.account_id, sd->message, it->nameid, it->amount, it->price, buyingstore_blankslots, 0) )
{// result set full
return false;
}
@@ -471,3 +478,15 @@ bool buyingstore_searchall(struct map_session_data* sd, const struct s_search_st
return true;
}
+void buyingstore_defaults(void) {
+ buyingstore = &buyingstore_s;
+
+ buyingstore->setup = buyingstore_setup;
+ buyingstore->create = buyingstore_create;
+ buyingstore->close = buyingstore_close;
+ buyingstore->open = buyingstore_open;
+ buyingstore->trade = buyingstore_trade;
+ buyingstore->search = buyingstore_search;
+ buyingstore->searchall = buyingstore_searchall;
+
+}
diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h
index 0ed6e5457..a416317be 100644
--- a/src/map/buyingstore.h
+++ b/src/map/buyingstore.h
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _BUYINGSTORE_H_
#define _BUYINGSTORE_H_
@@ -8,26 +9,30 @@ struct s_search_store_search;
#define MAX_BUYINGSTORE_SLOTS 5
-struct s_buyingstore_item
-{
+struct s_buyingstore_item {
int price;
unsigned short amount;
unsigned short nameid;
};
-struct s_buyingstore
-{
+struct s_buyingstore {
struct s_buyingstore_item items[MAX_BUYINGSTORE_SLOTS];
int zenylimit;
unsigned char slots;
};
-bool buyingstore_setup(struct map_session_data* sd, unsigned char slots);
-void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const uint8* itemlist, unsigned int count);
-void buyingstore_close(struct map_session_data* sd);
-void buyingstore_open(struct map_session_data* sd, int account_id);
-void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int buyer_id, const uint8* itemlist, unsigned int count);
-bool buyingstore_search(struct map_session_data* sd, unsigned short nameid);
-bool buyingstore_searchall(struct map_session_data* sd, const struct s_search_store_search* s);
+struct buyingstore_interface {
+ bool (*setup) (struct map_session_data* sd, unsigned char slots);
+ void (*create) (struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const uint8* itemlist, unsigned int count);
+ void (*close) (struct map_session_data* sd);
+ void (*open) (struct map_session_data* sd, int account_id);
+ void (*trade) (struct map_session_data* sd, int account_id, unsigned int buyer_id, const uint8* itemlist, unsigned int count);
+ bool (*search) (struct map_session_data* sd, unsigned short nameid);
+ bool (*searchall) (struct map_session_data* sd, const struct s_search_store_search* s);
+} buyingstore_s;
+
+struct buyingstore_interface *buyingstore;
+
+void buyingstore_defaults (void);
#endif // _BUYINGSTORE_H_
diff --git a/src/map/chat.c b/src/map/chat.c
index f908e94ef..a18e87eef 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -96,15 +96,14 @@ int chat_createpcchat(struct map_session_data* sd, const char* title, const char
pc_stop_walking(sd,1);
cd = chat_createchat(&sd->bl, title, pass, limit, pub, 0, "", 0, 1, MAX_LEVEL);
- if( cd )
- {
+ if( cd ) {
cd->users = 1;
cd->usersd[0] = sd;
pc_setchatid(sd,cd->bl.id);
+ pc_stop_attack(sd);
clif->createchat(sd,0);
clif->dispchat(cd,0);
- }
- else
+ } else
clif->createchat(sd,1);
return 0;
diff --git a/src/map/clif.c b/src/map/clif.c
index 56fdb4193..7ada310e2 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -44,6 +44,8 @@
#include "clif.h"
#include "mail.h"
#include "quest.h"
+#include "packets_struct.h"
+#include "irc-bot.h"
#include <stdio.h>
#include <stdlib.h>
@@ -256,7 +258,7 @@ static inline unsigned char clif_bl_type(struct block_list *bl) {
int clif_send_sub(struct block_list *bl, va_list ap) {
struct block_list *src_bl;
struct map_session_data *sd;
- unsigned char *buf;
+ void *buf;
int len, type, fd;
nullpo_ret(bl);
@@ -266,7 +268,7 @@ int clif_send_sub(struct block_list *bl, va_list ap) {
if (!fd) //Don't send to disconnected clients.
return 0;
- buf = va_arg(ap,unsigned char*);
+ buf = va_arg(ap,void*);
len = va_arg(ap,int);
nullpo_ret(src_bl = va_arg(ap,struct block_list*));
type = va_arg(ap,int);
@@ -319,7 +321,7 @@ int clif_send_sub(struct block_list *bl, va_list ap) {
* Packet Delegation (called on all packets that require data to be sent to more than one client)
* functions that are sent solely to one use whose ID it posses use WFIFOSET
*------------------------------------------*/
-int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target type) {
+int clif_send(const void* buf, int len, struct block_list* bl, enum send_target type) {
int i;
struct map_session_data *sd, *tsd;
struct party_data *p = NULL;
@@ -555,29 +557,23 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
return 0;
}
-
/// Notifies the client, that it's connection attempt was accepted.
/// 0073 <start time>.L <position>.3B <x size>.B <y size>.B (ZC_ACCEPT_ENTER)
/// 02eb <start time>.L <position>.3B <x size>.B <y size>.B <font>.W (ZC_ACCEPT_ENTER2)
void clif_authok(struct map_session_data *sd)
{
-#if PACKETVER < 20080102
- const int cmd = 0x73;
-#else
- const int cmd = 0x2eb;
-#endif
- int fd = sd->fd;
-
- WFIFOHEAD(fd,packet_len(cmd));
- WFIFOW(fd, 0) = cmd;
- WFIFOL(fd, 2) = gettick();
- WFIFOPOS(fd, 6, sd->bl.x, sd->bl.y, sd->ud.dir);
- WFIFOB(fd, 9) = 5; // ignored
- WFIFOB(fd,10) = 5; // ignored
+ struct packet_authok p;
+
+ p.PacketType = authokType;
+ p.startTime = gettick();
+ WBUFPOS(&p.PosDir[0],0,sd->bl.x,sd->bl.y,sd->ud.dir); /* do the stupid client math */
+ p.xSize = p.ySize = 5; /* not-used */
+
#if PACKETVER >= 20080102
- WFIFOW(fd,11) = sd->user_font; // FIXME: Font is currently not saved.
+ p.font = sd->user_font; // FIXME: Font is currently not saved.
#endif
- WFIFOSET(fd,packet_len(cmd));
+
+ clif->send(&p,sizeof(p),&sd->bl,SELF);
}
@@ -666,27 +662,29 @@ void clif_charselectok(int id, uint8 ok)
/// Makes an item appear on the ground.
/// 009e <id>.L <name id>.W <identified>.B <x>.W <y>.W <subX>.B <subY>.B <amount>.W (ZC_ITEM_FALL_ENTRY)
/// 084b (ZC_ITEM_FALL_ENTRY4)
-void clif_dropflooritem(struct flooritem_data* fitem)
-{
- uint8 buf[17];
+void clif_dropflooritem(struct flooritem_data* fitem) {
+ struct packet_dropflooritem p;
int view;
nullpo_retv(fitem);
if (fitem->item_data.nameid <= 0)
return;
-
- WBUFW(buf, 0) = 0x9e;
- WBUFL(buf, 2) = fitem->bl.id;
- WBUFW(buf, 6) = ((view = itemdb_viewid(fitem->item_data.nameid)) > 0) ? view : fitem->item_data.nameid;
- WBUFB(buf, 8) = fitem->item_data.identify;
- WBUFW(buf, 9) = fitem->bl.x;
- WBUFW(buf,11) = fitem->bl.y;
- WBUFB(buf,13) = fitem->subx;
- WBUFB(buf,14) = fitem->suby;
- WBUFW(buf,15) = fitem->item_data.amount;
-
- clif->send(buf, packet_len(0x9e), &fitem->bl, AREA);
+
+ p.PacketType = dropflooritemType;
+ p.ITAID = fitem->bl.id;
+ p.ITID = ((view = itemdb_viewid(fitem->item_data.nameid)) > 0) ? view : fitem->item_data.nameid;
+#if PACKETVER >= 20130000 /* not sure date */
+ p.type = itemtype(itemdb_type(fitem->item_data.nameid));
+#endif
+ p.IsIdentified = fitem->item_data.identify;
+ p.xPos = fitem->bl.x;
+ p.yPos = fitem->bl.y;
+ p.subX = fitem->subx;
+ p.subY = fitem->suby;
+ p.count = fitem->item_data.amount;
+
+ clif->send(&p, sizeof(p), &fitem->bl, AREA);
}
@@ -836,12 +834,91 @@ static int clif_setlevel(struct block_list* bl) {
}
/*==========================================
- * Prepares 'unit standing/spawning' packet
+ * Prepares 'unit standing' packet
*------------------------------------------*/
-int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool spawn) {
+void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enum send_target target) {
struct map_session_data* sd;
struct status_change* sc = status_get_sc(bl);
struct view_data* vd = status_get_viewdata(bl);
+ struct packet_idle_unit p;
+ int g_id = status_get_emblem_id(bl);
+
+ sd = BL_CAST(BL_PC, bl);
+
+ p.PacketType = idle_unitType;
+#if PACKETVER >= 20091103
+ p.PacketLength = sizeof(p);
+ p.objecttype = clif_bl_type(bl);
+#endif
+ p.GID = bl->id;
+ p.speed = status_get_speed(bl);
+ p.bodypalette = (sc) ? sc->opt1 : 0;
+ p.healthState = (sc) ? sc->opt2 : 0;
+ p.effectState = (sc) ? sc->option : 0;
+ p.job = vd->class_;
+ p.head = vd->hair_style;
+ p.weapon = vd->weapon;
+ p.accessory = vd->head_bottom;
+#if PACKETVER < 7
+ p.shield = vd->shield;
+#endif
+ p.accessory2 = vd->head_top;
+ p.accessory3 = vd->head_mid;
+ if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ p.accessory = g_id;
+ p.accessory2 = GetWord(g_id, 1);
+ p.accessory3 = GetWord(g_id, 0);
+ }
+ p.headpalette = vd->hair_color;
+ p.bodypalette = vd->cloth_color;
+ p.headDir = (sd)? sd->head_dir : 0;
+#if PACKETVER >= 20101124
+ p.robe = vd->robe;
+#endif
+ p.GUID = g_id;
+ p.GEmblemVer = status_get_emblem_id(bl);
+ p.honor = (sd) ? sd->status.manner : 0;
+ p.virtue = (sc) ? sc->opt3 : 0;
+ p.isPKModeON = (sd) ? sd->status.karma : 0;
+ p.sex = vd->sex;
+ WBUFPOS(&p.PosDir[0],0,bl->x,bl->y,unit_getdir(bl));
+ p.xSize = p.ySize = (sd) ? 5 : 0;
+ p.state = vd->dead_sit;
+ p.clevel = clif_setlevel(bl);
+#if PACKETVER >= 20080102
+ p.font = (sd) ? sd->user_font : 0;
+#endif
+#if PACKETVER >= 20120712
+ if( bl->type == BL_MOB ) {
+ p.maxHP = status_get_max_hp(bl);
+ p.HP = status_get_hp(bl);
+ p.isBoss = ( ((TBL_MOB*)bl)->spawn && ((TBL_MOB*)bl)->spawn->state.boss ) ? 1 : 0;
+ } else {
+ p.maxHP = -1;
+ p.HP = -1;
+ p.isBoss = 0;
+ }
+#endif
+
+ clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target);
+
+ if( disguised(bl) ) {
+#if PACKETVER >= 20071106
+ p.objecttype = pcdb_checkid(status_get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.GID = -bl->id;
+#else
+ p.GID = -bl->id;
+#endif
+ clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,SELF);
+ }
+
+}
+/* todo for packetver 20091103 0x7c non-pc-looking unit handling */
+int clif_spawn_unit2(struct block_list* bl, enum send_target target) {
+ return 0;
+ /*struct map_session_data* sd;
+ struct status_change* sc = status_get_sc(bl);
+ struct view_data* vd = status_get_viewdata(bl);
unsigned char *buf = WBUFP(buffer,0);
#if PACKETVER < 20091103
bool type = !pcdb_checkid(vd->class_);
@@ -851,26 +928,26 @@ int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool spawn)
const char *name;
#endif
sd = BL_CAST(BL_PC, bl);
-
+
#if PACKETVER < 20091103
if(type)
- WBUFW(buf,0) = spawn?0x7c:0x78;
+ WBUFW(buf,0) = 0x7c;
else
#endif
#if PACKETVER < 4
- WBUFW(buf,0) = spawn?0x79:0x78;
+ WBUFW(buf,0) = 0x79;
#elif PACKETVER < 7
- WBUFW(buf,0) = spawn?0x1d9:0x1d8;
+ WBUFW(buf,0) = 0x1d9;
#elif PACKETVER < 20080102
- WBUFW(buf,0) = spawn?0x22b:0x22a;
+ WBUFW(buf,0) = 0x22b;
#elif PACKETVER < 20091103
- WBUFW(buf,0) = spawn?0x2ed:0x2ee;
+ WBUFW(buf,0) = 0x2ed;
#elif PACKETVER < 20101124
- WBUFW(buf,0) = spawn?0x7f8:0x7f9;
+ WBUFW(buf,0) = 0x7f8;
#else
- WBUFW(buf,0) = spawn?0x858:0x857;
+ WBUFW(buf,0) = 0x858;
#endif
-
+
#if PACKETVER >= 20091103
name = status_get_name(bl);
#if PACKETVER < 20110111
@@ -931,14 +1008,14 @@ int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool spawn)
#endif
WBUFW(buf,24) = vd->head_top;
WBUFW(buf,26) = vd->head_mid;
-
+
if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS )
{ //The hell, why flags work like this?
WBUFW(buf,22) = status_get_emblem_id(bl);
WBUFW(buf,24) = GetWord(status_get_guild_id(bl), 1);
WBUFW(buf,26) = GetWord(status_get_guild_id(bl), 0);
}
-
+
WBUFW(buf,28) = vd->hair_color;
WBUFW(buf,30) = vd->cloth_color;
WBUFW(buf,32) = (sd)? sd->head_dir : 0;
@@ -998,130 +1075,160 @@ int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool spawn)
#else
return packet_len(WBUFW(buffer,0));
#endif
+ */
}
-/*==========================================
- * Prepares 'unit walking' packet
- *------------------------------------------*/
-int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, unsigned char* buffer) {
+void clif_spawn_unit(struct block_list* bl, enum send_target target) {
struct map_session_data* sd;
struct status_change* sc = status_get_sc(bl);
struct view_data* vd = status_get_viewdata(bl);
- unsigned char* buf = WBUFP(buffer,0);
-#if PACKETVER >= 7
- unsigned short offset = 0;
-#endif
-#if PACKETVER >= 20091103
- const char *name;
-#endif
+ struct packet_spawn_unit p;
+ int g_id = status_get_emblem_id(bl);
sd = BL_CAST(BL_PC, bl);
-
-#if PACKETVER < 4
- WBUFW(buf, 0) = 0x7b;
-#elif PACKETVER < 7
- WBUFW(buf, 0) = 0x1da;
-#elif PACKETVER < 20080102
- WBUFW(buf, 0) = 0x22c;
-#elif PACKETVER < 20091103
- WBUFW(buf, 0) = 0x2ec;
-#elif PACKETVER < 20101124
- WBUFW(buf, 0) = 0x7f7;
-#else
- WBUFW(buf, 0) = 0x856;
-#endif
-
+
+ p.PacketType = spawn_unitType;
#if PACKETVER >= 20091103
- name = status_get_name(bl);
-#if PACKETVER < 20110111
- WBUFW(buf, 2) = 69+strlen(name);
-#else
- WBUFW(buf, 2) = 71+strlen(name);
+ p.PacketLength = sizeof(p);
+ p.objecttype = clif_bl_type(bl);
#endif
- offset+=2;
- buf = WBUFP(buffer,offset);
+ p.GID = bl->id;
+ p.speed = status_get_speed(bl);
+ p.bodypalette = (sc) ? sc->opt1 : 0;
+ p.healthState = (sc) ? sc->opt2 : 0;
+ p.effectState = (sc) ? sc->option : 0;
+ p.job = vd->class_;
+ p.head = vd->hair_style;
+ p.weapon = vd->weapon;
+ p.accessory = vd->head_bottom;
+#if PACKETVER < 7
+ p.shield = vd->shield;
#endif
-#if PACKETVER >= 20071106
- WBUFB(buf, 2) = clif_bl_type(bl);
- offset++;
- buf = WBUFP(buffer,offset);
+ p.accessory2 = vd->head_top;
+ p.accessory3 = vd->head_mid;
+ if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ p.accessory = g_id;
+ p.accessory2 = GetWord(g_id, 1);
+ p.accessory3 = GetWord(g_id, 0);
+ }
+ p.headpalette = vd->hair_color;
+ p.bodypalette = vd->cloth_color;
+ p.headDir = (sd)? sd->head_dir : 0;
+#if PACKETVER >= 20101124
+ p.robe = vd->robe;
#endif
- WBUFL(buf, 2) = bl->id;
- WBUFW(buf, 6) = status_get_speed(bl);
- WBUFW(buf, 8) = (sc)? sc->opt1 : 0;
- WBUFW(buf,10) = (sc)? sc->opt2 : 0;
-#if PACKETVER < 7
- WBUFW(buf,12) = (sc)? sc->option : 0;
-#else
- WBUFL(buf,12) = (sc)? sc->option : 0;
- offset+=2; //Shift the rest of elements by 2 bytes.
- buf = WBUFP(buffer,offset);
+ p.GUID = g_id;
+ p.GEmblemVer = status_get_emblem_id(bl);
+ p.honor = (sd) ? sd->status.manner : 0;
+ p.virtue = (sc) ? sc->opt3 : 0;
+ p.isPKModeON = (sd) ? sd->status.karma : 0;
+ p.sex = vd->sex;
+ WBUFPOS(&p.PosDir[0],0,bl->x,bl->y,unit_getdir(bl));
+ p.xSize = p.ySize = (sd) ? 5 : 0;
+ p.clevel = clif_setlevel(bl);
+#if PACKETVER >= 20080102
+ p.font = (sd) ? sd->user_font : 0;
#endif
- WBUFW(buf,14) = vd->class_;
- WBUFW(buf,16) = vd->hair_style;
- WBUFW(buf,18) = vd->weapon;
-#if PACKETVER < 4
- WBUFW(buf,20) = vd->head_bottom;
- WBUFL(buf,22) = gettick();
- WBUFW(buf,26) = vd->shield;
+#if PACKETVER >= 20120712
+ if( bl->type == BL_MOB ) {
+ p.maxHP = status_get_max_hp(bl);
+ p.HP = status_get_hp(bl);
+ p.isBoss = ( ((TBL_MOB*)bl)->spawn && ((TBL_MOB*)bl)->spawn->state.boss ) ? 1 : 0;
+ } else {
+ p.maxHP = -1;
+ p.HP = -1;
+ p.isBoss = 0;
+ }
+#endif
+ clif->send(&p,sizeof(p),bl,target);
+
+ if( disguised(bl) ) {
+#if PACKETVER >= 20071106
+ p.objecttype = pcdb_checkid(status_get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.GID = -bl->id;
#else
- WBUFW(buf,20) = vd->shield;
- WBUFW(buf,22) = vd->head_bottom;
- WBUFL(buf,24) = gettick();
+ p.GID = -bl->id;
#endif
- WBUFW(buf,28) = vd->head_top;
- WBUFW(buf,30) = vd->head_mid;
- WBUFW(buf,32) = vd->hair_color;
- WBUFW(buf,34) = vd->cloth_color;
- WBUFW(buf,36) = (sd)? sd->head_dir : 0;
-#if PACKETVER >= 20110111
- WBUFW(buf,38) = vd->robe;
- offset+= 2;
- buf = WBUFP(buffer,offset);
+ clif->send(&p,sizeof(p),bl,SELF);
+ }
+
+}
+
+/*==========================================
+ * Prepares 'unit walking' packet
+ *------------------------------------------*/
+void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, struct unit_data* ud, enum send_target target) {
+ struct map_session_data* sd;
+ struct status_change* sc = status_get_sc(bl);
+ struct view_data* vd = status_get_viewdata(bl);
+ struct packet_unit_walking p;
+ int g_id = status_get_emblem_id(bl);
+
+ sd = BL_CAST(BL_PC, bl);
+
+ p.PacketType = unit_walkingType;
+#if PACKETVER >= 20091103
+ p.PacketLength = sizeof(p);
+ p.objecttype = clif_bl_type(bl);
#endif
- WBUFL(buf,38) = status_get_guild_id(bl);
- WBUFW(buf,42) = status_get_emblem_id(bl);
- WBUFW(buf,44) = (sd)? sd->status.manner : 0;
+ p.GID = bl->id;
+ p.speed = status_get_speed(bl);
+ p.bodypalette = (sc) ? sc->opt1 : 0;
+ p.healthState = (sc) ? sc->opt2 : 0;
+ p.effectState = (sc) ? sc->option : 0;
+ p.job = vd->class_;
+ p.head = vd->hair_style;
+ p.weapon = vd->weapon;
+ p.accessory = vd->head_bottom;
+ p.moveStartTime = gettick();
#if PACKETVER < 7
- WBUFW(buf,46) = (sc)? sc->opt3 : 0;
-#else
- WBUFL(buf,46) = (sc)? sc->opt3 : 0;
- offset+=2; //Shift the rest of elements by 2 bytes.
- buf = WBUFP(buffer,offset);
+ p.shield = vd->shield;
+#endif
+ p.accessory2 = vd->head_top;
+ p.accessory3 = vd->head_mid;
+ p.headpalette = vd->hair_color;
+ p.bodypalette = vd->cloth_color;
+ p.headDir = (sd)? sd->head_dir : 0;
+#if PACKETVER >= 20101124
+ p.robe = vd->robe;
#endif
- WBUFB(buf,48) = (sd)? sd->status.karma : 0;
- WBUFB(buf,49) = vd->sex;
- WBUFPOS2(buf,50,bl->x,bl->y,ud->to_x,ud->to_y,8,8);
- WBUFB(buf,56) = (sd)? 5 : 0;
- WBUFB(buf,57) = (sd)? 5 : 0;
- WBUFW(buf,58) = clif_setlevel(bl);
+ p.GUID = g_id;
+ p.GEmblemVer = status_get_emblem_id(bl);
+ p.honor = (sd) ? sd->status.manner : 0;
+ p.virtue = (sc) ? sc->opt3 : 0;
+ p.isPKModeON = (sd) ? sd->status.karma : 0;
+ p.sex = vd->sex;
+ WBUFPOS2(&p.MoveData[0],0,bl->x,bl->y,ud->to_x,ud->to_y,8,8);
+ p.xSize = p.ySize = (sd) ? 5 : 0;
+ p.clevel = clif_setlevel(bl);
#if PACKETVER >= 20080102
- WBUFW(buf,60) = sd?sd->user_font:0;
+ p.font = (sd) ? sd->user_font : 0;
#endif
-#if PACKETVER >= 20091103
- memcpy((char*)WBUFP(buf,62), name, NAME_LENGTH);
- return WBUFW(buffer,2);
-#else
- return packet_len(WBUFW(buffer,0));
+#if PACKETVER >= 20120712
+ if( bl->type == BL_MOB ) {
+ p.maxHP = status_get_max_hp(bl);
+ p.HP = status_get_hp(bl);
+ p.isBoss = ( ((TBL_MOB*)bl)->spawn && ((TBL_MOB*)bl)->spawn->state.boss ) ? 1 : 0;
+ } else {
+ p.maxHP = -1;
+ p.HP = -1;
+ p.isBoss = 0;
+ }
#endif
-}
+
+ clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target);
-//Modifies the buffer for disguise characters and sends it to self.
-//Used for spawn/walk packets, where the ID offset changes for packetver >=9
-void clif_setdisguise(struct block_list *bl, unsigned char *buf,int len) {
-#if PACKETVER >= 20091103
- WBUFB(buf,4)= pcdb_checkid(status_get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
- WBUFL(buf,5)=-bl->id;
-#elif PACKETVER >= 20071106
- WBUFB(buf,2)= pcdb_checkid(status_get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
- WBUFL(buf,3)=-bl->id;
+ if( disguised(bl) ) {
+#if PACKETVER >= 20071106
+ p.objecttype = pcdb_checkid(status_get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.GID = -bl->id;
#else
- WBUFL(buf,2)=-bl->id;
-#endif
- clif->send(buf, len, bl, SELF);
+ p.GID = -bl->id;
+#endif
+ clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,SELF);
+ }
}
-
/// Changes sprite of an NPC object (ZC_NPCSPRITE_CHANGE).
/// 01b0 <id>.L <type>.B <value>.L
/// type:
@@ -1220,9 +1327,7 @@ void clif_weather(int16 m)
**/
int clif_spawn(struct block_list *bl)
{
- unsigned char buf[128];
struct view_data *vd;
- int len;
vd = status_get_viewdata(bl);
if( !vd || vd->class_ == INVISIBLE_CLASS )
@@ -1234,67 +1339,63 @@ int clif_spawn(struct block_list *bl)
if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->sc.option&OPTION_INVISIBLE))
return 0;
- len = clif->set_unit_idle(bl, buf,true);
- clif->send(buf, len, bl, AREA_WOS);
- if (disguised(bl))
- clif->setdisguise(bl, buf, len);
+ clif->spawn_unit(bl,AREA_WOS);
if (vd->cloth_color)
clif->refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
- switch (bl->type)
- {
- case BL_PC:
- {
- TBL_PC *sd = ((TBL_PC*)bl);
- int i;
- if (sd->spiritball > 0)
- clif->spiritball(&sd->bl);
- if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
- clif->specialeffect(bl,423,AREA);
- else if(sd->state.size==SZ_MEDIUM)
- clif->specialeffect(bl,421,AREA);
- if( sd->bg_id && map[sd->bl.m].flag.battleground )
- clif->sendbgemblem_area(sd);
- if( sd->sc.option&OPTION_MOUNTING ) {
- //New Mounts are not complaint to the original method, so we gotta tell this guy that he is mounting.
- clif->sc_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0);
+ switch (bl->type) {
+ case BL_PC:
+ {
+ TBL_PC *sd = ((TBL_PC*)bl);
+ int i;
+ if (sd->spiritball > 0)
+ clif->spiritball(&sd->bl);
+ if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
+ clif->specialeffect(bl,423,AREA);
+ else if(sd->state.size==SZ_MEDIUM)
+ clif->specialeffect(bl,421,AREA);
+ if( sd->bg_id && map[sd->bl.m].flag.battleground )
+ clif->sendbgemblem_area(sd);
+ if( sd->sc.option&OPTION_MOUNTING ) {
+ //New Mounts are not complaint to the original method, so we gotta tell this guy that he is mounting.
+ clif->sc_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0);
+ }
+ for(i = 1; i < 5; i++){
+ if( sd->talisman[i] > 0 )
+ clif->talisman(sd, i);
+ }
+ #ifdef NEW_CARTS
+ if( sd->sc.data[SC_PUSH_CART] )
+ clif->sc_notick(&sd->bl, SI_ON_PUSH_CART, 2, sd->sc.data[SC_PUSH_CART]->val1, 0, 0);
+ #endif
+ if (sd->status.robe)
+ clif->refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);
+ }
+ break;
+ case BL_MOB:
+ {
+ TBL_MOB *md = ((TBL_MOB*)bl);
+ if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
+ clif->specialeffect(&md->bl,423,AREA);
+ else if(md->special_state.size==SZ_MEDIUM)
+ clif->specialeffect(&md->bl,421,AREA);
}
- for(i = 1; i < 5; i++){
- if( sd->talisman[i] > 0 )
- clif->talisman(sd, i);
+ break;
+ case BL_NPC:
+ {
+ TBL_NPC *nd = ((TBL_NPC*)bl);
+ if( nd->size == SZ_BIG )
+ clif->specialeffect(&nd->bl,423,AREA);
+ else if( nd->size == SZ_MEDIUM )
+ clif->specialeffect(&nd->bl,421,AREA);
}
- #ifdef NEW_CARTS
- if( sd->sc.data[SC_PUSH_CART] )
- clif->sc_notick(&sd->bl, SI_ON_PUSH_CART, 2, sd->sc.data[SC_PUSH_CART]->val1, 0, 0);
- #endif
- if (sd->status.robe)
- clif->refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);
- }
- break;
- case BL_MOB:
- {
- TBL_MOB *md = ((TBL_MOB*)bl);
- if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
- clif->specialeffect(&md->bl,423,AREA);
- else if(md->special_state.size==SZ_MEDIUM)
- clif->specialeffect(&md->bl,421,AREA);
- }
- break;
- case BL_NPC:
- {
- TBL_NPC *nd = ((TBL_NPC*)bl);
- if( nd->size == SZ_BIG )
- clif->specialeffect(&nd->bl,423,AREA);
- else if( nd->size == SZ_MEDIUM )
- clif->specialeffect(&nd->bl,421,AREA);
- }
- break;
- case BL_PET:
- if (vd->head_bottom)
- clif->send_petdata(NULL, (TBL_PET*)bl, 3, vd->head_bottom); // needed to display pet equip properly
- break;
+ break;
+ case BL_PET:
+ if (vd->head_bottom)
+ clif->send_petdata(NULL, (TBL_PET*)bl, 3, vd->head_bottom); // needed to display pet equip properly
+ break;
}
return 0;
}
@@ -1464,13 +1565,8 @@ void clif_walkok(struct map_session_data *sd)
void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *ud) {
- uint8 buf[128];
- int len;
- len = clif->set_unit_walking(bl,ud,buf);
- clif->send(buf,len,bl,AREA_WOS);
- if (disguised(bl))
- clif->setdisguise(bl, buf, len);
+ clif->set_unit_walking(bl,NULL,ud,AREA_WOS);
if(vd->cloth_color)
clif->refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
@@ -1694,6 +1790,9 @@ void clif_hercules_chsys_create(struct hChSysCh *channel, char *name, char *pass
safestrncpy(channel->pass, pass, HCHSYS_NAME_LENGTH);
channel->opt = hChSys_OPT_BASE;
+ channel->banned = NULL;
+
+ channel->msg_delay = 0;
if( channel->type != hChSys_MAP && channel->type != hChSys_ALLY )
strdb_put(clif->channel_db, channel->name, channel);
@@ -2057,79 +2156,99 @@ void clif_addcards(unsigned char* buf, struct item* item) {
WBUFW(buf,6) = item->card[i];
}
+void clif_addcards2(unsigned short *cards, struct item* item) {
+ int i=0,j;
+ if( item == NULL ) { //Blank data
+ cards[0] = 0;
+ cards[1] = 0;
+ cards[2] = 0;
+ cards[3] = 0;
+ return;
+ }
+ if( item->card[0] == CARD0_PET ) { //pet eggs
+ cards[0] = 0;
+ cards[1] = 0;
+ cards[2] = 0;
+ cards[3] = item->card[3]; //Pet renamed flag.
+ return;
+ }
+ if( item->card[0] == CARD0_FORGE || item->card[0] == CARD0_CREATE ) { //Forged/created items
+ cards[0] = item->card[0];
+ cards[1] = item->card[1];
+ cards[2] = item->card[2];
+ cards[3] = item->card[3];
+ return;
+ }
+ //Client only receives four cards.. so randomly send them a set of cards. [Skotlex]
+ if( MAX_SLOTS > 4 && (j = itemdb_slot(item->nameid)) > 4 )
+ i = rnd()%(j-3); //eg: 6 slots, possible i values: 0->3, 1->4, 2->5 => i = rnd()%3;
+
+ //Normal items.
+ if( item->card[i] > 0 && (j=itemdb_viewid(item->card[i])) > 0 )
+ cards[0] = j;
+ else
+ cards[0] = item->card[i];
+
+ if( item->card[++i] > 0 && (j=itemdb_viewid(item->card[i])) > 0 )
+ cards[1] = j;
+ else
+ cards[1] = item->card[i];
+
+ if( item->card[++i] > 0 && (j=itemdb_viewid(item->card[i])) > 0 )
+ cards[2] = j;
+ else
+ cards[2] = item->card[i];
+
+ if( item->card[++i] > 0 && (j=itemdb_viewid(item->card[i])) > 0 )
+ cards[3] = j;
+ else
+ cards[3] = item->card[i];
+}
+
/// Notifies the client, about a received inventory item or the result of a pick-up request.
/// 00a0 <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B <result>.B (ZC_ITEM_PICKUP_ACK)
/// 029a <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B <result>.B <expire time>.L (ZC_ITEM_PICKUP_ACK2)
/// 02d4 <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B <result>.B <expire time>.L <bindOnEquipType>.W (ZC_ITEM_PICKUP_ACK3)
-void clif_additem(struct map_session_data *sd, int n, int amount, int fail)
-{
- int fd;
-#if PACKETVER < 20061218
- const int cmd = 0xa0;
-#elif PACKETVER < 20071002
- const int cmd = 0x29a;
-#else
- const int cmd = 0x2d4;
-#endif
+void clif_additem(struct map_session_data *sd, int n, int amount, int fail) {
+ struct packet_additem p;
nullpo_retv(sd);
- fd = sd->fd;
- if( !session_isActive(fd) ) //Sasuke-
+ if( !session_isActive(sd->fd) ) //Sasuke-
return;
- WFIFOHEAD(fd,packet_len(cmd));
if( fail )
- {
- WFIFOW(fd,0)=cmd;
- WFIFOW(fd,2)=n+2;
- WFIFOW(fd,4)=amount;
- WFIFOW(fd,6)=0;
- WFIFOB(fd,8)=0;
- WFIFOB(fd,9)=0;
- WFIFOB(fd,10)=0;
- WFIFOW(fd,11)=0;
- WFIFOW(fd,13)=0;
- WFIFOW(fd,15)=0;
- WFIFOW(fd,17)=0;
- WFIFOW(fd,19)=0;
- WFIFOB(fd,21)=0;
- WFIFOB(fd,22)=fail;
-#if PACKETVER >= 20061218
- WFIFOL(fd,23)=0;
-#endif
-#if PACKETVER >= 20071002
- WFIFOW(fd,27)=0; // unknown
-#endif
- }
- else
- {
+ memset(&p, 0, sizeof(p));
+
+ p.PacketType = additemType;
+ p.Index = n+2;
+ p.count = amount;
+
+ if( !fail ) {
if( n < 0 || n >= MAX_INVENTORY || sd->status.inventory[n].nameid <=0 || sd->inventory_data[n] == NULL )
return;
-
- WFIFOW(fd,0)=cmd;
- WFIFOW(fd,2)=n+2;
- WFIFOW(fd,4)=amount;
+
if (sd->inventory_data[n]->view_id > 0)
- WFIFOW(fd,6)=sd->inventory_data[n]->view_id;
+ p.nameid = sd->inventory_data[n]->view_id;
else
- WFIFOW(fd,6)=sd->status.inventory[n].nameid;
- WFIFOB(fd,8)=sd->status.inventory[n].identify;
- WFIFOB(fd,9)=sd->status.inventory[n].attribute;
- WFIFOB(fd,10)=sd->status.inventory[n].refine;
- clif->addcards(WFIFOP(fd,11), &sd->status.inventory[n]);
- WFIFOW(fd,19)=pc_equippoint(sd,n);
- WFIFOB(fd,21)=itemtype(sd->inventory_data[n]->type);
- WFIFOB(fd,22)=fail;
+ p.nameid = sd->status.inventory[n].nameid;
+
+ p.IsIdentified = sd->status.inventory[n].identify;
+ p.IsDamaged = sd->status.inventory[n].attribute;
+ p.refiningLevel =sd->status.inventory[n].refine;
+ clif->addcards2(&p.slot.card[0], &sd->status.inventory[n]);
+ p.location = pc_equippoint(sd,n);
+ p.type = itemtype(sd->inventory_data[n]->type);
#if PACKETVER >= 20061218
- WFIFOL(fd,23)=sd->status.inventory[n].expire_time;
+ p.HireExpireDate = sd->status.inventory[n].expire_time;
#endif
#if PACKETVER >= 20071002
- WFIFOW(fd,27)=0; // unknown
+ p.bindOnEquipType = 0; // unused
#endif
}
+ p.result = (unsigned char)fail;
- WFIFOSET(fd,packet_len(cmd));
+ clif->send(&p,sizeof(p),&sd->bl,SELF);
}
@@ -2588,10 +2707,12 @@ void read_channels_config(void) {
config_setting_t *colors;
int i,k;
const char *local_name, *ally_name,
- *local_color, *ally_color;
+ *local_color, *ally_color,
+ *irc_name, *irc_color;
int ally_enabled = 0, local_enabled = 0,
local_autojoin = 0, ally_autojoin = 0,
- allow_user_channel_creation = 0;
+ allow_user_channel_creation = 0,
+ irc_enabled = 0;
if( !config_setting_lookup_string(settings, "map_local_channel_name", &local_name) )
local_name = "map";
@@ -2601,13 +2722,66 @@ void read_channels_config(void) {
ally_name = "ally";
safestrncpy(hChSys.ally_name, ally_name, HCHSYS_NAME_LENGTH);
+ if( !config_setting_lookup_string(settings, "irc_channel_name", &irc_name) )
+ irc_name = "irc";
+ safestrncpy(hChSys.irc_name, irc_name, HCHSYS_NAME_LENGTH);
+
config_setting_lookup_bool(settings, "map_local_channel", &local_enabled);
config_setting_lookup_bool(settings, "ally_channel_enabled", &ally_enabled);
+ config_setting_lookup_bool(settings, "irc_channel_enabled", &irc_enabled);
if( local_enabled )
hChSys.local = true;
if( ally_enabled )
hChSys.ally = true;
+ if( irc_enabled )
+ hChSys.irc = true;
+
+ hChSys.irc_server[0] = hChSys.irc_channel[0] = hChSys.irc_nick[0] = hChSys.irc_nick_pw[0] = '\0';
+
+ if( hChSys.irc ) {
+ const char *irc_server, *irc_channel,
+ *irc_nick, *irc_nick_pw;
+ if( config_setting_lookup_string(settings, "irc_channel_network", &irc_server) ) {
+ if( !strstr(irc_server,":") ) {
+ hChSys.irc = false;
+ ShowWarning("channels.conf : network port wasn't found in 'irc_channel_network', disabling irc channel...\n");
+ } else {
+ unsigned char d = 0, dlen = strlen(irc_server);
+ char server[40];
+ for(d = 0; d < dlen; d++) {
+ if(irc_server[d] == ':') {
+ memcpy(server, irc_server, d);
+ safestrncpy(hChSys.irc_server, server, 40);
+ memcpy(server, &irc_server[d+1], dlen);
+ hChSys.irc_server_port = atoi(server);
+ break;
+ }
+ }
+ }
+ } else {
+ hChSys.irc = false;
+ ShowWarning("channels.conf : irc channel enabled but irc_channel_network wasn't found, disabling irc channel...\n");
+ }
+ if( config_setting_lookup_string(settings, "irc_channel_channel", &irc_channel) )
+ safestrncpy(hChSys.irc_channel, irc_channel, 20);
+ else {
+ hChSys.irc = false;
+ ShowWarning("channels.conf : irc channel enabled but irc_channel_channel wasn't found, disabling irc channel...\n");
+ }
+ if( config_setting_lookup_string(settings, "irc_channel_nick", &irc_nick) ) {
+ if( strcmpi(irc_nick,"Hercules_chSysBot") == 0 ) {
+ sprintf(hChSys.irc_nick, "Hercules_chSysBot%d",rand()%777);
+ } else
+ safestrncpy(hChSys.irc_nick, irc_nick, 30);
+ } else {
+ hChSys.irc = false;
+ ShowWarning("channels.conf : irc channel enabled but irc_channel_nick wasn't found, disabling irc channel...\n");
+ }
+ if( config_setting_lookup_string(settings, "irc_channel_nick_pw", &irc_nick_pw) )
+ safestrncpy(hChSys.irc_nick_pw, irc_nick_pw, 30);
+
+ }
config_setting_lookup_bool(settings, "map_local_channel_autojoin", &local_autojoin);
config_setting_lookup_bool(settings, "ally_channel_autojoin", &ally_autojoin);
@@ -2649,7 +2823,7 @@ void read_channels_config(void) {
if( k < hChSys.colors_count ) {
hChSys.local_color = k;
} else {
- ShowError("channels.conf: unknown color '%s' for channel 'map_local_channel_color', disabling '#%s'...\n",local_color,local_name);
+ ShowError("channels.conf: unknown color '%s' for 'map_local_channel_color', disabling '#%s'...\n",local_color,local_name);
hChSys.local = false;
}
@@ -2663,10 +2837,35 @@ void read_channels_config(void) {
if( k < hChSys.colors_count ) {
hChSys.ally_color = k;
} else {
- ShowError("channels.conf: unknown color '%s' for channel 'ally_channel_color', disabling '#%s'...\n",local_color,ally_name);
+ ShowError("channels.conf: unknown color '%s' for 'ally_channel_color', disabling '#%s'...\n",ally_color,ally_name);
hChSys.ally = false;
}
+ config_setting_lookup_string(settings, "irc_channel_color", &irc_color);
+
+ for (k = 0; k < hChSys.colors_count; k++) {
+ if( strcmpi(hChSys.colors_name[k],irc_color) == 0 )
+ break;
+ }
+
+ if( k < hChSys.colors_count ) {
+ hChSys.irc_color = k;
+ } else {
+ ShowError("channels.conf: unknown color '%s' for 'irc_channel_color', disabling '#%s'...\n",irc_color,irc_name);
+ hChSys.irc = false;
+ }
+
+ if( hChSys.irc ) {
+ struct hChSysCh *chd;
+ CREATE( chd, struct hChSysCh, 1 );
+
+ safestrncpy(chd->name, hChSys.irc_name, HCHSYS_NAME_LENGTH);
+ chd->type = hChSys_IRC;
+
+ clif->chsys_create(chd,NULL,NULL,hChSys.irc_color);
+ ircbot->channel = chd;
+ }
+
if( (channels = config_setting_get_member(settings, "default_channels")) != NULL ) {
int channel_count = config_setting_length(channels);
@@ -2684,7 +2883,7 @@ void read_channels_config(void) {
ShowError("channels.conf: unknown color '%s' for channel '%s', skipping channel...\n",color,name);
continue;
}
- if( strcmpi(name,hChSys.local_name) == 0 || strcmpi(name,hChSys.ally_name) == 0 || strdb_exists(clif->channel_db, name) ) {
+ if( strcmpi(name,hChSys.local_name) == 0 || strcmpi(name,hChSys.ally_name) == 0 || strcmpi(name,hChSys.irc_name) == 0 || strdb_exists(clif->channel_db, name) ) {
ShowError("channels.conf: duplicate channel '%s', skipping channel...\n",name);
continue;
@@ -3534,9 +3733,18 @@ void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok)
}
void clif_hercules_chsys_send(struct hChSysCh *channel, struct map_session_data *sd, char *msg) {
- char message[150];
- snprintf(message, 150, "[ #%s ] %s : %s",channel->name,sd->status.name, msg);
- clif->chsys_msg(channel,sd,message);
+ if( channel->msg_delay != 0 && DIFF_TICK(sd->hchsysch_tick + ( channel->msg_delay * 1000 ), gettick()) > 0 && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
+ clif->colormes(sd->fd,COLOR_RED,msg_txt(1455));
+ return;
+ } else {
+ char message[150];
+ snprintf(message, 150, "[ #%s ] %s : %s",channel->name,sd->status.name, msg);
+ clif->chsys_msg(channel,sd,message);
+ if( channel->type == hChSys_IRC )
+ ircbot->relay(sd->status.name,msg);
+ if( channel->msg_delay != 0 )
+ sd->hchsysch_tick = gettick();
+ }
}
/// Inform client whether chatroom creation was successful or not (ZC_ACK_CREATE_CHATROOM).
@@ -4115,10 +4323,8 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds
}
void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
- uint8 buf[128];
struct unit_data *ud;
struct view_data *vd;
- int len;
vd = status_get_viewdata(bl);
if (!vd || vd->class_ == INVISIBLE_CLASS)
@@ -4130,66 +4336,64 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->sc.option&OPTION_INVISIBLE))
return;
- ud = unit_bl2ud(bl);
- len = ( ud && ud->walktimer != INVALID_TIMER ) ? clif->set_unit_walking(bl,ud,buf) : clif->set_unit_idle(bl,buf,false);
- clif->send(buf,len,&sd->bl,SELF);
+ if ( ( ud = unit_bl2ud(bl) ) && ud->walktimer != INVALID_TIMER )
+ clif->set_unit_walking(bl,sd,ud,SELF);
+ else
+ clif->set_unit_idle(bl,sd,SELF);
if (vd->cloth_color)
clif->refreshlook(&sd->bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,SELF);
- switch (bl->type)
- {
- case BL_PC:
- {
- TBL_PC* tsd = (TBL_PC*)bl;
- clif->getareachar_pc(sd, tsd);
- if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris]
- clif->specialeffect_single(bl,423,sd->fd);
- else if(tsd->state.size==SZ_MEDIUM)
- clif->specialeffect_single(bl,421,sd->fd);
- if( tsd->bg_id && map[tsd->bl.m].flag.battleground )
- clif->sendbgemblem_single(sd->fd,tsd);
- if( tsd->sc.data[SC_CAMOUFLAGE] )
- clif->status_change(bl, SI_CAMOUFLAGE, 1, 0, 0, 0, 0);
- if ( tsd->status.robe )
- clif->refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF);
- }
- break;
- case BL_MER: // Devotion Effects
- if( ((TBL_MER*)bl)->devotion_flag )
- clif->devotion(bl, sd);
- break;
- case BL_NPC:
- {
- TBL_NPC* nd = (TBL_NPC*)bl;
- if( nd->chat_id )
- clif->dispchat((struct chat_data*)map_id2bl(nd->chat_id),sd->fd);
- if( nd->size == SZ_BIG )
- clif->specialeffect_single(bl,423,sd->fd);
- else if( nd->size == SZ_MEDIUM )
- clif->specialeffect_single(bl,421,sd->fd);
- }
- break;
- case BL_MOB:
- {
- TBL_MOB* md = (TBL_MOB*)bl;
- if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
- clif->specialeffect_single(bl,423,sd->fd);
- else if(md->special_state.size==SZ_MEDIUM)
- clif->specialeffect_single(bl,421,sd->fd);
-#if PACKETVER >= 20120404
- if( !(md->status.mode&MD_BOSS) ){
- int i;
- for(i = 0; i < DAMAGELOG_SIZE; i++)// must show hp bar to all char who already hit the mob.
- if( md->dmglog[i].id == sd->status.char_id )
- clif->monster_hp_bar(md, sd->fd);
+ switch (bl->type) {
+ case BL_PC:
+ {
+ TBL_PC* tsd = (TBL_PC*)bl;
+ clif->getareachar_pc(sd, tsd);
+ if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris]
+ clif->specialeffect_single(bl,423,sd->fd);
+ else if(tsd->state.size==SZ_MEDIUM)
+ clif->specialeffect_single(bl,421,sd->fd);
+ if( tsd->bg_id && map[tsd->bl.m].flag.battleground )
+ clif->sendbgemblem_single(sd->fd,tsd);
+ if( tsd->sc.data[SC_CAMOUFLAGE] )
+ clif->status_change(bl, SI_CAMOUFLAGE, 1, 0, 0, 0, 0);
+ if ( tsd->status.robe )
+ clif->refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF);
}
-#endif
- }
- break;
- case BL_PET:
- if (vd->head_bottom)
- clif->send_petdata(NULL, (TBL_PET*)bl, 3, vd->head_bottom); // needed to display pet equip properly
- break;
+ break;
+ case BL_MER: // Devotion Effects
+ if( ((TBL_MER*)bl)->devotion_flag )
+ clif->devotion(bl, sd);
+ break;
+ case BL_NPC:
+ {
+ TBL_NPC* nd = (TBL_NPC*)bl;
+ if( nd->chat_id )
+ clif->dispchat((struct chat_data*)map_id2bl(nd->chat_id),sd->fd);
+ if( nd->size == SZ_BIG )
+ clif->specialeffect_single(bl,423,sd->fd);
+ else if( nd->size == SZ_MEDIUM )
+ clif->specialeffect_single(bl,421,sd->fd);
+ }
+ break;
+ case BL_MOB:
+ {
+ TBL_MOB* md = (TBL_MOB*)bl;
+ if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
+ clif->specialeffect_single(bl,423,sd->fd);
+ else if(md->special_state.size==SZ_MEDIUM)
+ clif->specialeffect_single(bl,421,sd->fd);
+ /* only between 04-04 and 07-12 (afterwards its bundled on the other packet) */
+ #if PACKETVER >= 20120404
+ #if PACKETVER <= 20120712
+ clif->monster_hp_bar(md);
+ #endif
+ #endif
+ }
+ break;
+ case BL_PET:
+ if (vd->head_bottom)
+ clif->send_petdata(NULL, (TBL_PET*)bl, 3, vd->head_bottom); // needed to display pet equip properly
+ break;
}
}
@@ -5369,6 +5573,27 @@ void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id
}
}
+void clif_status_change_notick(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3) {
+ struct packet_sc_notick p;
+ struct map_session_data *sd;
+
+ nullpo_retv(bl);
+
+ if (!(status_type2relevant_bl_types(type)&bl->type)) // only send status changes that actually matter to the client
+ return;
+
+ if (type == SI_BLANK) //It shows nothing on the client...
+ return;
+
+ sd = BL_CAST(BL_PC, bl);
+
+ p.PacketType = sc_notickType;
+ p.index = type;
+ p.AID = bl->id;
+ p.state = (unsigned char)flag;
+
+ clif->send(&p,packet_len(p.PacketType), bl, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
+}
/// Notifies clients of a status change.
/// 0196 <index>.W <id>.L <state>.B (ZC_MSG_STATE_CHANGE) [used for ending status changes and starting them on non-pc units (when needed)]
@@ -5376,9 +5601,8 @@ void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id
/// 08ff <id>.L <index>.W <remain msec>.L { <val>.L }*3 (PACKETVER >= 20111108)
/// 0983 <index>.W <id>.L <state>.B <total msec>.L <remain msec>.L { <val>.L }*3 (PACKETVER >= 20120618)
/// 0984 <id>.L <index>.W <total msec>.L <remain msec>.L { <val>.L }*3 (PACKETVER >= 20120618)
-void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3)
-{
- unsigned char buf[32];
+void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3) {
+ struct packet_status_change p;
struct map_session_data *sd;
if (type == SI_BLANK) //It shows nothing on the client...
@@ -5386,46 +5610,26 @@ void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val
nullpo_retv(bl);
- sd = BL_CAST(BL_PC, bl);
-
if (!(status_type2relevant_bl_types(type)&bl->type)) // only send status changes that actually matter to the client
return;
+
+ sd = BL_CAST(BL_PC, bl);
+
+ p.PacketType = status_changeType;
+ p.index = type;
+ p.AID = bl->id;
+ p.state = (unsigned char)flag;
#if PACKETVER >= 20120618
- if(flag && battle_config.display_status_timers && sd)
- WBUFW(buf,0)=0x983;
- else
-#elif PACKETVER >= 20090121
- if(flag && battle_config.display_status_timers && sd)
- WBUFW(buf,0)=0x43f;
- else
+ p.Total = tick; /* at this stage remain and total are the same value I believe */
#endif
- WBUFW(buf,0)=0x196;
- WBUFW(buf,2)=type;
- WBUFL(buf,4)=bl->id;
- WBUFB(buf,8)=flag;
-#if PACKETVER >= 20120618
- WBUFL(buf,9)=tick;/* at this stage remain and total are the same value I believe */
- WBUFL(buf,13)=tick;
- if(flag && battle_config.display_status_timers && sd) {
- if (tick <= 0)
- tick = 9999; // this is indeed what official servers do
-
- WBUFL(buf,17) = val1;
- WBUFL(buf,21) = val2;
- WBUFL(buf,25) = val3;
- }
-#elif PACKETVER >= 20090121
- if(flag && battle_config.display_status_timers && sd) {
- if (tick <= 0)
- tick = 9999; // this is indeed what official servers do
-
- WBUFL(buf,9) = tick;
- WBUFL(buf,13) = val1;
- WBUFL(buf,17) = val2;
- WBUFL(buf,21) = val3;
- }
+#if PACKETVER >= 20090121
+ p.Left = tick;
+ p.val1 = val1;
+ p.val2 = val2;
+ p.val3 = val3;
#endif
- clif->send(buf,packet_len(WBUFW(buf,0)),bl, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
+
+ clif->send(&p,sizeof(p), bl, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
}
/// Send message (modified by [Yor]) (ZC_NOTIFY_PLAYERCHAT).
@@ -5570,7 +5774,7 @@ void clif_map_property(struct map_session_data* sd, enum map_property property)
int fd;
nullpo_retv(sd);
-
+
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x199));
WFIFOW(fd,0)=0x199;
@@ -5632,7 +5836,7 @@ void clif_map_property_mapall(int map, enum map_property property)
{
struct block_list bl;
unsigned char buf[16];
-
+
bl.id = 0;
bl.type = BL_NUL;
bl.m = map;
@@ -6113,7 +6317,7 @@ void clif_closevendingboard(struct block_list* bl, int fd)
/// Sends a list of items in a shop.
/// R 0133 <packet len>.W <owner id>.L { <price>.L <amount>.W <index>.W <type>.B <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }* (ZC_PC_PURCHASE_ITEMLIST_FROMMC)
/// R 0800 <packet len>.W <owner id>.L <unique id>.L { <price>.L <amount>.W <index>.W <type>.B <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }* (ZC_PC_PURCHASE_ITEMLIST_FROMMC2)
-void clif_vendinglist(struct map_session_data* sd, int id, struct s_vending* vending)
+void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_vending* vending)
{
int i,fd;
int count;
@@ -6349,7 +6553,7 @@ void clif_partyinvitationstate(struct map_session_data* sd)
WFIFOHEAD(fd, packet_len(0x2c9));
WFIFOW(fd, 0) = 0x2c9;
- WFIFOB(fd, 2) = 0; // not implemented
+ WFIFOB(fd, 2) = sd->status.allow_party ? 1 : 0;
WFIFOSET(fd, packet_len(0x2c9));
}
@@ -8181,16 +8385,16 @@ void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, sen
}
// Modification of clif_messagecolor to send colored messages to players to chat log only (doesn't display overhead)
/// 02c1 <packet len>.W <id>.L <color>.L <message>.?B
-int clif_colormes(struct map_session_data * sd, enum clif_colors color, const char* msg) {
+int clif_colormes(int fd, enum clif_colors color, const char* msg) {
unsigned short msg_len = strlen(msg) + 1;
- WFIFOHEAD(sd->fd,msg_len + 12);
- WFIFOW(sd->fd,0) = 0x2C1;
- WFIFOW(sd->fd,2) = msg_len + 12;
- WFIFOL(sd->fd,4) = 0;
- WFIFOL(sd->fd,8) = color_table[color];
- safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len);
- WFIFOSET(sd->fd, msg_len + 12);
+ WFIFOHEAD(fd,msg_len + 12);
+ WFIFOW(fd,0) = 0x2C1;
+ WFIFOW(fd,2) = msg_len + 12;
+ WFIFOL(fd,4) = 0;
+ WFIFOL(fd,8) = color_table[color];
+ safestrncpy((char*)WFIFOP(fd,12), msg, msg_len);
+ WFIFOSET(fd, msg_len + 12);
return 0;
}
@@ -8288,7 +8492,7 @@ void clif_refresh(struct map_session_data *sd)
clif->changed_dir(&sd->bl, SELF);
// unlike vending, resuming buyingstore crashes the client.
- buyingstore_close(sd);
+ buyingstore->close(sd);
mail_clear(sd);
@@ -8954,6 +9158,27 @@ void clif_hercules_chsys_msg(struct hChSysCh *channel, struct map_session_data *
dbi_destroy(iter);
}
+void clif_hercules_chsys_msg2(struct hChSysCh *channel, char *msg) {
+ DBIterator *iter = db_iterator(channel->users);
+ struct map_session_data *user;
+ unsigned char buf[210];
+ unsigned short msg_len = strlen(msg) + 1;
+
+ WBUFW(buf,0) = 0x2C1;
+ WBUFW(buf,2) = msg_len + 12;
+ WBUFL(buf,4) = 0;
+ WBUFL(buf,8) = hChSys.colors[channel->color];
+ safestrncpy((char*)WBUFP(buf,12), msg, msg_len);
+
+ for( user = dbi_first(iter); dbi_exists(iter); user = dbi_next(iter) ) {
+ WFIFOHEAD(user->fd,msg_len + 12);
+ memcpy(WFIFOP(user->fd,0), WBUFP(buf,0), msg_len + 12);
+ WFIFOSET(user->fd, msg_len + 12);
+ }
+
+ dbi_destroy(iter);
+}
+
// ------------
// clif_parse_*
// ------------
@@ -9037,12 +9262,17 @@ void clif_hercules_chsys_mjoin(struct map_session_data *sd) {
clif->chsys_create(map[sd->bl.m].channel,NULL,NULL,hChSys.local_color);
}
+
+ if( map[sd->bl.m].channel->banned && idb_exists(map[sd->bl.m].channel->banned, sd->status.account_id) ) {
+ return;
+ }
+
clif->chsys_join(map[sd->bl.m].channel,sd);
if( !( map[sd->bl.m].channel->opt & hChSys_OPT_ANNOUNCE_JOIN ) ) {
char mout[60];
sprintf(mout, msg_txt(1435),hChSys.local_name,map[sd->bl.m].name); // You're now in the '#%s' channel for '%s'
- clif->message(sd->fd, mout);
+ clif->colormes(sd->fd, COLOR_DEFAULT, mout);
}
}
@@ -9147,7 +9377,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if( map_flag_gvg(sd->bl.m) )
clif->map_property(sd, MAPPROPERTY_AGITZONE);
-
// info about nearby objects
// must use foreachinarea (CIRCULAR_AREA interferes with foreachinrange)
map_foreachinarea(clif->getareachar, sd->bl.m, sd->bl.x-AREA_SIZE, sd->bl.y-AREA_SIZE, sd->bl.x+AREA_SIZE, sd->bl.y+AREA_SIZE, BL_ALL, sd);
@@ -9305,6 +9534,8 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
mail_clear(sd);
+ clif->maptypeproperty2(&sd->bl,SELF);
+
/* Guild Aura Init */
if( sd->state.gmaster_flag ) {
guild_guildaura_refresh(sd,GD_LEADERSHIP,guild_checkskill(sd->state.gmaster_flag,GD_LEADERSHIP));
@@ -9587,7 +9818,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
if( !clif->process_message(sd, 0, &name, &namelen, &message, &messagelen) )
return;
- if( is_atcommand(fd, sd, message, 1) )
+ if( atcommand->parse(fd, sd, message, 1) )
return;
if( sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
@@ -9656,7 +9887,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
#endif
// Chat logging type 'O' / Global Chat
- log_chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
+ logs->chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
}
@@ -9670,8 +9901,8 @@ void clif_parse_MapMove(int fd, struct map_session_data *sd)
map_name = (char*)RFIFOP(fd,2);
map_name[MAP_NAME_LENGTH_EXT-1]='\0';
- sprintf(command, "%cmapmove %s %d %d", atcommand_symbol, map_name, RFIFOW(fd,18), RFIFOW(fd,20));
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%cmapmove %s %d %d", atcommand->at_symbol, map_name, RFIFOW(fd,18), RFIFOW(fd,20));
+ atcommand->parse(fd, sd, command, 1);
}
@@ -9901,6 +10132,74 @@ void clif_hercules_chsys_left(struct hChSysCh *channel, struct map_session_data
}
+void clif_hercules_chsys_quitg(struct map_session_data *sd) {
+ unsigned char i;
+ struct hChSysCh *channel = NULL;
+
+ for( i = 0; i < sd->channel_count; i++ ) {
+ if( (channel = sd->channels[i] ) != NULL && channel->type == hChSys_ALLY ) {
+ idb_remove(channel->users,sd->status.char_id);
+
+ if( channel == sd->gcbind )
+ sd->gcbind = NULL;
+
+ if( !db_size(channel->users) && channel->type == hChSys_PRIVATE ) {
+ clif->chsys_delete(channel);
+ } else if( !hChSys.closing && (channel->opt & hChSys_OPT_ANNOUNCE_JOIN) ) {
+ char message[60];
+ sprintf(message, "#%s '%s' left",channel->name,sd->status.name);
+ clif->chsys_msg(channel,sd,message);
+ }
+ sd->channels[i] = NULL;
+ }
+ }
+
+ if( i < sd->channel_count ) {
+ unsigned char cursor = 0;
+ for( i = 0; i < sd->channel_count; i++ ) {
+ if( sd->channels[i] == NULL )
+ continue;
+ if( cursor != i ) {
+ sd->channels[cursor] = sd->channels[i];
+ }
+ cursor++;
+ }
+ if ( !(sd->channel_count = cursor) ) {
+ aFree(sd->channels);
+ sd->channels = NULL;
+ }
+ }
+
+}
+
+
+void clif_hercules_chsys_quit(struct map_session_data *sd) {
+ unsigned char i;
+ struct hChSysCh *channel = NULL;
+
+ for( i = 0; i < sd->channel_count; i++ ) {
+ if( (channel = sd->channels[i] ) != NULL ) {
+ idb_remove(channel->users,sd->status.char_id);
+
+ if( channel == sd->gcbind )
+ sd->gcbind = NULL;
+
+ if( !db_size(channel->users) && channel->type == hChSys_PRIVATE ) {
+ clif->chsys_delete(channel);
+ } else if( !hChSys.closing && (channel->opt & hChSys_OPT_ANNOUNCE_JOIN) ) {
+ char message[60];
+ sprintf(message, "#%s '%s' left",channel->name,sd->status.name);
+ clif->chsys_msg(channel,sd,message);
+ }
+
+ }
+ }
+
+ sd->channel_count = 0;
+ aFree(sd->channels);
+ sd->channels = NULL;
+}
+
/// Request for an action.
/// 0089 <target id>.L <action>.B (CZ_REQUEST_ACT)
/// 0437 <target id>.L <action>.B (CZ_REQUEST_ACT2)
@@ -9960,7 +10259,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
if( !clif->process_message(sd, 1, &target, &namelen, &message, &messagelen) )
return;
- if ( is_atcommand(fd, sd, message, 1) )
+ if ( atcommand->parse(fd, sd, message, 1) )
return;
if (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT))
@@ -9974,7 +10273,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
}
// Chat logging type 'W' / Whisper
- log_chat(LOG_CHAT_WHISPER, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, target, message);
+ logs->chat(LOG_CHAT_WHISPER, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, target, message);
//-------------------------------------------------------//
// Lordalfa - Paperboy - To whisper NPC commands //
@@ -10038,7 +10337,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
}
if( k < sd->channel_count ) {
clif->chsys_send(channel,sd,message);
- } else if( channel->pass[0] == '\0' ) {
+ } else if( channel->pass[0] == '\0' && !(channel->banned && idb_exists(channel->banned, sd->status.account_id)) ) {
clif->chsys_join(channel,sd);
clif->chsys_send(channel,sd,message);
} else {
@@ -10104,8 +10403,8 @@ void clif_parse_Broadcast(int fd, struct map_session_data* sd) {
// as the length varies depending on the command used, just block unreasonably long strings
mes_len_check(msg, len, CHAT_SIZE_MAX);
- sprintf(command, "%ckami %s", atcommand_symbol, msg);
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%ckami %s", atcommand->at_symbol, msg);
+ atcommand->parse(fd, sd, command, 1);
}
@@ -10288,6 +10587,10 @@ void clif_hercules_chsys_delete(struct hChSysCh *channel) {
}
dbi_destroy(iter);
}
+ if( channel->banned ) {
+ db_destroy(channel->banned);
+ channel->banned = NULL;
+ }
db_destroy(channel->users);
if( channel->m ) {
map[channel->m].channel = NULL;
@@ -11172,13 +11475,13 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd)
uint8 select = RFIFOB(fd,6);
if( (select > sd->npc_menu && select != 0xff) || select == 0 ) {
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
if( sd->npc_idle_timer != INVALID_TIMER ) {
#endif
TBL_NPC* nd = map_id2nd(npc_id);
ShowWarning("Invalid menu selection on npc %d:'%s' - got %d, valid range is [%d..%d] (player AID:%d, CID:%d, name:'%s')!\n", npc_id, (nd)?nd->name:"invalid npc id", select, 1, sd->npc_menu, sd->bl.id, sd->status.char_id, sd->status.name);
clif->GM_kick(NULL,sd);
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
}
#endif
return;
@@ -11340,11 +11643,11 @@ void clif_parse_ResetChar(int fd, struct map_session_data *sd) {
char cmd[15];
if( RFIFOW(fd,2) )
- sprintf(cmd,"%cresetskill",atcommand_symbol);
+ sprintf(cmd,"%cresetskill",atcommand->at_symbol);
else
- sprintf(cmd,"%cresetstat",atcommand_symbol);
+ sprintf(cmd,"%cresetstat",atcommand->at_symbol);
- is_atcommand(fd, sd, cmd, 1);
+ atcommand->parse(fd, sd, cmd, 1);
}
@@ -11360,8 +11663,8 @@ void clif_parse_LocalBroadcast(int fd, struct map_session_data* sd)
// as the length varies depending on the command used, just block unreasonably long strings
mes_len_check(msg, len, CHAT_SIZE_MAX);
- sprintf(command, "%clkami %s", atcommand_symbol, msg);
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%clkami %s", atcommand->at_symbol, msg);
+ atcommand->parse(fd, sd, command, 1);
}
@@ -11675,7 +11978,7 @@ void clif_parse_PartyMessage(int fd, struct map_session_data* sd)
if( !clif->process_message(sd, 0, &name, &namelen, &message, &messagelen) )
return;
- if( is_atcommand(fd, sd, message, 1) )
+ if( atcommand->parse(fd, sd, message, 1) )
return;
if( sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
@@ -11876,7 +12179,7 @@ void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index)
/// 012e
void clif_parse_CloseVending(int fd, struct map_session_data* sd)
{
- vending_closevending(sd);
+ vending->close(sd);
}
@@ -11887,7 +12190,7 @@ void clif_parse_VendingListReq(int fd, struct map_session_data* sd)
if( sd->npc_id ) {// using an NPC
return;
}
- vending_vendinglistreq(sd,RFIFOL(fd,2));
+ vending->list(sd,RFIFOL(fd,2));
}
@@ -11899,7 +12202,7 @@ void clif_parse_PurchaseReq(int fd, struct map_session_data* sd)
int id = (int)RFIFOL(fd,4);
const uint8* data = (uint8*)RFIFOP(fd,8);
- vending_purchasereq(sd, id, sd->vended_id, data, len/4);
+ vending->purchase(sd, id, sd->vended_id, data, len/4);
// whether it fails or not, the buy window is closed
sd->vended_id = 0;
@@ -11915,7 +12218,7 @@ void clif_parse_PurchaseReq2(int fd, struct map_session_data* sd)
int uid = (int)RFIFOL(fd,8);
const uint8* data = (uint8*)RFIFOP(fd,12);
- vending_purchasereq(sd, aid, uid, data, len/4);
+ vending->purchase(sd, aid, uid, data, len/4);
// whether it fails or not, the buy window is closed
sd->vended_id = 0;
@@ -11952,7 +12255,7 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd)
if( message[0] == '\0' ) // invalid input
return;
- vending_openvending(sd, message, data, len/8);
+ vending->open(sd, message, data, len/8);
}
/// Guild creation request (CZ_REQ_MAKE_GUILD).
@@ -12195,7 +12498,7 @@ void clif_parse_GuildMessage(int fd, struct map_session_data* sd)
if( !clif->process_message(sd, 0, &name, &namelen, &message, &messagelen) )
return;
- if( is_atcommand(fd, sd, message, 1) )
+ if( atcommand->parse(fd, sd, message, 1) )
return;
if( sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
@@ -12409,8 +12712,8 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
case BL_PC:
{
char command[NAME_LENGTH+6];
- sprintf(command, "%ckick %s", atcommand_symbol, status_get_name(target));
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%ckick %s", atcommand->at_symbol, status_get_name(target));
+ atcommand->parse(fd, sd, command, 1);
}
break;
@@ -12420,12 +12723,12 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
case BL_MOB:
{
char command[100];
- if( !pc_can_use_command(sd, "killmonster", COMMAND_ATCOMMAND)) {
+ if( !pc_can_use_command(sd, "@killmonster")) {
clif->GM_kickack(sd, 0);
return;
}
sprintf(command, "/kick %s (%d)", status_get_name(target), status_get_class(target));
- log_atcommand(sd, command);
+ logs->atcommand(sd, command);
status_percent_damage(&sd->bl, target, 100, 0, true); // can invalidate 'target'
}
break;
@@ -12433,8 +12736,8 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
case BL_NPC:
{
char command[NAME_LENGTH+11];
- sprintf(command, "%cunloadnpc %s", atcommand_symbol, status_get_name(target));
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%cunloadnpc %s", atcommand->at_symbol, status_get_name(target));
+ atcommand->parse(fd, sd, command, 1);
}
break;
@@ -12449,8 +12752,8 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
/// 00ce
void clif_parse_GMKickAll(int fd, struct map_session_data* sd) {
char cmd[15];
- sprintf(cmd,"%ckickall",atcommand_symbol);
- is_atcommand(fd, sd, cmd, 1);
+ sprintf(cmd,"%ckickall",atcommand->at_symbol);
+ atcommand->parse(fd, sd, cmd, 1);
}
@@ -12469,8 +12772,8 @@ void clif_parse_GMShift(int fd, struct map_session_data *sd)
player_name = (char*)RFIFOP(fd,2);
player_name[NAME_LENGTH-1] = '\0';
- sprintf(command, "%cjumpto %s", atcommand_symbol, player_name);
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%cjumpto %s", atcommand->at_symbol, player_name);
+ atcommand->parse(fd, sd, command, 1);
}
@@ -12485,8 +12788,8 @@ void clif_parse_GMRemove2(int fd, struct map_session_data* sd)
account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
if( (pl_sd = map_id2sd(account_id)) != NULL ) {
char command[NAME_LENGTH+8];
- sprintf(command, "%cjumpto %s", atcommand_symbol, pl_sd->status.name);
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%cjumpto %s", atcommand->at_symbol, pl_sd->status.name);
+ atcommand->parse(fd, sd, command, 1);
}
}
@@ -12506,8 +12809,8 @@ void clif_parse_GMRecall(int fd, struct map_session_data *sd)
player_name = (char*)RFIFOP(fd,2);
player_name[NAME_LENGTH-1] = '\0';
- sprintf(command, "%crecall %s", atcommand_symbol, player_name);
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%crecall %s", atcommand->at_symbol, player_name);
+ atcommand->parse(fd, sd, command, 1);
}
@@ -12522,8 +12825,8 @@ void clif_parse_GMRecall2(int fd, struct map_session_data* sd)
account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
if( (pl_sd = map_id2sd(account_id)) != NULL ) {
char command[NAME_LENGTH+8];
- sprintf(command, "%crecall %s", atcommand_symbol, pl_sd->status.name);
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%crecall %s", atcommand->at_symbol, pl_sd->status.name);
+ atcommand->parse(fd, sd, command, 1);
}
}
@@ -12542,16 +12845,16 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd)
// FIXME: Should look for item first, then for monster.
// FIXME: /monster takes mob_db Sprite_Name as argument
if( mobdb_searchname(monster_item_name) ) {
- snprintf(command, sizeof(command)-1, "%cmonster %s", atcommand_symbol, monster_item_name);
- is_atcommand(fd, sd, command, 1);
+ snprintf(command, sizeof(command)-1, "%cmonster %s", atcommand->at_symbol, monster_item_name);
+ atcommand->parse(fd, sd, command, 1);
return;
}
// FIXME: Stackables have a quantity of 20.
// FIXME: Equips are supposed to be unidentified.
if( itemdb_searchname(monster_item_name) ) {
- snprintf(command, sizeof(command)-1, "%citem %s", atcommand_symbol, monster_item_name);
- is_atcommand(fd, sd, command, 1);
+ snprintf(command, sizeof(command)-1, "%citem %s", atcommand->at_symbol, monster_item_name);
+ atcommand->parse(fd, sd, command, 1);
return;
}
}
@@ -12564,9 +12867,9 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd)
void clif_parse_GMHide(int fd, struct map_session_data *sd) {
char cmd[6];
- sprintf(cmd,"%chide",atcommand_symbol);
+ sprintf(cmd,"%chide",atcommand->at_symbol);
- is_atcommand(fd, sd, cmd, 1);
+ atcommand->parse(fd, sd, cmd, 1);
}
@@ -12598,8 +12901,8 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd)
if( dstsd == NULL )
return;
- sprintf(command, "%cmute %d %s", atcommand_symbol, value, dstsd->status.name);
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%cmute %d %s", atcommand->at_symbol, value, dstsd->status.name);
+ atcommand->parse(fd, sd, command, 1);
}
@@ -12612,8 +12915,8 @@ void clif_parse_GMRc(int fd, struct map_session_data* sd)
char *name = (char*)RFIFOP(fd,2);
name[NAME_LENGTH-1] = '\0';
- sprintf(command, "%cmute %d %s", atcommand_symbol, 60, name);
- is_atcommand(fd, sd, command, 1);
+ sprintf(command, "%cmute %d %s", atcommand->at_symbol, 60, name);
+ atcommand->parse(fd, sd, command, 1);
}
@@ -14558,6 +14861,16 @@ void clif_parse_EquipTick(int fd, struct map_session_data* sd)
clif->equiptickack(sd, flag);
}
+/// Request to change party invitation tick.
+/// value:
+/// 0 = disabled
+/// 1 = enabled
+void clif_parse_PartyTick(int fd, struct map_session_data* sd)
+{
+ bool flag = RFIFOB(fd,6)?true:false;
+ sd->status.allow_party = flag;
+ clif->partytickack(sd, flag);
+}
/// Questlog System [Kevin] [Inkfish]
///
@@ -15040,7 +15353,7 @@ void clif_parse_BattleChat(int fd, struct map_session_data* sd)
if( !clif->process_message(sd, 0, &name, &namelen, &message, &messagelen) )
return;
- if( is_atcommand(fd, sd, message, 1) )
+ if( atcommand->parse(fd, sd, message, 1) )
return;
if( sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
@@ -15451,7 +15764,7 @@ void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) {
}
count = packet_len/blocksize;
- buyingstore_create(sd, zenylimit, result, storename, itemlist, count);
+ buyingstore->create(sd, zenylimit, result, storename, itemlist, count);
}
@@ -15526,7 +15839,7 @@ void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_sessi
/// Request to close own buying store (CZ_REQ_CLOSE_BUYING_STORE).
/// 0815
void clif_parse_ReqCloseBuyingStore(int fd, struct map_session_data* sd) {
- buyingstore_close(sd);
+ buyingstore->close(sd);
}
@@ -15560,7 +15873,7 @@ void clif_parse_ReqClickBuyingStore(int fd, struct map_session_data* sd)
account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
- buyingstore_open(sd, account_id);
+ buyingstore->open(sd, account_id);
}
@@ -15616,12 +15929,12 @@ void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
if( packet_len%blocksize )
{
- ShowError("clif_parse_ReqTradeBuyingStore: Unexpected item list size %u (account_id=%d, buyer_id=%d, block size=%u)\n", packet_len, sd->bl.id, account_id, blocksize);
+ ShowError("clif_parse_ReqTradeBuyingStore: Unexpected item list size %u (account_id=%d, buyer_id=%u, block size=%u)\n", packet_len, sd->bl.id, account_id, blocksize);
return;
}
count = packet_len/blocksize;
- buyingstore_trade(sd, account_id, buyer_id, itemlist, count);
+ buyingstore->trade(sd, account_id, buyer_id, itemlist, count);
}
@@ -15747,7 +16060,7 @@ void clif_parse_SearchStoreInfo(int fd, struct map_session_data* sd) {
return;
}
- searchstore_query(sd, type, min_price, max_price, (const unsigned short*)itemlist, item_count, (const unsigned short*)cardlist, card_count);
+ searchstore->query(sd, type, min_price, max_price, (const unsigned short*)itemlist, item_count, (const unsigned short*)cardlist, card_count);
}
@@ -15772,7 +16085,7 @@ void clif_search_store_info_ack(struct map_session_data* sd)
WFIFOW(fd,0) = 0x836;
WFIFOW(fd,2) = 7+(end-start)*blocksize;
WFIFOB(fd,4) = !sd->searchstore.pages;
- WFIFOB(fd,5) = searchstore_querynext(sd);
+ WFIFOB(fd,5) = searchstore->querynext(sd);
WFIFOB(fd,6) = (unsigned char)min(sd->searchstore.uses, UINT8_MAX);
for( i = start; i < end; i++ ) {
@@ -15824,7 +16137,7 @@ void clif_search_store_info_failed(struct map_session_data* sd, unsigned char re
/// 0838
void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data* sd)
{
- searchstore_next(sd);
+ searchstore->next(sd);
}
@@ -15851,7 +16164,7 @@ void clif_open_search_store_info(struct map_session_data* sd)
/// 083b
void clif_parse_CloseSearchStoreInfo(int fd, struct map_session_data* sd)
{
- searchstore_close(sd);
+ searchstore->close(sd);
}
@@ -15867,7 +16180,7 @@ void clif_parse_SearchStoreInfoListItemClick(int fd, struct map_session_data* sd
store_id = RFIFOL(fd,info->pos[1]);
nameid = RFIFOW(fd,info->pos[2]);
- searchstore_click(sd, account_id, store_id, nameid);
+ searchstore->click(sd, account_id, store_id, nameid);
}
@@ -16245,99 +16558,74 @@ void clif_parse_MoveItem(int fd, struct map_session_data *sd) {
}
/* [Ind/Hercules] */
void clif_cashshop_db(void) {
- FILE *fp;
- char line[254];
- int ln = 0;/* line num */
- char *str[3], *p;
- struct item_data * data;
- int val, type, j;
-
- for( j = 0; j < CASHSHOP_TAB_MAX; j++ ) {
- CREATE(clif->cs.data[j], struct hCSData *, 1);
- clif->cs.item_count[j] = 0;
+ config_t cashshop_conf;
+ config_setting_t *cashshop = NULL;
+ const char *config_filename = "db/cashshop_db.conf"; // FIXME hardcoded name
+ int i;
+ for( i = 0; i < CASHSHOP_TAB_MAX; i++ ) {
+ CREATE(clif->cs.data[i], struct hCSData *, 1);
+ clif->cs.item_count[i] = 0;
}
- if( (fp=fopen("db/cashshop_db.txt","r"))==NULL ){
- ShowError("can't read %s\n", "db/cashshop_db.txt");
+ if (conf_read_file(&cashshop_conf, config_filename)) {
+ ShowError("can't read %s\n", config_filename);
return;
}
- while(fgets(line, sizeof(line), fp)) {
- ln++;
- if( line[0]=='/' && line[1]=='/' )
- continue;
-
- memset(str,0,sizeof(str));
- data = NULL;
-
- for(j=0,p=line;j<3 && p;j++){
- str[j]=p;
- p=strchr(p,',');
- if(p) *p++=0;
- }
+ cashshop = config_lookup(&cashshop_conf, "cash_shop");
+
+ if (cashshop != NULL) {
+ config_setting_t *cats = config_setting_get_elem(cashshop, 0);
+ config_setting_t *cat;
+ int k, item_count_t = 0;
- if(str[0]==NULL)
- continue;
+ for(i = 0; i < CASHSHOP_TAB_MAX; i++) {
+ char entry_name[10];
+
+ sprintf(entry_name,"cat_%d",i);
+
+ if( (cat = config_setting_get_member(cats, entry_name)) != NULL ) {
+ int item_count = config_setting_length(cat);
- if ( j < 3 ) {
- if ( j > 1 )
- ShowWarning("cashshop_db: insufficient fields for entry at %s:%d\n", "db/cashshop_db.txt", ln);
- continue;
- }
- if( ISALPHA(str[0][0]) ) {
- if( strcmpi(str[0],"new") == 0 )
- type = CASHSHOP_TAB_NEW;
- else if( strcmpi(str[0],"popular") == 0 )
- type = CASHSHOP_TAB_POPULAR;
- else if( strcmpi(str[0],"limited") == 0 )
- type = CASHSHOP_TAB_LIMITED;
- else if( strcmpi(str[0],"rental") == 0 )
- type = CASHSHOP_TAB_RENTAL;
- else if( strcmpi(str[0],"permanent") == 0 )
- type = CASHSHOP_TAB_PERPETUITY;
- else if( strcmpi(str[0],"scroll") == 0 )
- type = CASHSHOP_TAB_BUFF;
- else if( strcmpi(str[0],"usable") == 0 )
- type = CASHSHOP_TAB_RECOVERY;
- else if( strcmpi(str[0],"other") == 0 )
- type = CASHSHOP_TAB_ETC;
- else {
- ShowWarning("cashshop_db: unknown type %s for entry at %s:%d\n", str[0], "db/cashshop_db.txt", ln);
- continue;
- }
- } else {
- type = atoi(str[0]);
- if( type < 0 || type > CASHSHOP_TAB_MAX ) {
- ShowWarning("cashshop_db: unknown type %d for entry at %s:%d\n", type, "db/cashshop_db.txt", ln);
- continue;
- }
- }
-
- if( ISALPHA(str[1][0]) ) {
- if( !( data = itemdb_searchname(str[1]) ) ) {
- ShowWarning("cashshop_db: unknown item name %s for entry at %s:%d\n", str[1], "db/cashshop_db.txt", ln);
- continue;
- }
- } else {
- if( !( data = itemdb_exists(atoi(str[1]))) ) {
- ShowWarning("cashshop_db: unknown item id %s for entry at %s:%d\n", str[1], "db/cashshop_db.txt", ln);
- continue;
+ for(k = 0; k < item_count; k++) {
+ config_setting_t *entry = config_setting_get_elem(cat,k);
+ const char *name = config_setting_name(entry);
+ int price = config_setting_get_int(entry);
+ struct item_data * data = NULL;
+
+ if( price < 1 ) {
+ ShowWarning("cashshop_db: unsupported price '%d' for entry named '%s' in category '%s'\n", price, name, entry_name);
+ continue;
+ }
+
+ if( name[0] == 'I' && name[1] == 'D' && strlen(name) <= 7 ) {
+ if( !( data = itemdb_exists(atoi(name+2))) ) {
+ ShowWarning("cashshop_db: unknown item id '%s' in category '%s'\n", name+2, entry_name);
+ continue;
+ }
+ } else {
+ if( !( data = itemdb_searchname(name) ) ) {
+ ShowWarning("cashshop_db: unknown item name '%s' in category '%s'\n", name, entry_name);
+ continue;
+ }
+ }
+
+
+ RECREATE(clif->cs.data[i], struct hCSData *, ++clif->cs.item_count[i]);
+ CREATE(clif->cs.data[i][ clif->cs.item_count[i] - 1 ], struct hCSData , 1);
+
+ clif->cs.data[i][ clif->cs.item_count[i] - 1 ]->id = data->nameid;
+ clif->cs.data[i][ clif->cs.item_count[i] - 1 ]->price = price;
+ item_count_t++;
+ }
+ } else {
+ ShowError("cashshop_db: category '%s' (%d) not found!!\n",entry_name,i);
}
}
- if( ( val = atoi(str[2]) ) < 1 ) {
- ShowWarning("cashshop_db: unsupported price '%d' for entry at %s:%d\n", val, "db/cashshop_db.txt", ln);
- continue;
- }
-
- RECREATE(clif->cs.data[type], struct hCSData *, ++clif->cs.item_count[type]);
- CREATE(clif->cs.data[type][ clif->cs.item_count[type] - 1 ], struct hCSData , 1);
-
- clif->cs.data[type][ clif->cs.item_count[type] - 1 ]->id = data->nameid;
- clif->cs.data[type][ clif->cs.item_count[type] - 1 ]->price = val;
-
+ ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", item_count_t, config_filename);
+ config_destroy(&cashshop_conf);
}
- fclose(fp);
}
/// Items that are in favorite tab of inventory (ZC_ITEM_FAVORITE).
/// 0900 <index>.W <favorite>.B
@@ -16362,17 +16650,15 @@ void clif_snap( struct block_list *bl, short x, short y ) {
clif->send(buf,packet_len(0x8d2),bl,AREA);
}
-void clif_monster_hp_bar( struct mob_data* md, int fd ) {
-#if PACKETVER >= 20120404
- WFIFOHEAD(fd,packet_len(0x977));
-
- WFIFOW(fd,0) = 0x977;
- WFIFOL(fd,2) = md->bl.id;
- WFIFOL(fd,6) = md->status.hp;
- WFIFOL(fd,10) = md->status.max_hp;
-
- WFIFOSET(fd,packet_len(0x977));
-#endif
+void clif_monster_hp_bar( struct mob_data* md ) {
+ struct packet_monster_hp p;
+
+ p.PacketType = monsterhpType;
+ p.GID = md->bl.id;
+ p.HP = md->status.hp;
+ p.MaxHP = md->status.max_hp;
+
+ clif->send(&p,sizeof(p),&md->bl,AREA_WOS);
}
/* [Ind/Hercules] placeholder for unsupported incoming packets (avoids server disconnecting client) */
void __attribute__ ((unused)) clif_parse_dull(int fd,struct map_session_data *sd) {
@@ -16382,13 +16668,13 @@ void __attribute__ ((unused)) clif_parse_dull(int fd,struct map_session_data *sd
void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) {
WFIFOHEAD(fd, 10);
WFIFOW(fd, 0) = 0x845;
- WFIFOL(fd, 2) = sd->cashPoints;/* kafra for now disabled until we know how to apply it */
- WFIFOL(fd, 6) = sd->cashPoints;
+ WFIFOL(fd, 2) = sd->cashPoints; //[Ryuuzaki] - switched positions to reflect proper values
+ WFIFOL(fd, 6) = sd->kafraPoints;
WFIFOSET(fd, 10);
}
void clif_parse_CashShopClose(int fd, struct map_session_data *sd) {
-
+ /* TODO apply some state tracking */
}
void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) {
@@ -16411,8 +16697,7 @@ void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) {
}
void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
unsigned short limit = RFIFOW(fd, 4), i, j;
-
- /* no idea what data is on 6-10 */
+ unsigned int kafra_pay = RFIFOL(fd, 6);// [Ryuuzaki] - These are free cash points (strangely #CASH = main cash curreny for us, confusing)
for(i = 0; i < limit; i++) {
int qty = RFIFOL(fd, 14 + ( i * 10 ));
@@ -16429,7 +16714,9 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
}
if( j < clif->cs.item_count[tab] ) {
struct item_data *data;
- if( sd->cashPoints < (clif->cs.data[tab][j]->price * qty) ) {
+ if( sd->kafraPoints < kafra_pay ) {
+ result = CSBR_SHORTTAGE_CASH;
+ } else if( (sd->cashPoints+kafra_pay) < (clif->cs.data[tab][j]->price * qty) ) {
result = CSBR_SHORTTAGE_CASH;
} else if ( !( data = itemdb_exists(clif->cs.data[tab][j]->id) ) ) {
result = CSBR_UNKONWN_ITEM;
@@ -16442,7 +16729,7 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
if (!itemdb_isstackable2(data))
get_count = 1;
- pc_paycash(sd, clif->cs.data[tab][j]->price * qty, 0);/* kafra point support is missing */
+ pc_paycash(sd, clif->cs.data[tab][j]->price * qty, kafra_pay);// [Ryuuzaki]
for (k = 0; k < qty; k += get_count) {
if (!pet_create_egg(sd, data->nameid)) {
memset(&item_tmp, 0, sizeof(item_tmp));
@@ -16471,7 +16758,7 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
}
if( result != CSBR_SUCCESS )
- pc_getcash(sd, clif->cs.data[tab][j]->price * get_count, 0);/* kafra point support is missing */
+ pc_getcash(sd, clif->cs.data[tab][j]->price * get_count,0);
}
}
}
@@ -16484,12 +16771,43 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
WFIFOL(fd, 2) = id;
WFIFOW(fd, 6) = result;/* result */
WFIFOL(fd, 8) = sd->cashPoints;/* current cash point */
- WFIFOL(fd, 12) = 0;/* no idea (kafra cash?) */
+ WFIFOL(fd, 12) = sd->kafraPoints;// [Ryuuzaki]
WFIFOSET(fd, 16);
}
}
+/* [Ind/Hercules] */
+void clif_maptypeproperty2(struct block_list *bl,enum send_target t) {
+#if PACKETVER >= 20130000 /* not entirely sure when this started */
+ struct packet_maptypeproperty2 p;
+
+ p.PacketType = maptypeproperty2Type;
+ p.type = 0x28;
+ p.flag.usecart = 1;
+ p.flag.party = 1;
+ p.flag.guild = 1;
+ p.flag.siege = map_flag_gvg2(bl->m) ? 1: 0;
+ p.flag.mineffect = 1;
+ p.flag.nolockon = 0;
+ p.flag.countpk = map[bl->m].flag.pvp ? 1 : 0;
+ p.flag.nopartyformation = 0;
+ p.flag.noitemconsumption = 0;
+ p.flag.summonstarmiracle = 0;
+ p.flag.bg = map[bl->m].flag.battleground ? 1 : 0;
+
+ clif->send(&p,sizeof(p),bl,t);
+#endif
+}
+
+void clif_partytickack(struct map_session_data* sd, bool flag) {
+
+ WFIFOHEAD(sd->fd, packet_len(0x2c9));
+ WFIFOW(sd->fd, 0) = 0x2c9;
+ WFIFOB(sd->fd, 2) = flag;
+ WFIFOSET(sd->fd, packet_len(0x2c9));
+}
+
/*==========================================
* Main client packet processing function
*------------------------------------------*/
@@ -16655,11 +16973,17 @@ void packetdb_loaddb(void) {
#include "packets.h" /* load structure data */
#undef packet
}
+void clif_bc_ready(void) {
+ if( battle_config.display_status_timers )
+ clif->status_change = clif_status_change;
+ else
+ clif->status_change = clif_status_change_notick;
+}
/*==========================================
*
*------------------------------------------*/
int do_init_clif(void) {
- const char* colors[COLOR_MAX] = { "0xFF0000" };
+ const char* colors[COLOR_MAX] = { "0xFF0000", "0x00ff00" };
int i;
/**
* Setup Color Table (saves unnecessary load of strtoul on every call)
@@ -16683,7 +17007,7 @@ int do_init_clif(void) {
clif->delay_clearunit_ers = ers_new(sizeof(struct block_list),"clif.c::delay_clearunit_ers",ERS_OPT_CLEAR);
clif->channel_db = stridb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, HCHSYS_NAME_LENGTH);
- hChSys.ally = hChSys.local = hChSys.ally_autojoin = hChSys.local_autojoin = false;
+ hChSys.ally = hChSys.local = hChSys.irc = hChSys.ally_autojoin = hChSys.local_autojoin = false;
clif->chann_config_read();
return 0;
@@ -16757,6 +17081,7 @@ void clif_defaults(void) {
clif->unequipitemack = clif_unequipitemack;
clif->useitemack = clif_useitemack;
clif->addcards = clif_addcards;
+ clif->addcards2 = clif_addcards2;
clif->item_sub = clif_item_sub;
clif->getareachar_item = clif_getareachar_item;
/* unit-related */
@@ -16778,7 +17103,7 @@ void clif_defaults(void) {
clif->skillunit_update = clif_skillunit_update;
clif->clearunit_delayed_sub = clif_clearunit_delayed_sub;
clif->set_unit_idle = clif_set_unit_idle;
- clif->setdisguise = clif_setdisguise;
+ clif->spawn_unit = clif_spawn_unit;
clif->set_unit_walking = clif_set_unit_walking;
clif->calc_walkdelay = clif_calc_walkdelay;
clif->getareachar_skillunit = clif_getareachar_skillunit;
@@ -16795,6 +17120,7 @@ void clif_defaults(void) {
clif->map_property_mapall = clif_map_property_mapall;
clif->bossmapinfo = clif_bossmapinfo;
clif->map_type = clif_map_type;
+ clif->maptypeproperty2 = clif_maptypeproperty2;
/* multi-map-server */
clif->changemapserver = clif_changemapserver;
/* npc-shop-related */
@@ -16868,6 +17194,7 @@ void clif_defaults(void) {
clif->hate_info = clif_hate_info;
clif->mission_info = clif_mission_info;
clif->feel_hate_reset = clif_feel_hate_reset;
+ clif->partytickack = clif_partytickack;
clif->equiptickack = clif_equiptickack;
clif->viewequip_ack = clif_viewequip_ack;
clif->viewequip_fail = clif_viewequip_fail;
@@ -17155,12 +17482,16 @@ void clif_defaults(void) {
clif->noask_sub = clif_noask_sub;
clif->chsys_create = clif_hercules_chsys_create;
clif->chsys_msg = clif_hercules_chsys_msg;
+ clif->chsys_msg2 = clif_hercules_chsys_msg2;
clif->chsys_send = clif_hercules_chsys_send;
clif->chsys_join = clif_hercules_chsys_join;
clif->chsys_left = clif_hercules_chsys_left;
clif->chsys_delete = clif_hercules_chsys_delete;
clif->chsys_mjoin = clif_hercules_chsys_mjoin;
+ clif->chsys_quit = clif_hercules_chsys_quit;
+ clif->chsys_quitg = clif_hercules_chsys_quitg;
clif->cashshop_load = clif_cashshop_db;
+ clif->bc_ready = clif_bc_ready;
/*------------------------
*- Parse Incoming Packet
*------------------------*/
@@ -17357,10 +17688,13 @@ void clif_defaults(void) {
clif->pDebug = clif_parse_debug;
clif->pSkillSelectMenu = clif_parse_SkillSelectMenu;
clif->pMoveItem = clif_parse_MoveItem;
- clif->pDull = clif_parse_dull;
/* RagExe Cash Shop [Ind/Hercules] */
clif->pCashShopOpen = clif_parse_CashShopOpen;
clif->pCashShopClose = clif_parse_CashShopClose;
clif->pCashShopSchedule = clif_parse_CashShopSchedule;
clif->pCashShopBuy = clif_parse_CashShopBuy;
+ /* */
+ clif->pPartyTick = clif_parse_PartyTick;
+ /* dull */
+ clif->pDull = clif_parse_dull;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index 90915e1c9..8c6a0628b 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -7,6 +7,7 @@
#include "../common/cbasetypes.h"
#include "../common/db.h"
+#include "../common/mmo.h"
#include <stdarg.h>
/**
@@ -322,13 +323,14 @@ enum clif_messages {
**/
enum clif_colors {
COLOR_RED,
-
+ COLOR_DEFAULT,
COLOR_MAX
};
enum hChSysChOpt {
- hChSys_OPT_BASE = 0,
- hChSys_OPT_ANNOUNCE_JOIN = 1,
+ hChSys_OPT_BASE = 0x0,
+ hChSys_OPT_ANNOUNCE_JOIN = 0x1,
+ hChSys_OPT_MSG_DELAY = 0x2,
};
enum hChSysChType {
@@ -336,6 +338,7 @@ enum hChSysChType {
hChSys_PRIVATE = 1,
hChSys_MAP = 2,
hChSys_ALLY = 3,
+ hChSys_IRC = 4,
};
enum CASH_SHOP_TABS {
@@ -375,23 +378,31 @@ struct {
unsigned long *colors;
char **colors_name;
unsigned char colors_count;
- bool local, ally;
+ bool local, ally, irc;
bool local_autojoin, ally_autojoin;
- char local_name[HCHSYS_NAME_LENGTH], ally_name[HCHSYS_NAME_LENGTH];
- unsigned char local_color, ally_color;
+ char local_name[HCHSYS_NAME_LENGTH], ally_name[HCHSYS_NAME_LENGTH], irc_name[HCHSYS_NAME_LENGTH];
+ unsigned char local_color, ally_color, irc_color;
bool closing;
bool allow_user_channel_creation;
+ char irc_server[40], irc_channel[20], irc_nick[30], irc_nick_pw[30];
+ unsigned short irc_server_port;
} hChSys;
+struct hChSysBanEntry {
+ char name[NAME_LENGTH];
+};
+
struct hChSysCh {
char name[HCHSYS_NAME_LENGTH];
char pass[HCHSYS_NAME_LENGTH];
unsigned char color;
DBMap *users;
+ DBMap *banned;
unsigned int opt;
unsigned int owner;
enum hChSysChType type;
uint16 m;
+ unsigned char msg_delay;
};
struct hCSData {
@@ -430,7 +441,7 @@ struct clif_interface {
void (*setbindip) (const char* ip);
void (*setport) (uint16 port);
uint32 (*refresh_ip) (void);
- int (*send) (const uint8* buf, int len, struct block_list* bl, enum send_target type);
+ int (*send) (const void* buf, int len, struct block_list* bl, enum send_target type);
int (*send_sub) (struct block_list *bl, va_list ap);
int (*parse) (int fd);
/* auth */
@@ -454,6 +465,7 @@ struct clif_interface {
void (*unequipitemack) (struct map_session_data *sd,int n,int pos,int ok);
void (*useitemack) (struct map_session_data *sd,int index,int amount,bool ok);
void (*addcards) (unsigned char* buf, struct item* item);
+ void (*addcards2) (unsigned short *cards, struct item* item);
void (*item_sub) (unsigned char *buf, int n, struct item *i, struct item_data *id, int equip);
void (*getareachar_item) (struct map_session_data* sd,struct flooritem_data* fitem);
void (*cashshop_load) (void);
@@ -475,9 +487,9 @@ struct clif_interface {
void (*skill_delunit) (struct skill_unit *unit);
void (*skillunit_update) (struct block_list* bl);
int (*clearunit_delayed_sub) (int tid, unsigned int tick, int id, intptr_t data);
- int (*set_unit_idle) (struct block_list* bl, unsigned char* buffer, bool spawn);
- void (*setdisguise) (struct block_list *bl, unsigned char *buf,int len);
- int (*set_unit_walking) (struct block_list* bl, struct unit_data* ud, unsigned char* buffer);
+ void (*set_unit_idle) (struct block_list* bl, struct map_session_data *tsd,enum send_target target);
+ void (*spawn_unit) (struct block_list* bl,enum send_target target);
+ void (*set_unit_walking) (struct block_list* bl, struct map_session_data *tsd,struct unit_data* ud, enum send_target target);
int (*calc_walkdelay) (struct block_list *bl,int delay, int type, int damage, int div_);
void (*getareachar_skillunit) (struct map_session_data *sd, struct skill_unit *unit);
void (*getareachar_unit) (struct map_session_data* sd,struct block_list *bl);
@@ -493,6 +505,7 @@ struct clif_interface {
void (*map_property_mapall) (int map, enum map_property property);
void (*bossmapinfo) (int fd, struct mob_data *md, short flag);
void (*map_type) (struct map_session_data* sd, enum map_type type);
+ void (*maptypeproperty2) (struct block_list *bl,enum send_target t);
/* multi-map-server */
void (*changemapserver) (struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);
/* npc-shop-related */
@@ -553,7 +566,7 @@ struct clif_interface {
void (*mvp_noitem) (struct map_session_data* sd);
void (*changed_dir) (struct block_list *bl, enum send_target target);
void (*charnameack) (int fd, struct block_list *bl);
- void (*monster_hp_bar) ( struct mob_data* md, int fd );
+ void (*monster_hp_bar) ( struct mob_data* md );
int (*hpmeter) (struct map_session_data *sd);
void (*hpmeter_single) (int fd, int id, unsigned int hp, unsigned int maxhp);
int (*hpmeter_sub) (struct block_list *bl, va_list ap);
@@ -566,6 +579,7 @@ struct clif_interface {
void (*hate_info) (struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type);
void (*mission_info) (struct map_session_data *sd, int mob_id, unsigned char progress);
void (*feel_hate_reset) (struct map_session_data *sd);
+ void (*partytickack) (struct map_session_data* sd, bool flag);
void (*equiptickack) (struct map_session_data* sd, int flag);
void (*viewequip_ack) (struct map_session_data* sd, struct map_session_data* tsd);
void (*viewequip_fail) (struct map_session_data* sd);
@@ -662,7 +676,7 @@ struct clif_interface {
void (*msgtable) (int fd, int line);
void (*msgtable_num) (int fd, int line, int num);
void (*message) (const int fd, const char* mes);
- int (*colormes) (struct map_session_data * sd, enum clif_colors color, const char* msg);
+ int (*colormes) (int fd, enum clif_colors color, const char* msg);
bool (*process_message) (struct map_session_data* sd, int format, char** name_, int* namelen_, char** message_, int* messagelen_);
void (*wisexin) (struct map_session_data *sd,int type,int flag);
void (*wisall) (struct map_session_data *sd,int type,int flag);
@@ -680,7 +694,7 @@ struct clif_interface {
void (*openvendingreq) (struct map_session_data* sd, int num);
void (*showvendingboard) (struct block_list* bl, const char* message, int fd);
void (*closevendingboard) (struct block_list* bl, int fd);
- void (*vendinglist) (struct map_session_data* sd, int id, struct s_vending* vending);
+ void (*vendinglist) (struct map_session_data* sd, unsigned int id, struct s_vending* vending);
void (*buyvending) (struct map_session_data* sd, int index, int amount, int fail);
void (*openvending) (struct map_session_data* sd, int id, struct s_vending* vending);
void (*vendingreport) (struct map_session_data* sd, int index, int amount);
@@ -853,11 +867,15 @@ struct clif_interface {
void (*noask_sub) (struct map_session_data *src, struct map_session_data *target, int type);
void (*chsys_create) (struct hChSysCh *channel, char *name, char *pass, unsigned char color);
void (*chsys_msg) (struct hChSysCh *channel, struct map_session_data *sd, char *msg);
+ void (*chsys_msg2) (struct hChSysCh *channel, char *msg);
void (*chsys_send) (struct hChSysCh *channel, struct map_session_data *sd, char *msg);
void (*chsys_join) (struct hChSysCh *channel, struct map_session_data *sd);
void (*chsys_left) (struct hChSysCh *channel, struct map_session_data *sd);
void (*chsys_delete) (struct hChSysCh *channel);
void (*chsys_mjoin) (struct map_session_data *sd);
+ void (*chsys_quit) (struct map_session_data *sd);
+ void (*chsys_quitg) (struct map_session_data *sd);
+ void (*bc_ready) (void);
/*------------------------
*- Parse Incoming Packet
*------------------------*/
@@ -1060,6 +1078,7 @@ struct clif_interface {
void (*pCashShopClose) (int fd, struct map_session_data *sd);
void (*pCashShopSchedule) (int fd, struct map_session_data *sd);
void (*pCashShopBuy) (int fd, struct map_session_data *sd);
+ void (*pPartyTick) (int fd, struct map_session_data *sd);
} clif_s;
struct clif_interface *clif;
diff --git a/src/map/duel.c b/src/map/duel.c
index 1c659bd33..7af427304 100644
--- a/src/map/duel.c
+++ b/src/map/duel.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/cbasetypes.h"
@@ -95,7 +96,7 @@ int duel_create(struct map_session_data* sd, const unsigned int maxpl)
clif->disp_onlyself(sd, output, strlen(output));
clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
- //clif->misceffect2(&sd->bl, 159);
+ clif->maptypeproperty2(&sd->bl,SELF);
return i;
}
@@ -141,6 +142,7 @@ void duel_leave(const unsigned int did, struct map_session_data* sd)
sd->duel_group = 0;
duel_savetime(sd);
clif->map_property(sd, MAPPROPERTY_NOTHING);
+ clif->maptypeproperty2(&sd->bl,SELF);
}
void duel_accept(const unsigned int did, struct map_session_data* sd)
@@ -157,7 +159,7 @@ void duel_accept(const unsigned int did, struct map_session_data* sd)
clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
- //clif->misceffect2(&sd->bl, 159);
+ clif->maptypeproperty2(&sd->bl,SELF);
}
void duel_reject(const unsigned int did, struct map_session_data* sd)
diff --git a/src/map/guild.c b/src/map/guild.c
index 9b128c4e1..cc9b3e812 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -549,6 +549,7 @@ int guild_recv_info(struct guild *sg) {
guild_block_skill(sd, 300000);
//Also set the guild master flag.
+ sd->guild = g;
sd->state.gmaster_flag = g;
clif->charnameupdate(sd); // [LuzZza]
clif->guild_masterormember(sd);
@@ -582,7 +583,7 @@ int guild_recv_info(struct guild *sg) {
sd = g->member[i].sd;
if( sd==NULL )
continue;
-
+ sd->guild = g;
if (before.guild_lv != g->guild_lv || bm != m ||
before.max_member != g->max_member) {
clif->guild_basicinfo(sd); //Submit basic information
@@ -754,12 +755,15 @@ void guild_member_joined(struct map_session_data *sd)
if( hChSys.ally && hChSys.ally_autojoin ) {
struct guild* sg = NULL;
- clif->chsys_join((struct hChSysCh*)g->channel,sd);
+ struct hChSysCh *channel = (struct hChSysCh*)g->channel;
+
+ if( !(channel->banned && idb_exists(channel->banned, sd->status.account_id) ) )
+ clif->chsys_join(channel,sd);
for (i = 0; i < MAX_GUILDALLIANCE; i++) {
if( g->alliance[i].guild_id && (sg = guild_search(g->alliance[i].guild_id) ) ) {
- clif->chsys_join((struct hChSysCh*)sg->channel,sd);
- break;
+ if( !(((struct hChSysCh*)sg->channel)->banned && idb_exists(((struct hChSysCh*)sg->channel)->banned, sd->status.account_id)))
+ clif->chsys_join((struct hChSysCh*)sg->channel,sd);
}
}
}
@@ -902,17 +906,13 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
clif->guild_memberlist(online_member_sd);
// update char, if online
- if(sd != NULL && sd->status.guild_id == guild_id)
- {
+ if(sd != NULL && sd->status.guild_id == guild_id) {
// do stuff that needs the guild_id first, BEFORE we wipe it
if (sd->state.storage_flag == 2) //Close the guild storage.
storage_guild_storageclose(sd);
guild_send_dot_remove(sd);
if( hChSys.ally ) {
- for (i = 0; i < sd->channel_count; i++) {
- if( sd->channels[i] && sd->channels[i]->type == hChSys_ALLY )
- clif->chsys_left(sd->channels[i],sd);
- }
+ clif->chsys_quitg(sd);
}
sd->status.guild_id = 0;
sd->guild = NULL;
@@ -1033,7 +1033,7 @@ int guild_send_message(struct map_session_data *sd,const char *mes,int len)
guild_recv_message(sd->status.guild_id,sd->status.account_id,mes,len);
// Chat logging type 'G' / Guild Chat
- log_chat(LOG_CHAT_GUILD, sd->status.guild_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes);
+ logs->chat(LOG_CHAT_GUILD, sd->status.guild_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes);
return 0;
}
@@ -1955,8 +1955,8 @@ int guild_castledatasave(int castle_id, int index, int value)
void guild_castle_reconnect_sub(void *key, void *data, va_list ap)
{
- int castle_id = GetWord((int)__64BPRTSIZE(key), 0);
- int index = GetWord((int)__64BPRTSIZE(key), 1);
+ int castle_id = GetWord((int)__64BPTRSIZE(key), 0);
+ int index = GetWord((int)__64BPTRSIZE(key), 1);
intif_guild_castle_datasave(castle_id, index, *(int *)data);
aFree(data);
}
@@ -1977,7 +1977,7 @@ void guild_castle_reconnect(int castle_id, int index, int value)
int *data;
CREATE(data, int, 1);
*data = value;
- linkdb_replace(&gc_save_pending, (void*)__64BPRTSIZE((MakeDWord(castle_id, index))), data);
+ linkdb_replace(&gc_save_pending, (void*)__64BPTRSIZE((MakeDWord(castle_id, index))), data);
}
}
diff --git a/src/map/intif.c b/src/map/intif.c
index 73b828f00..102dbf84e 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -207,7 +207,7 @@ int intif_main_message(struct map_session_data* sd, const char* message)
intif_broadcast2( output, strlen(output) + 1, 0xFE000000, 0, 0, 0, 0 );
// log the chat message
- log_chat( LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message );
+ logs->chat( LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message );
return 0;
}
diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c
new file mode 100644
index 000000000..3e7d7eb06
--- /dev/null
+++ b/src/map/irc-bot.c
@@ -0,0 +1,272 @@
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Base Author: shennetsind @ http://hercules.ws
+
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/strlib.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/random.h"
+
+#include "map.h"
+#include "pc.h"
+#include "clif.h"
+#include "irc-bot.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+char send_string[200];
+
+int irc_connect_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ if( ircbot->fd != -1 || session[ircbot->fd] || ++ircbot->fails >= 3 )
+ return 0;
+
+ ircbot->last_try = gettick();
+ if( ( ircbot->fd = make_connection(ircbot->ip,hChSys.irc_server_port,true) ) > 0 ){
+ session[ircbot->fd]->func_parse = ircbot->parse;
+ session[ircbot->fd]->flag.server = 1;
+ add_timer(gettick() + 3000, ircbot->identify_timer, 0, 0);
+ }
+ return 0;
+}
+
+int irc_identify_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ if( ircbot->fd == -1 )
+ return 0;
+
+ sprintf(send_string, "USER HerculesWS%d 8 * : Hercules IRC Bridge",rand()%777);
+ ircbot->send(send_string);
+ sprintf(send_string, "NICK %s", hChSys.irc_nick);
+ ircbot->send(send_string);
+
+ add_timer(gettick() + 3000, ircbot->join_timer, 0, 0);
+
+ return 0;
+}
+
+int irc_join_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ if( ircbot->fd == -1 )
+ return 0;
+
+ if( hChSys.irc_nick_pw[0] != '\0' ) {
+ sprintf(send_string, "PRIVMSG NICKSERV : IDENTIFY %s", hChSys.irc_nick_pw);
+ ircbot->send(send_string);
+ }
+
+ sprintf(send_string, "JOIN %s", hChSys.irc_channel);
+ ircbot->send(send_string);
+ ircbot->isIn = true;
+
+ return 0;
+}
+
+struct irc_func* irc_func_search(char* function_name) {
+ int i;
+ for(i = 0; i < ircbot->funcs.size; i++) {
+ if( strcmpi(ircbot->funcs.list[i]->name, function_name) == 0 ) {
+ return ircbot->funcs.list[i];
+ }
+ }
+ return NULL;
+}
+
+int irc_parse(int fd) {
+ char *parse_string = NULL, *str_safe = NULL;
+
+ if (session[fd]->flag.eof) {
+ do_close(fd);
+ ircbot->fd = -1;
+ ircbot->isIn = false;
+ ircbot->fails = 0;
+ ircbot->ip = host2ip(hChSys.irc_server);
+ add_timer(gettick() + 120000, ircbot->connect_timer, 0, 0);
+ return 0;
+ }
+
+ if( !RFIFOREST(fd) )
+ return 0;
+
+ parse_string = (char*)RFIFOP(fd,0);
+ parse_string[ RFIFOREST(fd) - 1 ] = '\0';
+
+ parse_string = strtok_r(parse_string,"\r\n",&str_safe);
+
+ while (parse_string != NULL) {
+ ircbot->parse_sub(fd,parse_string);
+ parse_string = strtok_r(NULL,"\r\n",&str_safe);
+ }
+
+ RFIFOSKIP(fd, RFIFOREST(fd));
+ RFIFOFLUSH(fd);
+ return 0;
+}
+
+void irc_parse_source(char *source, char *nick, char *ident, char *host) {
+ int i, len = strlen(source), pos = 0;
+ unsigned char stage = 0;
+
+ for(i = 0; i < len; i++) {
+ if( stage == 0 && source[i] == '!' ) {
+ memcpy(nick, &source[0], len - i);
+ nick[i] = '\0';
+ pos = i+1;
+ stage = 1;
+ } else if( stage == 1 && source[i] == '@' ) {
+ memcpy(ident, &source[pos], i - pos);
+ ident[i-pos] = '\0';
+ memcpy(host, &source[i+1], len);
+ host[len] = '\0';
+ break;
+ }
+ }
+}
+void irc_parse_sub(int fd, char *str) {
+ char source[180], command[60], target[60], message[200];
+ struct irc_func *func;
+
+ source[0] = command[0] = target[0] = message[0] = '\0';
+
+ if( str[0] == ':' )
+ str++;
+
+ sscanf(str, "%179s %59s %59s :%199[^\r\n]", source, command, target, message);
+
+ if( command[0] == '\0' )
+ return;
+
+ if( !(func = ircbot->func_search(command)) && !(func = ircbot->func_search(source)) ) {
+ ShowWarning("Unknown command received %s from %s\n",command,source);
+ return;
+ }
+ func->func(fd,command,source,target,message);
+
+}
+
+void irc_send(char *str) {
+ int len = strlen(str) + 2;
+ WFIFOHEAD(ircbot->fd, len);
+ snprintf((char*)WFIFOP(ircbot->fd,0),200, "%s\r\n", str);
+ WFIFOSET(ircbot->fd, len);
+}
+
+void irc_pong(int fd, char *cmd, char *source, char *target, char *msg) {
+ sprintf(send_string, "PONG %s", cmd);
+ ircbot->send(send_string);
+}
+
+void irc_join(int fd, char *cmd, char *source, char *target, char *msg) {
+ if( ircbot->isIn )
+ return;
+ sprintf(send_string, "JOIN %s", hChSys.irc_channel);
+ ircbot->send(send_string);
+ ircbot->isIn = true;
+}
+
+void irc_privmsg(int fd, char *cmd, char *source, char *target, char *msg) {
+ if( strcmpi(target,hChSys.irc_nick) == 0 ) {
+ if( strcmpi(msg,"VERSION") == 0 ) {
+ sprintf(send_string, "Hercules.ws IRC Bridge");
+ ircbot->send(send_string);
+ return;
+ }
+ } else if( strcmpi(target,hChSys.irc_channel) == 0 ) {
+ char source_nick[40], source_ident[40], source_host[100];
+
+ source_nick[0] = source_ident[0] = source_host[0] = '\0';
+
+ if( source[0] != '\0' )
+ ircbot->parse_source(source,source_nick,source_ident,source_host);
+
+ snprintf(send_string, 150, "[ #%s ] IRC.%s : %s",ircbot->channel->name,source_nick,msg);
+ clif->chsys_msg2(ircbot->channel,send_string);
+ }
+}
+
+void irc_relay (char *name, char *msg) {
+ if( !ircbot->isIn )
+ return;
+ sprintf(send_string,"PRIVMSG %s :[ %s ] : %s",hChSys.irc_channel,name,msg);
+ ircbot->send(send_string);
+}
+
+void irc_bot_init(void) {
+ const struct irc_func irc_func_base[] = {
+ { "PING" , ircbot->pong },
+ { "PRIVMSG", ircbot->privmsg },
+ };
+ struct irc_func* function;
+ int i;
+
+ if( !hChSys.irc )
+ return;
+
+ if (!(ircbot->ip = host2ip(hChSys.irc_server))) {
+ ShowError("Unable to resolve '%s' (irc server), disabling irc channel...\n", hChSys.irc_server);
+ hChSys.irc = false;
+ return;
+ }
+
+ ircbot->funcs.size = ARRAYLENGTH(irc_func_base);
+
+ CREATE(ircbot->funcs.list,struct irc_func*,ircbot->funcs.size);
+
+ for( i = 0; i < ircbot->funcs.size; i++ ) {
+
+ CREATE(function, struct irc_func, 1);
+
+ safestrncpy(function->name, irc_func_base[i].name, sizeof(function->name));
+ function->func = irc_func_base[i].func;
+
+ ircbot->funcs.list[i] = function;
+ }
+
+ ircbot->fails = 0;
+ ircbot->fd = -1;
+ ircbot->isIn = true;
+
+ add_timer_func_list(ircbot->connect_timer, "irc_connect_timer");
+ add_timer(gettick() + 7000, ircbot->connect_timer, 0, 0);
+}
+
+void irc_bot_final(void) {
+ int i;
+
+ if( !hChSys.irc )
+ return;
+ if( ircbot->fd != -1 ) {
+ ircbot->send("QUIT :Hercules is shutting down");
+ do_close(ircbot->fd);
+ }
+
+ for( i = 0; i < ircbot->funcs.size; i++ ) {
+ aFree(ircbot->funcs.list[i]);
+ }
+ aFree(ircbot->funcs.list);
+}
+
+void ircbot_defaults(void) {
+ ircbot = &irc_bot_s;
+ ircbot->init = irc_bot_init;
+ ircbot->final = irc_bot_final;
+
+ ircbot->parse = irc_parse;
+ ircbot->parse_sub = irc_parse_sub;
+ ircbot->parse_source = irc_parse_source;
+
+ ircbot->func_search = irc_func_search;
+
+ ircbot->connect_timer = irc_connect_timer;
+ ircbot->identify_timer = irc_identify_timer;
+ ircbot->join_timer = irc_join_timer;
+
+ ircbot->send = irc_send;
+ ircbot->relay = irc_relay;
+
+ ircbot->pong = irc_pong;
+ ircbot->join = irc_join;
+ ircbot->privmsg = irc_privmsg;
+}
diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h
new file mode 100644
index 000000000..d1bf0866d
--- /dev/null
+++ b/src/map/irc-bot.h
@@ -0,0 +1,58 @@
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Base Author: shennetsind @ http://hercules.ws
+
+
+#ifndef _IRC_BOT_H_
+#define _IRC_BOT_H_
+
+#define IRC_FUNC_LENGTH 30
+
+struct hChSysCh;
+
+struct irc_func {
+ char name[IRC_FUNC_LENGTH];
+ void (*func)(int, char*, char*, char*, char*);
+};
+
+struct irc_bot_interface {
+ int fd;
+ bool isIn;
+ unsigned int last_try;
+ unsigned char fails;
+ unsigned long ip;
+ unsigned short port;
+ /* */
+ struct hChSysCh *channel;
+ /* */
+ struct {
+ struct irc_func **list;
+ unsigned int size;
+ } funcs;
+ /* */
+ void (*init) (void);
+ void (*final) (void);
+ /* */
+ int (*parse) (int fd);
+ void (*parse_sub) (int fd, char *str);
+ void (*parse_source) (char *source, char *nick, char *ident, char *host);
+ /* */
+ struct irc_func* (*func_search) (char* function_name);
+ /* */
+ int (*connect_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*identify_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*join_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ /* */
+ void (*send)(char *str);
+ void (*relay) (char *name, char *msg);
+ /* */
+ void (*pong) (int fd, char *cmd, char *source, char *target, char *msg);
+ void (*join) (int fd, char *cmd, char *source, char *target, char *msg);
+ void (*privmsg) (int fd, char *cmd, char *source, char *target, char *msg);
+} irc_bot_s;
+
+struct irc_bot_interface *ircbot;
+
+void ircbot_defaults(void);
+
+#endif /* _IRC_BOT_H_ */
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 2b7d27c8a..386f38c5a 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -20,8 +20,6 @@
static struct item_data* itemdb_array[MAX_ITEMDB];
static DBMap* itemdb_other;// int nameid -> struct item_data*
-static struct item_group itemgroup_db[MAX_ITEMGROUP];
-
struct item_data dummy_item; //This is the default dummy item used for non-existant items. [Skotlex]
/**
@@ -466,8 +464,7 @@ int itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(stru
/*==========================================
* Specifies if item-type should drop unidentified.
*------------------------------------------*/
-int itemdb_isidentified(int nameid)
-{
+int itemdb_isidentified(int nameid) {
int type=itemdb_type(nameid);
switch (type) {
case IT_WEAPON:
@@ -478,6 +475,18 @@ int itemdb_isidentified(int nameid)
return 1;
}
}
+/* same as itemdb_isidentified but without a lookup */
+int itemdb_isidentified2(struct item_data *data) {
+ switch (data->type) {
+ case IT_WEAPON:
+ case IT_ARMOR:
+ case IT_PETARMOR:
+ return 0;
+ default:
+ return 1;
+ }
+}
+
/*==========================================
* Search by name for the override flags available items
@@ -514,18 +523,18 @@ static bool itemdb_read_itemavail(char* str[], int columns, int current)
/*==========================================
* read item group data
*------------------------------------------*/
-static void itemdb_read_itemgroup_sub(const char* filename)
-{
+static unsigned int itemdb_read_itemgroup_sub(const char* filename) {
FILE *fp;
char line[1024];
int ln=0;
+ unsigned int count = 0;
int groupid,j,k,nameid;
char *str[3],*p;
char w1[1024], w2[1024];
if( (fp=fopen(filename,"r"))==NULL ){
ShowError("can't read %s\n", filename);
- return;
+ return 0;
}
while(fgets(line, sizeof(line), fp))
@@ -536,7 +545,7 @@ static void itemdb_read_itemgroup_sub(const char* filename)
if(strstr(line,"import")) {
if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) == 2 &&
strcmpi(w1, "import") == 0) {
- itemdb_read_itemgroup_sub(w2);
+ count += itemdb_read_itemgroup_sub(w2);
continue;
}
}
@@ -570,18 +579,20 @@ static void itemdb_read_itemgroup_sub(const char* filename)
}
for(j=0;j<k;j++)
itemgroup_db[groupid].nameid[itemgroup_db[groupid].qty++] = nameid;
+ count++;
}
fclose(fp);
- return;
+ return count;
}
static void itemdb_read_itemgroup(void)
{
char path[256];
+ unsigned int count;
snprintf(path, 255, "%s/"DBPATH"item_group_db.txt", db_path);
memset(&itemgroup_db, 0, sizeof(itemgroup_db));
- itemdb_read_itemgroup_sub(path);
- ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n", "item_group_db.txt");
+ count = itemdb_read_itemgroup_sub(path);
+ ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, "item_group_db.txt");
return;
}
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 06c95da8a..362b42cff 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -155,6 +155,8 @@ struct item_combo {
bool isRef;/* whether this struct is a reference or the master */
};
+struct item_group itemgroup_db[MAX_ITEMGROUP];
+
struct item_data* itemdb_searchname(const char *name);
int itemdb_searchname_array(struct item_data** data, int size, const char *str);
struct item_data* itemdb_load(int nameid);
@@ -216,6 +218,7 @@ int itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(stru
int itemdb_isequip(int);
int itemdb_isequip2(struct item_data *);
int itemdb_isidentified(int);
+int itemdb_isidentified2(struct item_data *data);
int itemdb_isstackable(int);
int itemdb_isstackable2(struct item_data *);
uint64 itemdb_unique_id(int8 flag, int64 value); // Unique Item ID
diff --git a/src/map/log.c b/src/map/log.c
index ca10c97ab..1cca0a098 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/cbasetypes.h"
#include "../common/sql.h" // SQL_INNODB
@@ -19,8 +20,7 @@
/// filters for item logging
-typedef enum e_log_filter
-{
+typedef enum e_log_filter {
LOG_FILTER_NONE = 0x000,
LOG_FILTER_ALL = 0x001,
// bits
@@ -38,10 +38,6 @@ typedef enum e_log_filter
}
e_log_filter;
-
-struct Log_Config log_config;
-
-
#ifdef SQL_INNODB
// database is using an InnoDB engine so do not use DELAYED
#define LOG_QUERY "INSERT"
@@ -52,10 +48,8 @@ struct Log_Config log_config;
/// obtain log type character for item/zeny logs
-static char log_picktype2char(e_log_pick_type type)
-{
- switch( type )
- {
+static char log_picktype2char(e_log_pick_type type) {
+ switch( type ) {
case LOG_TYPE_TRADE: return 'T'; // (T)rade
case LOG_TYPE_VENDING: return 'V'; // (V)ending
case LOG_TYPE_PICKDROP_PLAYER: return 'P'; // (P)player
@@ -83,10 +77,8 @@ static char log_picktype2char(e_log_pick_type type)
/// obtain log type character for chat logs
-static char log_chattype2char(e_log_chat_type type)
-{
- switch( type )
- {
+static char log_chattype2char(e_log_chat_type type) {
+ switch( type ) {
case LOG_CHAT_GLOBAL: return 'O'; // Gl(O)bal
case LOG_CHAT_WHISPER: return 'W'; // (W)hisper
case LOG_CHAT_PARTY: return 'P'; // (P)arty
@@ -101,12 +93,10 @@ static char log_chattype2char(e_log_chat_type type)
/// check if this item should be logged according the settings
-static bool should_log_item(int nameid, int amount, int refine)
-{
- int filter = log_config.filter;
- struct item_data* id;
+static bool should_log_item(int nameid, int amount, int refine, struct item_data *id) {
+ int filter = logs->config.filter;
- if( ( id = itemdb_exists(nameid) ) == NULL )
+ if( id == NULL )
return false;
if( ( filter&LOG_FILTER_ALL ) ||
@@ -117,360 +107,289 @@ static bool should_log_item(int nameid, int amount, int refine)
( filter&LOG_FILTER_ARMOR && id->type == IT_ARMOR ) ||
( filter&LOG_FILTER_CARD && id->type == IT_CARD ) ||
( filter&LOG_FILTER_PETITEM && ( id->type == IT_PETEGG || id->type == IT_PETARMOR ) ) ||
- ( filter&LOG_FILTER_PRICE && id->value_buy >= log_config.price_items_log ) ||
- ( filter&LOG_FILTER_AMOUNT && abs(amount) >= log_config.amount_items_log ) ||
- ( filter&LOG_FILTER_REFINE && refine >= log_config.refine_items_log ) ||
- ( filter&LOG_FILTER_CHANCE && ( ( id->maxchance != -1 && id->maxchance <= log_config.rare_items_log ) || id->nameid == ITEMID_EMPERIUM ) )
+ ( filter&LOG_FILTER_PRICE && id->value_buy >= logs->config.price_items_log ) ||
+ ( filter&LOG_FILTER_AMOUNT && abs(amount) >= logs->config.amount_items_log ) ||
+ ( filter&LOG_FILTER_REFINE && refine >= logs->config.refine_items_log ) ||
+ ( filter&LOG_FILTER_CHANCE && ( ( id->maxchance != -1 && id->maxchance <= logs->config.rare_items_log ) || id->nameid == ITEMID_EMPERIUM ) )
)
return true;
return false;
}
-
+void log_branch_sub_sql(struct map_session_data* sd) {
+ SqlStmt* stmt;
+ stmt = SqlStmt_Malloc(logmysql_handle);
+ if( SQL_SUCCESS != SqlStmt_Prepare(stmt, LOG_QUERY " INTO `%s` (`branch_date`, `account_id`, `char_id`, `char_name`, `map`) VALUES (NOW(), '%d', '%d', ?, '%s')", logs->config.log_branch, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
+ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
+ || SQL_SUCCESS != SqlStmt_Execute(stmt) )
+ {
+ SqlStmt_ShowDebug(stmt);
+ SqlStmt_Free(stmt);
+ return;
+ }
+ SqlStmt_Free(stmt);
+}
+void log_branch_sub_txt(struct map_session_data* sd) {
+ char timestring[255];
+ time_t curtime;
+ FILE* logfp;
+
+ if( ( logfp = fopen(logs->config.log_branch, "a") ) == NULL )
+ return;
+ time(&curtime);
+ strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
+ fprintf(logfp,"%s - %s[%d:%d]\t%s\n", timestring, sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex));
+ fclose(logfp);
+}
/// logs items, that summon monsters
-void log_branch(struct map_session_data* sd)
-{
+void log_branch(struct map_session_data* sd) {
nullpo_retv(sd);
- if( !log_config.branch )
+ if( !logs->config.branch )
return;
- if( log_config.sql_logs ) {
-#ifdef BETA_THREAD_TEST
- char entry[512];
- int e_length = 0;
- e_length = sprintf(entry, LOG_QUERY " INTO `%s` (`branch_date`, `account_id`, `char_id`, `char_name`, `map`) VALUES (NOW(), '%d', '%d', '%s', '%s')", log_config.log_branch, sd->status.account_id, sd->status.char_id, sd->status.name, mapindex_id2name(sd->mapindex));
- queryThread_log(entry,e_length);
-#else
- SqlStmt* stmt;
- stmt = SqlStmt_Malloc(logmysql_handle);
- if( SQL_SUCCESS != SqlStmt_Prepare(stmt, LOG_QUERY " INTO `%s` (`branch_date`, `account_id`, `char_id`, `char_name`, `map`) VALUES (NOW(), '%d', '%d', ?, '%s')", log_config.log_branch, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
- || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
- || SQL_SUCCESS != SqlStmt_Execute(stmt) )
- {
- SqlStmt_ShowDebug(stmt);
- SqlStmt_Free(stmt);
- return;
- }
- SqlStmt_Free(stmt);
-#endif
- }
- else
+ logs->branch_sub(sd);
+}
+void log_pick_sub_sql(int id, int16 m, e_log_pick_type type, int amount, struct item* itm, struct item_data *data) {
+ if( SQL_ERROR == Sql_Query(logmysql_handle, LOG_QUERY " INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`, `unique_id`) VALUES (NOW(), '%d', '%c', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%"PRIu64"')",
+ logs->config.log_pick, id, log_picktype2char(type), itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], map[m].name?map[m].name:"", itm->unique_id) )
{
- char timestring[255];
- time_t curtime;
- FILE* logfp;
-
- if( ( logfp = fopen(log_config.log_branch, "a") ) == NULL )
- return;
- time(&curtime);
- strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
- fprintf(logfp,"%s - %s[%d:%d]\t%s\n", timestring, sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex));
- fclose(logfp);
+ Sql_ShowDebug(logmysql_handle);
+ return;
}
}
-
+void log_pick_sub_txt(int id, int16 m, e_log_pick_type type, int amount, struct item* itm, struct item_data *data) {
+ char timestring[255];
+ time_t curtime;
+ FILE* logfp;
+
+ if( ( logfp = fopen(logs->config.log_pick, "a") ) == NULL )
+ return;
+ time(&curtime);
+ strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
+ fprintf(logfp,"%s - %d\t%c\t%d,%d,%d,%d,%d,%d,%d,%s,'%"PRIu64"'\n", timestring, id, log_picktype2char(type), itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], map[m].name?map[m].name:"", itm->unique_id);
+ fclose(logfp);
+}
/// logs item transactions (generic)
-void log_pick(int id, int16 m, e_log_pick_type type, int amount, struct item* itm)
-{
+void log_pick(int id, int16 m, e_log_pick_type type, int amount, struct item* itm, struct item_data *data) {
nullpo_retv(itm);
- if( ( log_config.enable_logs&type ) == 0 )
- {// disabled
+ if( ( logs->config.enable_logs&type ) == 0 ) {// disabled
return;
}
- if( !should_log_item(itm->nameid, amount, itm->refine) )
+ if( !should_log_item(itm->nameid, amount, itm->refine, data) )
return; //we skip logging this item set - it doesn't meet our logging conditions [Lupus]
- if( log_config.sql_logs )
- {
-#ifdef BETA_THREAD_TEST
- char entry[512];
- int e_length = 0;
- e_length = sprintf(entry, LOG_QUERY " INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`, `unique_id`) VALUES (NOW(), '%d', '%c', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%"PRIu64"')",
- log_config.log_pick, id, log_picktype2char(type), itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], map[m].name?map[m].name:"", itm->unique_id);
- queryThread_log(entry,e_length);
-#else
- if( SQL_ERROR == Sql_Query(logmysql_handle, LOG_QUERY " INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`, `unique_id`) VALUES (NOW(), '%d', '%c', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%"PRIu64"')",
- log_config.log_pick, id, log_picktype2char(type), itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], map[m].name?map[m].name:"", itm->unique_id) )
- {
- Sql_ShowDebug(logmysql_handle);
- return;
- }
-#endif
- }
- else
- {
- char timestring[255];
- time_t curtime;
- FILE* logfp;
-
- if( ( logfp = fopen(log_config.log_pick, "a") ) == NULL )
- return;
- time(&curtime);
- strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
- fprintf(logfp,"%s - %d\t%c\t%d,%d,%d,%d,%d,%d,%d,%s,'%"PRIu64"'\n", timestring, id, log_picktype2char(type), itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], map[m].name?map[m].name:"", itm->unique_id);
- fclose(logfp);
- }
+ logs->pick_sub(id,m,type,amount,itm,data);
}
/// logs item transactions (players)
-void log_pick_pc(struct map_session_data* sd, e_log_pick_type type, int amount, struct item* itm)
-{
+void log_pick_pc(struct map_session_data* sd, e_log_pick_type type, int amount, struct item* itm, struct item_data *data) {
nullpo_retv(sd);
- log_pick(sd->status.char_id, sd->bl.m, type, amount, itm);
+ log_pick(sd->status.char_id, sd->bl.m, type, amount, itm, data ? data : itemdb_exists(itm->nameid));
}
/// logs item transactions (monsters)
-void log_pick_mob(struct mob_data* md, e_log_pick_type type, int amount, struct item* itm)
-{
+void log_pick_mob(struct mob_data* md, e_log_pick_type type, int amount, struct item* itm, struct item_data *data) {
nullpo_retv(md);
- log_pick(md->class_, md->bl.m, type, amount, itm);
+ log_pick(md->class_, md->bl.m, type, amount, itm, data ? data : itemdb_exists(itm->nameid));
+}
+void log_zeny_sub_sql(struct map_session_data* sd, e_log_pick_type type, struct map_session_data* src_sd, int amount) {
+ if( SQL_ERROR == Sql_Query(logmysql_handle, LOG_QUERY " INTO `%s` (`time`, `char_id`, `src_id`, `type`, `amount`, `map`) VALUES (NOW(), '%d', '%d', '%c', '%d', '%s')",
+ logs->config.log_zeny, sd->status.char_id, src_sd->status.char_id, log_picktype2char(type), amount, mapindex_id2name(sd->mapindex)) )
+ {
+ Sql_ShowDebug(logmysql_handle);
+ return;
+ }
+}
+void log_zeny_sub_txt(struct map_session_data* sd, e_log_pick_type type, struct map_session_data* src_sd, int amount) {
+ char timestring[255];
+ time_t curtime;
+ FILE* logfp;
+
+ if( ( logfp = fopen(logs->config.log_zeny, "a") ) == NULL )
+ return;
+ time(&curtime);
+ strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
+ fprintf(logfp, "%s - %s[%d]\t%s[%d]\t%d\t\n", timestring, src_sd->status.name, src_sd->status.account_id, sd->status.name, sd->status.account_id, amount);
+ fclose(logfp);
}
-
/// logs zeny transactions
void log_zeny(struct map_session_data* sd, e_log_pick_type type, struct map_session_data* src_sd, int amount)
{
nullpo_retv(sd);
- if( !log_config.zeny || ( log_config.zeny != 1 && abs(amount) < log_config.zeny ) )
+ if( !logs->config.zeny || ( logs->config.zeny != 1 && abs(amount) < logs->config.zeny ) )
return;
- if( log_config.sql_logs )
- {
-#ifdef BETA_THREAD_TEST
- char entry[512];
- int e_length = 0;
- e_length = sprintf(entry, LOG_QUERY " INTO `%s` (`time`, `char_id`, `src_id`, `type`, `amount`, `map`) VALUES (NOW(), '%d', '%d', '%c', '%d', '%s')",
- log_config.log_zeny, sd->status.char_id, src_sd->status.char_id, log_picktype2char(type), amount, mapindex_id2name(sd->mapindex));
- queryThread_log(entry,e_length);
-#else
- if( SQL_ERROR == Sql_Query(logmysql_handle, LOG_QUERY " INTO `%s` (`time`, `char_id`, `src_id`, `type`, `amount`, `map`) VALUES (NOW(), '%d', '%d', '%c', '%d', '%s')",
- log_config.log_zeny, sd->status.char_id, src_sd->status.char_id, log_picktype2char(type), amount, mapindex_id2name(sd->mapindex)) )
- {
- Sql_ShowDebug(logmysql_handle);
- return;
- }
-#endif
- }
- else
+ logs->zeny_sub(sd,type,src_sd,amount);
+}
+void log_mvpdrop_sub_sql(struct map_session_data* sd, int monster_id, int* log_mvp) {
+ if( SQL_ERROR == Sql_Query(logmysql_handle, LOG_QUERY " INTO `%s` (`mvp_date`, `kill_char_id`, `monster_id`, `prize`, `mvpexp`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%s') ",
+ logs->config.log_mvpdrop, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1], mapindex_id2name(sd->mapindex)) )
{
- char timestring[255];
- time_t curtime;
- FILE* logfp;
-
- if( ( logfp = fopen(log_config.log_zeny, "a") ) == NULL )
- return;
- time(&curtime);
- strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
- fprintf(logfp, "%s - %s[%d]\t%s[%d]\t%d\t\n", timestring, src_sd->status.name, src_sd->status.account_id, sd->status.name, sd->status.account_id, amount);
- fclose(logfp);
+ Sql_ShowDebug(logmysql_handle);
+ return;
}
}
-
-
+void log_mvpdrop_sub_txt(struct map_session_data* sd, int monster_id, int* log_mvp) {
+ char timestring[255];
+ time_t curtime;
+ FILE* logfp;
+
+ if( ( logfp = fopen(logs->config.log_mvpdrop,"a") ) == NULL )
+ return;
+ time(&curtime);
+ strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
+ fprintf(logfp,"%s - %s[%d:%d]\t%d\t%d,%d\n", timestring, sd->status.name, sd->status.account_id, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1]);
+ fclose(logfp);
+}
/// logs MVP monster rewards
void log_mvpdrop(struct map_session_data* sd, int monster_id, int* log_mvp)
{
nullpo_retv(sd);
- if( !log_config.mvpdrop )
+ if( !logs->config.mvpdrop )
return;
- if( log_config.sql_logs )
- {
-#ifdef BETA_THREAD_TEST
- char entry[512];
- int e_length = 0;
- e_length = sprintf(entry, LOG_QUERY " INTO `%s` (`mvp_date`, `kill_char_id`, `monster_id`, `prize`, `mvpexp`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%s') ",
- log_config.log_mvpdrop, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1], mapindex_id2name(sd->mapindex));
- queryThread_log(entry,e_length);
-#else
- if( SQL_ERROR == Sql_Query(logmysql_handle, LOG_QUERY " INTO `%s` (`mvp_date`, `kill_char_id`, `monster_id`, `prize`, `mvpexp`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%s') ",
- log_config.log_mvpdrop, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1], mapindex_id2name(sd->mapindex)) )
- {
- Sql_ShowDebug(logmysql_handle);
- return;
- }
-#endif
- }
- else
+ logs->mvpdrop_sub(sd,monster_id,log_mvp);
+}
+
+void log_atcommand_sub_sql(struct map_session_data* sd, const char* message) {
+ SqlStmt* stmt;
+
+ stmt = SqlStmt_Malloc(logmysql_handle);
+ if( SQL_SUCCESS != SqlStmt_Prepare(stmt, LOG_QUERY " INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_gm, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
+ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
+ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
+ || SQL_SUCCESS != SqlStmt_Execute(stmt) )
{
- char timestring[255];
- time_t curtime;
- FILE* logfp;
-
- if( ( logfp = fopen(log_config.log_mvpdrop,"a") ) == NULL )
- return;
- time(&curtime);
- strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
- fprintf(logfp,"%s - %s[%d:%d]\t%d\t%d,%d\n", timestring, sd->status.name, sd->status.account_id, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1]);
- fclose(logfp);
+ SqlStmt_ShowDebug(stmt);
+ SqlStmt_Free(stmt);
+ return;
}
+ SqlStmt_Free(stmt);
+}
+void log_atcommand_sub_txt(struct map_session_data* sd, const char* message) {
+ char timestring[255];
+ time_t curtime;
+ FILE* logfp;
+
+ if( ( logfp = fopen(logs->config.log_gm, "a") ) == NULL )
+ return;
+ time(&curtime);
+ strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
+ fprintf(logfp, "%s - %s[%d]: %s\n", timestring, sd->status.name, sd->status.account_id, message);
+ fclose(logfp);
}
-
-
/// logs used atcommands
void log_atcommand(struct map_session_data* sd, const char* message)
{
nullpo_retv(sd);
- if( !log_config.commands ||
+ if( !logs->config.commands ||
!pc_should_log_commands(sd) )
return;
- if( log_config.sql_logs )
+ logs->atcommand_sub(sd,message);
+}
+
+void log_npc_sub_sql(struct map_session_data *sd, const char *message) {
+ SqlStmt* stmt;
+ stmt = SqlStmt_Malloc(logmysql_handle);
+ if( SQL_SUCCESS != SqlStmt_Prepare(stmt, LOG_QUERY " INTO `%s` (`npc_date`, `account_id`, `char_id`, `char_name`, `map`, `mes`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_npc, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
+ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
+ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
+ || SQL_SUCCESS != SqlStmt_Execute(stmt) )
{
-#ifdef BETA_THREAD_TEST
- char entry[512];
- int e_length = 0;
- e_length = sprintf(entry, LOG_QUERY " INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES (NOW(), '%d', '%d', '%s', '%s', '%s')", log_config.log_gm, sd->status.account_id, sd->status.char_id, sd->status.name ,mapindex_id2name(sd->mapindex), message);
- queryThread_log(entry,e_length);
-#else
- SqlStmt* stmt;
-
- stmt = SqlStmt_Malloc(logmysql_handle);
- if( SQL_SUCCESS != SqlStmt_Prepare(stmt, LOG_QUERY " INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", log_config.log_gm, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
- || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
- || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
- || SQL_SUCCESS != SqlStmt_Execute(stmt) )
- {
- SqlStmt_ShowDebug(stmt);
- SqlStmt_Free(stmt);
- return;
- }
+ SqlStmt_ShowDebug(stmt);
SqlStmt_Free(stmt);
-#endif
- }
- else
- {
- char timestring[255];
- time_t curtime;
- FILE* logfp;
-
- if( ( logfp = fopen(log_config.log_gm, "a") ) == NULL )
- return;
- time(&curtime);
- strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
- fprintf(logfp, "%s - %s[%d]: %s\n", timestring, sd->status.name, sd->status.account_id, message);
- fclose(logfp);
+ return;
}
+ SqlStmt_Free(stmt);
+}
+void log_npc_sub_txt(struct map_session_data *sd, const char *message) {
+ char timestring[255];
+ time_t curtime;
+ FILE* logfp;
+
+ if( ( logfp = fopen(logs->config.log_npc, "a") ) == NULL )
+ return;
+ time(&curtime);
+ strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
+ fprintf(logfp, "%s - %s[%d]: %s\n", timestring, sd->status.name, sd->status.account_id, message);
+ fclose(logfp);
}
-
-
/// logs messages passed to script command 'logmes'
void log_npc(struct map_session_data* sd, const char* message)
{
nullpo_retv(sd);
- if( !log_config.npc )
+ if( !logs->config.npc )
return;
- if( log_config.sql_logs )
+ logs->npc_sub(sd,message);
+}
+
+void log_chat_sub_sql(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message) {
+ SqlStmt* stmt;
+
+ stmt = SqlStmt_Malloc(logmysql_handle);
+ if( SQL_SUCCESS != SqlStmt_Prepare(stmt, LOG_QUERY " INTO `%s` (`time`, `type`, `type_id`, `src_charid`, `src_accountid`, `src_map`, `src_map_x`, `src_map_y`, `dst_charname`, `message`) VALUES (NOW(), '%c', '%d', '%d', '%d', '%s', '%d', '%d', ?, ?)", logs->config.log_chat, log_chattype2char(type), type_id, src_charid, src_accid, map, x, y)
+ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, (char*)dst_charname, safestrnlen(dst_charname, NAME_LENGTH))
+ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, CHAT_SIZE_MAX))
+ || SQL_SUCCESS != SqlStmt_Execute(stmt) )
{
-#ifdef BETA_THREAD_TEST
- char entry[512];
- int e_length = 0;
- e_length = sprintf(entry, LOG_QUERY " INTO `%s` (`npc_date`, `account_id`, `char_id`, `char_name`, `map`, `mes`) VALUES (NOW(), '%d', '%d', '%s', '%s', '%s')", log_config.log_npc, sd->status.account_id, sd->status.char_id, sd->status.name, mapindex_id2name(sd->mapindex), message );
- queryThread_log(entry,e_length);
-#else
- SqlStmt* stmt;
- stmt = SqlStmt_Malloc(logmysql_handle);
- if( SQL_SUCCESS != SqlStmt_Prepare(stmt, LOG_QUERY " INTO `%s` (`npc_date`, `account_id`, `char_id`, `char_name`, `map`, `mes`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", log_config.log_npc, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
- || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
- || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
- || SQL_SUCCESS != SqlStmt_Execute(stmt) )
- {
- SqlStmt_ShowDebug(stmt);
- SqlStmt_Free(stmt);
- return;
- }
+ SqlStmt_ShowDebug(stmt);
SqlStmt_Free(stmt);
-#endif
- }
- else
- {
- char timestring[255];
- time_t curtime;
- FILE* logfp;
-
- if( ( logfp = fopen(log_config.log_npc, "a") ) == NULL )
- return;
- time(&curtime);
- strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
- fprintf(logfp, "%s - %s[%d]: %s\n", timestring, sd->status.name, sd->status.account_id, message);
- fclose(logfp);
+ return;
}
+ SqlStmt_Free(stmt);
+}
+void log_chat_sub_txt(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message) {
+ char timestring[255];
+ time_t curtime;
+ FILE* logfp;
+
+ if( ( logfp = fopen(logs->config.log_chat, "a") ) == NULL )
+ return;
+ time(&curtime);
+ strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
+ fprintf(logfp, "%s - %c,%d,%d,%d,%s,%d,%d,%s,%s\n", timestring, log_chattype2char(type), type_id, src_charid, src_accid, map, x, y, dst_charname, message);
+ fclose(logfp);
}
-
/// logs chat
void log_chat(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message)
{
- if( ( log_config.chat&type ) == 0 )
+ if( ( logs->config.chat&type ) == 0 )
{// disabled
return;
}
- if( log_config.log_chat_woe_disable && ( agit_flag || agit2_flag ) )
+ if( logs->config.log_chat_woe_disable && ( agit_flag || agit2_flag ) )
{// no chat logging during woe
return;
}
- if( log_config.sql_logs ) {
-#ifdef BETA_THREAD_TEST
- char entry[512];
- int e_length = 0;
- e_length = sprintf(entry, LOG_QUERY " INTO `%s` (`time`, `type`, `type_id`, `src_charid`, `src_accountid`, `src_map`, `src_map_x`, `src_map_y`, `dst_charname`, `message`) VALUES (NOW(), '%c', '%d', '%d', '%d', '%s', '%d', '%d', '%s', '%s')", log_config.log_chat, log_chattype2char(type), type_id, src_charid, src_accid, map, x, y, dst_charname, message );
- queryThread_log(entry,e_length);
-#else
- SqlStmt* stmt;
-
- stmt = SqlStmt_Malloc(logmysql_handle);
- if( SQL_SUCCESS != SqlStmt_Prepare(stmt, LOG_QUERY " INTO `%s` (`time`, `type`, `type_id`, `src_charid`, `src_accountid`, `src_map`, `src_map_x`, `src_map_y`, `dst_charname`, `message`) VALUES (NOW(), '%c', '%d', '%d', '%d', '%s', '%d', '%d', ?, ?)", log_config.log_chat, log_chattype2char(type), type_id, src_charid, src_accid, map, x, y)
- || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, (char*)dst_charname, safestrnlen(dst_charname, NAME_LENGTH))
- || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, CHAT_SIZE_MAX))
- || SQL_SUCCESS != SqlStmt_Execute(stmt) )
- {
- SqlStmt_ShowDebug(stmt);
- SqlStmt_Free(stmt);
- return;
- }
- SqlStmt_Free(stmt);
-#endif
- }
- else
- {
- char timestring[255];
- time_t curtime;
- FILE* logfp;
-
- if( ( logfp = fopen(log_config.log_chat, "a") ) == NULL )
- return;
- time(&curtime);
- strftime(timestring, sizeof(timestring), "%m/%d/%Y %H:%M:%S", localtime(&curtime));
- fprintf(logfp, "%s - %c,%d,%d,%d,%s,%d,%d,%s,%s\n", timestring, log_chattype2char(type), type_id, src_charid, src_accid, map, x, y, dst_charname, message);
- fclose(logfp);
- }
+ logs->chat_sub(type,type_id,src_charid,src_accid,map,x,y,dst_charname,message);
}
-void log_set_defaults(void)
-{
- memset(&log_config, 0, sizeof(log_config));
+void log_set_defaults(void) {
+ memset(&logs->config, 0, sizeof(logs->config));
//LOG FILTER Default values
- log_config.refine_items_log = 5; // log refined items, with refine >= +5
- log_config.rare_items_log = 100; // log rare items. drop chance <= 1%
- log_config.price_items_log = 1000; // 1000z
- log_config.amount_items_log = 100;
+ logs->config.refine_items_log = 5; // log refined items, with refine >= +5
+ logs->config.rare_items_log = 100; // log rare items. drop chance <= 1%
+ logs->config.price_items_log = 1000; // 1000z
+ logs->config.amount_items_log = 100;
}
-int log_config_read(const char* cfgName)
-{
+int log_config_read(const char* cfgName) {
static int count = 0;
char line[1024], w1[1024], w2[1024];
FILE *fp;
@@ -478,63 +397,60 @@ int log_config_read(const char* cfgName)
if( count++ == 0 )
log_set_defaults();
- if( ( fp = fopen(cfgName, "r") ) == NULL )
- {
+ if( ( fp = fopen(cfgName, "r") ) == NULL ) {
ShowError("Log configuration file not found at: %s\n", cfgName);
return 1;
}
- while( fgets(line, sizeof(line), fp) )
- {
+ while( fgets(line, sizeof(line), fp) ) {
if( line[0] == '/' && line[1] == '/' )
continue;
- if( sscanf(line, "%[^:]: %[^\r\n]", w1, w2) == 2 )
- {
+ if( sscanf(line, "%[^:]: %[^\r\n]", w1, w2) == 2 ) {
if( strcmpi(w1, "enable_logs") == 0 )
- log_config.enable_logs = (e_log_pick_type)config_switch(w2);
+ logs->config.enable_logs = (e_log_pick_type)config_switch(w2);
else if( strcmpi(w1, "sql_logs") == 0 )
- log_config.sql_logs = (bool)config_switch(w2);
+ logs->config.sql_logs = (bool)config_switch(w2);
//start of common filter settings
else if( strcmpi(w1, "rare_items_log") == 0 )
- log_config.rare_items_log = atoi(w2);
+ logs->config.rare_items_log = atoi(w2);
else if( strcmpi(w1, "refine_items_log") == 0 )
- log_config.refine_items_log = atoi(w2);
+ logs->config.refine_items_log = atoi(w2);
else if( strcmpi(w1, "price_items_log") == 0 )
- log_config.price_items_log = atoi(w2);
+ logs->config.price_items_log = atoi(w2);
else if( strcmpi(w1, "amount_items_log") == 0 )
- log_config.amount_items_log = atoi(w2);
+ logs->config.amount_items_log = atoi(w2);
//end of common filter settings
else if( strcmpi(w1, "log_branch") == 0 )
- log_config.branch = config_switch(w2);
+ logs->config.branch = config_switch(w2);
else if( strcmpi(w1, "log_filter") == 0 )
- log_config.filter = config_switch(w2);
+ logs->config.filter = config_switch(w2);
else if( strcmpi(w1, "log_zeny") == 0 )
- log_config.zeny = config_switch(w2);
+ logs->config.zeny = config_switch(w2);
else if( strcmpi(w1, "log_commands") == 0 )
- log_config.commands = config_switch(w2);
+ logs->config.commands = config_switch(w2);
else if( strcmpi(w1, "log_npc") == 0 )
- log_config.npc = config_switch(w2);
+ logs->config.npc = config_switch(w2);
else if( strcmpi(w1, "log_chat") == 0 )
- log_config.chat = config_switch(w2);
+ logs->config.chat = config_switch(w2);
else if( strcmpi(w1, "log_mvpdrop") == 0 )
- log_config.mvpdrop = config_switch(w2);
+ logs->config.mvpdrop = config_switch(w2);
else if( strcmpi(w1, "log_chat_woe_disable") == 0 )
- log_config.log_chat_woe_disable = (bool)config_switch(w2);
+ logs->config.log_chat_woe_disable = (bool)config_switch(w2);
else if( strcmpi(w1, "log_branch_db") == 0 )
- safestrncpy(log_config.log_branch, w2, sizeof(log_config.log_branch));
+ safestrncpy(logs->config.log_branch, w2, sizeof(logs->config.log_branch));
else if( strcmpi(w1, "log_pick_db") == 0 )
- safestrncpy(log_config.log_pick, w2, sizeof(log_config.log_pick));
+ safestrncpy(logs->config.log_pick, w2, sizeof(logs->config.log_pick));
else if( strcmpi(w1, "log_zeny_db") == 0 )
- safestrncpy(log_config.log_zeny, w2, sizeof(log_config.log_zeny));
+ safestrncpy(logs->config.log_zeny, w2, sizeof(logs->config.log_zeny));
else if( strcmpi(w1, "log_mvpdrop_db") == 0 )
- safestrncpy(log_config.log_mvpdrop, w2, sizeof(log_config.log_mvpdrop));
+ safestrncpy(logs->config.log_mvpdrop, w2, sizeof(logs->config.log_mvpdrop));
else if( strcmpi(w1, "log_gm_db") == 0 )
- safestrncpy(log_config.log_gm, w2, sizeof(log_config.log_gm));
+ safestrncpy(logs->config.log_gm, w2, sizeof(logs->config.log_gm));
else if( strcmpi(w1, "log_npc_db") == 0 )
- safestrncpy(log_config.log_npc, w2, sizeof(log_config.log_npc));
+ safestrncpy(logs->config.log_npc, w2, sizeof(logs->config.log_npc));
else if( strcmpi(w1, "log_chat_db") == 0 )
- safestrncpy(log_config.log_chat, w2, sizeof(log_config.log_chat));
+ safestrncpy(logs->config.log_chat, w2, sizeof(logs->config.log_chat));
//support the import command, just like any other config
else if( strcmpi(w1,"import") == 0 )
log_config_read(w2);
@@ -545,39 +461,67 @@ int log_config_read(const char* cfgName)
fclose(fp);
- if( --count == 0 )
- {// report final logging state
- const char* target = log_config.sql_logs ? "table" : "file";
+ if( --count == 0 ) {// report final logging state
+ const char* target = logs->config.sql_logs ? "table" : "file";
- if( log_config.enable_logs && log_config.filter )
- {
- ShowInfo("Logging item transactions to %s '%s'.\n", target, log_config.log_pick);
+ if( logs->config.enable_logs && logs->config.filter ) {
+ ShowInfo("Logging item transactions to %s '%s'.\n", target, logs->config.log_pick);
}
- if( log_config.branch )
- {
- ShowInfo("Logging monster summon item usage to %s '%s'.\n", target, log_config.log_pick);
+ if( logs->config.branch ) {
+ ShowInfo("Logging monster summon item usage to %s '%s'.\n", target, logs->config.log_pick);
}
- if( log_config.chat )
- {
- ShowInfo("Logging chat to %s '%s'.\n", target, log_config.log_chat);
+ if( logs->config.chat ) {
+ ShowInfo("Logging chat to %s '%s'.\n", target, logs->config.log_chat);
}
- if( log_config.commands )
- {
- ShowInfo("Logging commands to %s '%s'.\n", target, log_config.log_gm);
+ if( logs->config.commands ) {
+ ShowInfo("Logging commands to %s '%s'.\n", target, logs->config.log_gm);
}
- if( log_config.mvpdrop )
- {
- ShowInfo("Logging MVP monster rewards to %s '%s'.\n", target, log_config.log_mvpdrop);
+ if( logs->config.mvpdrop ) {
+ ShowInfo("Logging MVP monster rewards to %s '%s'.\n", target, logs->config.log_mvpdrop);
}
- if( log_config.npc )
- {
- ShowInfo("Logging 'logmes' messages to %s '%s'.\n", target, log_config.log_npc);
+ if( logs->config.npc ) {
+ ShowInfo("Logging 'logmes' messages to %s '%s'.\n", target, logs->config.log_npc);
}
- if( log_config.zeny )
- {
- ShowInfo("Logging Zeny transactions to %s '%s'.\n", target, log_config.log_zeny);
+ if( logs->config.zeny ) {
+ ShowInfo("Logging Zeny transactions to %s '%s'.\n", target, logs->config.log_zeny);
}
+ logs->config_done();
}
return 0;
}
+void log_config_complete(void) {
+ if( logs->config.sql_logs ) {
+ logs->pick_sub = log_pick_sub_sql;
+ logs->zeny_sub = log_zeny_sub_sql;
+ logs->npc_sub = log_npc_sub_sql;
+ logs->chat_sub = log_chat_sub_sql;
+ logs->atcommand_sub = log_atcommand_sub_sql;
+ logs->branch_sub = log_branch_sub_sql;
+ logs->mvpdrop_sub = log_mvpdrop_sub_sql;
+ }
+}
+void log_defaults(void) {
+ logs = &log_s;
+
+ logs->pick_pc = log_pick_pc;
+ logs->pick_mob = log_pick_mob;
+ logs->zeny = log_zeny;
+ logs->npc = log_npc;
+ logs->chat = log_chat;
+ logs->atcommand = log_atcommand;
+ logs->branch = log_branch;
+ logs->mvpdrop = log_mvpdrop;
+ logs->config_read = log_config_read;
+ logs->config_done = log_config_complete;
+
+ /* will be modified in a few seconds once loading is complete. */
+ logs->pick_sub = log_pick_sub_txt;
+ logs->zeny_sub = log_zeny_sub_txt;
+ logs->npc_sub = log_npc_sub_txt;
+ logs->chat_sub = log_chat_sub_txt;
+ logs->atcommand_sub = log_atcommand_sub_txt;
+ logs->branch_sub = log_branch_sub_txt;
+ logs->mvpdrop_sub = log_mvpdrop_sub_txt;
+
+}
diff --git a/src/map/log.h b/src/map/log.h
index a40a3fcf4..462a12ff5 100644
--- a/src/map/log.h
+++ b/src/map/log.h
@@ -1,18 +1,18 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _LOG_H_
#define _LOG_H_
-//#include "map.h"
struct block_list;
struct map_session_data;
struct mob_data;
struct item;
+struct item_data;
-typedef enum e_log_chat_type
-{
+typedef enum e_log_chat_type {
LOG_CHAT_GLOBAL = 0x01,
LOG_CHAT_WHISPER = 0x02,
LOG_CHAT_PARTY = 0x04,
@@ -20,12 +20,10 @@ typedef enum e_log_chat_type
LOG_CHAT_MAINCHAT = 0x10,
// all
LOG_CHAT_ALL = 0xFF,
-}
-e_log_chat_type;
+} e_log_chat_type;
-typedef enum e_log_pick_type
-{
+typedef enum e_log_pick_type {
LOG_TYPE_NONE = 0,
LOG_TYPE_TRADE = 0x00001,
LOG_TYPE_VENDING = 0x00002,
@@ -48,42 +46,42 @@ typedef enum e_log_pick_type
LOG_TYPE_LOOT = LOG_TYPE_PICKDROP_MONSTER|LOG_TYPE_CONSUME,
// all
LOG_TYPE_ALL = 0xFFFFF,
-}
-e_log_pick_type;
+} e_log_pick_type;
+struct log_interface {
+ struct {
+ e_log_pick_type enable_logs;
+ int filter;
+ bool sql_logs;
+ bool log_chat_woe_disable;
+ int rare_items_log,refine_items_log,price_items_log,amount_items_log;
+ int branch, mvpdrop, zeny, commands, npc, chat;
+ char log_branch[64], log_pick[64], log_zeny[64], log_mvpdrop[64], log_gm[64], log_npc[64], log_chat[64];
+ } config;
+ /* */
+ void (*pick_pc) (struct map_session_data* sd, e_log_pick_type type, int amount, struct item* itm, struct item_data *data);
+ void (*pick_mob) (struct mob_data* md, e_log_pick_type type, int amount, struct item* itm, struct item_data *data);
+ void (*zeny) (struct map_session_data* sd, e_log_pick_type type, struct map_session_data* src_sd, int amount);
+ void (*npc) (struct map_session_data* sd, const char *message);
+ void (*chat) (e_log_chat_type type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message);
+ void (*atcommand) (struct map_session_data* sd, const char* message);
+ void (*branch) (struct map_session_data* sd);
+ void (*mvpdrop) (struct map_session_data* sd, int monster_id, int* log_mvp);
+
+ void (*pick_sub) (int id, int16 m, e_log_pick_type type, int amount, struct item* itm, struct item_data *data);
+ void (*zeny_sub) (struct map_session_data* sd, e_log_pick_type type, struct map_session_data* src_sd, int amount);
+ void (*npc_sub) (struct map_session_data* sd, const char *message);
+ void (*chat_sub) (e_log_chat_type type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message);
+ void (*atcommand_sub) (struct map_session_data* sd, const char* message);
+ void (*branch_sub) (struct map_session_data* sd);
+ void (*mvpdrop_sub) (struct map_session_data* sd, int monster_id, int* log_mvp);
+
+ int (*config_read) (const char* cfgName);
+ void (*config_done) (void);
+} log_s;
-/// new logs
-void log_pick_pc(struct map_session_data* sd, e_log_pick_type type, int amount, struct item* itm);
-void log_pick_mob(struct mob_data* md, e_log_pick_type type, int amount, struct item* itm);
-void log_zeny(struct map_session_data* sd, e_log_pick_type type, struct map_session_data* src_sd, int amount);
-
-void log_npc(struct map_session_data* sd, const char *message);
-void log_chat(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message);
-void log_atcommand(struct map_session_data* sd, const char* message);
-
-/// old, but useful logs
-void log_branch(struct map_session_data* sd);
-void log_mvpdrop(struct map_session_data* sd, int monster_id, int* log_mvp);
-
-int log_config_read(const char* cfgName);
-
-extern struct Log_Config
-{
- e_log_pick_type enable_logs;
- int filter;
- bool sql_logs;
- bool log_chat_woe_disable;
- int rare_items_log,refine_items_log,price_items_log,amount_items_log; //for filter
- int branch, mvpdrop, zeny, commands, npc, chat;
- char log_branch[64], log_pick[64], log_zeny[64], log_mvpdrop[64], log_gm[64], log_npc[64], log_chat[64];
-}
-log_config;
+struct log_interface *logs;
-#ifdef BETA_THREAD_TEST
- struct {
- char** entry;
- int count;
- } logThreadData;
-#endif
+void log_defaults(void);
#endif /* _LOG_H_ */
diff --git a/src/map/mail.c b/src/map/mail.c
index ffb3176c1..fa842b70f 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -175,7 +175,7 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
// This function only check if the mail operations are valid
bool mail_invalid_operation(struct map_session_data *sd)
{
- if( !map[sd->bl.m].flag.town && !pc_can_use_command(sd, "mail", COMMAND_ATCOMMAND) )
+ if( !map[sd->bl.m].flag.town && !pc_can_use_command(sd, "@mail") )
{
ShowWarning("clif->parse_Mail: char '%s' trying to do invalid mail operations.\n", sd->status.name);
return true;
diff --git a/src/map/map.c b/src/map/map.c
index 779070f0e..c65157cb2 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -48,6 +48,8 @@
#include "atcommand.h"
#include "log.h"
#include "mail.h"
+#include "irc-bot.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -413,7 +415,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
if( bl->type == BL_PC && ((TBL_PC*)bl)->shadowform_id ) {//Shadow Form Target Moving
struct block_list *d_bl;
- if( (d_bl = map_id2bl(((TBL_PC*)bl)->shadowform_id)) == NULL || bl->m != d_bl->m || !check_distance_bl(bl,d_bl,10) ) {
+ if( (d_bl = map_id2bl(((TBL_PC*)bl)->shadowform_id)) == NULL || !check_distance_bl(bl,d_bl,10) ) {
if( d_bl )
status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
((TBL_PC*)bl)->shadowform_id = 0;
@@ -438,7 +440,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
if( sc->data[SC__SHADOWFORM] ) {//Shadow Form Caster Moving
struct block_list *d_bl;
- if( (d_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2)) == NULL || bl->m != d_bl->m || !check_distance_bl(bl,d_bl,10) )
+ if( (d_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2)) == NULL || !check_distance_bl(bl,d_bl,10) )
status_change_end(bl,SC__SHADOWFORM,INVALID_TIMER);
}
@@ -1692,38 +1694,18 @@ int map_quit(struct map_session_data *sd) {
if( sd->state.storage_flag == 1 ) sd->state.storage_flag = 0; // No need to Double Save Storage on Quit.
+ if (sd->state.permanent_speed == 1) sd->state.permanent_speed = 0; // Remove lock so speed is set back to normal at login.
+
if( sd->ed ) {
elemental_clean_effect(sd->ed);
unit_remove_map(&sd->ed->bl,CLR_TELEPORT);
}
- if( hChSys.ally && sd->status.guild_id ) {
- struct guild *g = sd->guild, *sg;
- if( g ) {
- if( idb_exists(((struct hChSysCh *)g->channel)->users, sd->status.char_id) )
- clif->chsys_left((struct hChSysCh *)g->channel,sd);
- for (i = 0; i < MAX_GUILDALLIANCE; i++) {
- if( g->alliance[i].guild_id && (sg = guild_search(g->alliance[i].guild_id) ) ) {
- if( idb_exists(((struct hChSysCh *)sg->channel)->users, sd->status.char_id) )
- clif->chsys_left((struct hChSysCh *)sg->channel,sd);
- break;
- }
- }
- }
- }
-
if( hChSys.local && map[sd->bl.m].channel && idb_exists(map[sd->bl.m].channel->users, sd->status.char_id) ) {
clif->chsys_left(map[sd->bl.m].channel,sd);
}
- if( sd->channel_count ) {
- for( i = 0; i < sd->channel_count; i++ ) {
- if( sd->channels[i] != NULL )
- clif->chsys_left(sd->channels[i],sd);
- }
- if( hChSys.closing )
- aFree(sd->channels);
- }
+ clif->chsys_quit(sd);
unit_remove_map_pc(sd,CLR_TELEPORT);
@@ -2924,6 +2906,14 @@ void map_zone_db_clear(void) {
aFree(zone->mapflags[i]);
}
aFree(zone->mapflags);
+ for(i = 0; i < zone->disabled_commands_count; i++) {
+ aFree(zone->disabled_commands[i]);
+ }
+ aFree(zone->disabled_commands);
+ for(i = 0; i < zone->capped_skills_count; i++) {
+ aFree(zone->capped_skills[i]);
+ }
+ aFree(zone->capped_skills);
}
dbi_destroy(iter);
@@ -2939,6 +2929,14 @@ void map_zone_db_clear(void) {
aFree(map_zone_pk.mapflags[i]);
}
aFree(map_zone_pk.mapflags);
+ for(i = 0; i < map_zone_pk.disabled_commands_count; i++) {
+ aFree(map_zone_pk.disabled_commands[i]);
+ }
+ aFree(map_zone_pk.disabled_commands);
+ for(i = 0; i < map_zone_pk.capped_skills_count; i++) {
+ aFree(map_zone_pk.capped_skills[i]);
+ }
+ aFree(map_zone_pk.capped_skills);
/* clear the main zone stuff */
for(i = 0; i < map_zone_all.disabled_skills_count; i++) {
aFree(map_zone_all.disabled_skills[i]);
@@ -2949,6 +2947,14 @@ void map_zone_db_clear(void) {
aFree(map_zone_all.mapflags[i]);
}
aFree(map_zone_all.mapflags);
+ for(i = 0; i < map_zone_all.disabled_commands_count; i++) {
+ aFree(map_zone_all.disabled_commands[i]);
+ }
+ aFree(map_zone_all.disabled_commands);
+ for(i = 0; i < map_zone_all.capped_skills_count; i++) {
+ aFree(map_zone_all.capped_skills[i]);
+ }
+ aFree(map_zone_all.capped_skills);
}
void do_final_maps(void) {
@@ -3308,22 +3314,16 @@ int parse_console(const char* buf)
ShowNotice("Type of command: '%s' || Command: '%s' || Map: '%s' Coords: %d %d\n", type, command, map, x, y);
- if( n == 5 && strcmpi("admin",type) == 0 )
- {
- if( !is_atcommand(sd.fd, &sd, command, 0) )
+ if( n == 5 && strcmpi("admin",type) == 0 ) {
+ if( !atcommand->parse(sd.fd, &sd, command, 0) )
ShowInfo("Console: not atcommand\n");
- }
- else if( n == 2 && strcmpi("server", type) == 0 )
- {
- if( strcmpi("shutdown", command) == 0 || strcmpi("exit", command) == 0 || strcmpi("quit", command) == 0 )
- {
+ } else if( n == 2 && strcmpi("server", type) == 0 ) {
+ if( strcmpi("shutdown", command) == 0 || strcmpi("exit", command) == 0 || strcmpi("quit", command) == 0 ) {
runflag = 0;
}
- }
- else if( strcmpi("ers_report", type) == 0 )
+ } else if( strcmpi("ers_report", type) == 0 )
ers_report();
- else if( strcmpi("help", type) == 0 )
- {
+ else if( strcmpi("help", type) == 0 ) {
ShowInfo("To use GM commands:\n");
ShowInfo(" admin:<gm command>:<map of \"gm\"> <x> <y>\n");
ShowInfo("You can use any GM command that doesn't require the GM.\n");
@@ -3597,20 +3597,16 @@ int map_sql_close(void)
ShowStatus("Close Map DB Connection....\n");
Sql_Free(mmysql_handle);
mmysql_handle = NULL;
-#ifndef BETA_THREAD_TEST
- if (log_config.sql_logs)
- {
+ if (logs->config.sql_logs) {
ShowStatus("Close Log DB Connection....\n");
Sql_Free(logmysql_handle);
logmysql_handle = NULL;
}
-#endif
return 0;
}
int log_sql_init(void)
{
-#ifndef BETA_THREAD_TEST
// log db connection
logmysql_handle = Sql_Malloc();
@@ -3622,7 +3618,6 @@ int log_sql_init(void)
if( strlen(default_codepage) > 0 )
if ( SQL_ERROR == Sql_SetEncoding(logmysql_handle, default_codepage) )
Sql_ShowDebug(logmysql_handle);
-#endif
return 0;
}
void map_zone_change2(int m, struct map_zone_data *zone) {
@@ -4063,15 +4058,6 @@ bool map_zone_mf_cache(int m, char *flag, char *params) {
else if( map[m].flag.nightenabled )
map_zone_mf_cache_add(m,"nightenabled");
}
- } else if (!strcmpi(flag,"nogo")) {
- if( state && map[m].flag.nogo )
- ;/* nothing to do */
- else {
- if( state )
- map_zone_mf_cache_add(m,"nogo off");
- else if( map[m].flag.nogo )
- map_zone_mf_cache_add(m,"nogo");
- }
} else if (!strcmpi(flag,"noexp")) {
if( state && map[m].flag.nobaseexp )
;/* nothing to do */
@@ -4450,9 +4436,46 @@ void map_zone_init(void) {
}
}
-enum bl_type map_zone_bl_type(const char *entry) {
+unsigned short map_zone_str2itemid(const char *name) {
+ struct item_data *data;
+
+ if( !name )
+ return 0;
+ if( name[0] == 'I' && name[1] == 'D' && strlen(name) <= 7 ) {
+ if( !( data = itemdb_exists(atoi(name+2))) ) {
+ return 0;
+ }
+ } else {
+ if( !( data = itemdb_searchname(name) ) ) {
+ return 0;
+ }
+ }
+ return data->nameid;
+}
+unsigned short map_zone_str2skillid(const char *name) {
+ unsigned short nameid = 0;
+
+ if( !name )
+ return 0;
+
+ if( name[0] == 'I' && name[1] == 'D' && strlen(name) <= 7 ) {
+ if( !skill->get_index((nameid = atoi(name+2))) )
+ return 0;
+ } else {
+ if( !( nameid = strdb_iget(skilldb_name2id, name) ) ) {
+ return 0;
+ }
+ }
+ return nameid;
+}
+enum bl_type map_zone_bl_type(const char *entry, enum map_zone_skill_subtype *subtype) {
char temp[200], *parse;
enum bl_type bl = BL_NUL;
+ *subtype = MZS_NONE;
+
+ if( !entry )
+ return BL_NUL;
+
safestrncpy(temp, entry, 200);
parse = strtok(temp,"|");
@@ -4467,8 +4490,16 @@ enum bl_type map_zone_bl_type(const char *entry) {
bl |= BL_MER;
else if( strcmpi(parse,"monster") == 0 )
bl |= BL_MOB;
- else if( strcmpi(parse,"elemental") == 0 )
+ else if( strcmpi(parse,"clone") == 0 ) {
+ bl |= BL_MOB;
+ *subtype |= MZS_CLONE;
+ } else if( strcmpi(parse,"mob_boss") == 0 ) {
+ bl |= BL_MOB;
+ *subtype |= MZS_BOSS;
+ } else if( strcmpi(parse,"elemental") == 0 )
bl |= BL_ELEM;
+ else if( strcmpi(parse,"pet") == 0 )
+ bl |= BL_PET;
else if( strcmpi(parse,"all") == 0 )
bl |= BL_ALL;
else if( strcmpi(parse,"none") == 0 ) {
@@ -4480,6 +4511,7 @@ enum bl_type map_zone_bl_type(const char *entry) {
}
return bl;
}
+/* [Ind/Hercules] */
void read_map_zone_db(void) {
config_t map_zone_db;
config_setting_t *zones = NULL;
@@ -4496,15 +4528,18 @@ void read_map_zone_db(void) {
if (zones != NULL) {
struct map_zone_data *zone;
- struct item_data *data;
config_setting_t *zone_e;
config_setting_t *skills;
config_setting_t *items;
config_setting_t *mapflags;
+ config_setting_t *commands;
+ config_setting_t *caps;
const char *name;
const char *zonename;
int i,h,v;
- int zone_count = 0, disabled_skills_count = 0, disabled_items_count = 0, mapflags_count = 0;
+ int zone_count = 0, disabled_skills_count = 0, disabled_items_count = 0, mapflags_count = 0,
+ disabled_commands_count = 0, capped_skills_count = 0;
+ enum map_zone_skill_subtype subtype;
zone_count = config_setting_length(zones);
for (i = 0; i < zone_count; ++i) {
@@ -4530,7 +4565,7 @@ void read_map_zone_db(void) {
}
/* is this the global template? */
- if( strncmpi(zonename,MAP_ZONE_ALL_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
+ if( strncmpi(zonename,MAP_ZONE_NORMAL_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
zone = &map_zone_all;
is_all = true;
} else if( strncmpi(zonename,MAP_ZONE_PK_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
@@ -4549,14 +4584,14 @@ void read_map_zone_db(void) {
for(h = 0; h < config_setting_length(skills); h++) {
config_setting_t *skill = config_setting_get_elem(skills, h);
name = config_setting_name(skill);
- if( !strdb_exists(skilldb_name2id,name) ) {
+ if( !map_zone_str2skillid(name) ) {
ShowError("map_zone_db: unknown skill (%s) in disabled_skills for zone '%s', skipping skill...\n",name,zone->name);
config_setting_remove_elem(skills,h);
--disabled_skills_count;
--h;
continue;
}
- if( !map_zone_bl_type(config_setting_get_string_elem(skills,h)) )/* we dont remove it from the three due to inheritance */
+ if( !map_zone_bl_type(config_setting_get_string_elem(skills,h),&subtype) )/* we dont remove it from the three due to inheritance */
--disabled_skills_count;
}
/* all ok, process */
@@ -4567,11 +4602,12 @@ void read_map_zone_db(void) {
enum bl_type type;
name = config_setting_name(skill);
- if( (type = map_zone_bl_type(config_setting_get_string_elem(skills,h))) ) { /* only add if enabled */
+ if( (type = map_zone_bl_type(config_setting_get_string_elem(skills,h),&subtype)) ) { /* only add if enabled */
CREATE( entry, struct map_zone_disabled_skill_entry, 1 );
- entry->nameid = strdb_iget(skilldb_name2id, name);
+ entry->nameid = map_zone_str2skillid(name);
entry->type = type;
+ entry->subtype = subtype;
zone->disabled_skills[v++] = entry;
}
@@ -4586,8 +4622,7 @@ void read_map_zone_db(void) {
for(h = 0; h < config_setting_length(items); h++) {
config_setting_t *item = config_setting_get_elem(items, h);
name = config_setting_name(item);
- data = itemdb_searchname(name);
- if( data == NULL ) {
+ if( !map_zone_str2itemid(name) ) {
ShowError("map_zone_db: unknown item (%s) in disabled_items for zone '%s', skipping item...\n",name,zone->name);
config_setting_remove_elem(items,h);
--disabled_items_count;
@@ -4604,8 +4639,7 @@ void read_map_zone_db(void) {
if( config_setting_get_bool(item) ) { /* only add if enabled */
name = config_setting_name(item);
- data = itemdb_searchname(name);
- zone->disabled_items[v++] = data->nameid;
+ zone->disabled_items[v++] = map_zone_str2itemid(name);
}
}
@@ -4627,105 +4661,256 @@ void read_map_zone_db(void) {
zone->mapflags_count = mapflags_count;
}
+ if( (commands = config_setting_get_member(zone_e, "disabled_commands")) != NULL ) {
+ disabled_commands_count = config_setting_length(commands);
+ /* validate */
+ for(h = 0; h < config_setting_length(commands); h++) {
+ config_setting_t *command = config_setting_get_elem(commands, h);
+ name = config_setting_name(command);
+ if( !atcommand->exists(name) ) {
+ ShowError("map_zone_db: unknown command '%s' in disabled_commands for zone '%s', skipping entry...\n",name,zone->name);
+ config_setting_remove_elem(commands,h);
+ --disabled_commands_count;
+ --h;
+ continue;
+ }
+ if( !config_setting_get_int(command) )/* we dont remove it from the three due to inheritance */
+ --disabled_commands_count;
+ }
+ /* all ok, process */
+ CREATE( zone->disabled_commands, struct map_zone_disabled_command_entry *, disabled_commands_count );
+ for(h = 0, v = 0; h < config_setting_length(commands); h++) {
+ config_setting_t *command = config_setting_get_elem(commands, h);
+ struct map_zone_disabled_command_entry * entry;
+ int group_lv;
+ name = config_setting_name(command);
+
+ if( (group_lv = config_setting_get_int(command)) ) { /* only add if enabled */
+ CREATE( entry, struct map_zone_disabled_command_entry, 1 );
+
+ entry->cmd = atcommand->exists(name)->func;
+ entry->group_lv = group_lv;
+
+ zone->disabled_commands[v++] = entry;
+ }
+ }
+ zone->disabled_commands_count = disabled_commands_count;
+ }
+
+ if( (caps = config_setting_get_member(zone_e, "skill_damage_cap")) != NULL ) {
+ capped_skills_count = config_setting_length(caps);
+ /* validate */
+ for(h = 0; h < config_setting_length(caps); h++) {
+ config_setting_t *cap = config_setting_get_elem(caps, h);
+ name = config_setting_name(cap);
+ if( !map_zone_str2skillid(name) ) {
+ ShowError("map_zone_db: unknown skill (%s) in skill_damage_cap for zone '%s', skipping skill...\n",name,zone->name);
+ config_setting_remove_elem(caps,h);
+ --capped_skills_count;
+ --h;
+ continue;
+ }
+ if( !map_zone_bl_type(config_setting_get_string_elem(cap,1),&subtype) )/* we dont remove it from the three due to inheritance */
+ --capped_skills_count;
+ }
+ /* all ok, process */
+ CREATE( zone->capped_skills, struct map_zone_skill_damage_cap_entry *, capped_skills_count );
+ for(h = 0, v = 0; h < config_setting_length(caps); h++) {
+ config_setting_t *cap = config_setting_get_elem(caps, h);
+ struct map_zone_skill_damage_cap_entry * entry;
+ enum bl_type type;
+ name = config_setting_name(cap);
+
+ if( (type = map_zone_bl_type(config_setting_get_string_elem(cap,1),&subtype)) ) { /* only add if enabled */
+ CREATE( entry, struct map_zone_skill_damage_cap_entry, 1 );
+
+ entry->nameid = map_zone_str2skillid(name);
+ entry->cap = config_setting_get_int_elem(cap,0);
+ entry->type = type;
+ entry->subtype = subtype;
+ zone->capped_skills[v++] = entry;
+ }
+ }
+ zone->capped_skills_count = capped_skills_count;
+ }
if( !is_all ) /* global template doesn't go into db -- since it isn't a alloc'd piece of data */
strdb_put(zone_db, zonename, zone);
}
-
+
/* process inheritance, aka loop through the whole thing again :P */
for (i = 0; i < zone_count; ++i) {
config_setting_t *inherit_tree = NULL;
+ config_setting_t *new_entry = NULL;
+ int inherit_count;
zone_e = config_setting_get_elem(zones, i);
+ config_setting_lookup_string(zone_e, "name", &zonename);
+
+ if( strncmpi(zonename,MAP_ZONE_ALL_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
+ continue;/* all zone doesn't inherit anything (if it did, everything would link to each other and boom endless loop) */
+ }
if( (inherit_tree = config_setting_get_member(zone_e, "inherit")) != NULL ) {
- int inherit_count = config_setting_length(inherit_tree);
- for(h = 0; h < inherit_count; h++) {
- struct map_zone_data *izone; /* inherit zone */
- int disabled_skills_count_i = 0; /* disabled skill count from inherit zone */
- int disabled_items_count_i = 0; /* disabled item count from inherit zone */
- int mapflags_count_i = 0; /* mapflag count from inherit zone */
- int j;
-
- name = config_setting_get_string_elem(inherit_tree, h);
- config_setting_lookup_string(zone_e, "name", &zonename);/* will succeed for we validated it earlier */
-
- if( !(izone = strdb_get(zone_db, name)) ) {
- ShowError("map_zone_db: Unknown zone '%s' being inherit by zone '%s', skipping...\n",name,zonename);
- continue;
- }
-
+ /* append global zone to this */
+ new_entry = config_setting_add(inherit_tree,MAP_ZONE_ALL_NAME,CONFIG_TYPE_STRING);
+ config_setting_set_string(new_entry,MAP_ZONE_ALL_NAME);
+ } else {
+ /* create inherit member and add global zone to it */
+ inherit_tree = config_setting_add(zone_e, "inherit",CONFIG_TYPE_ARRAY);
+ new_entry = config_setting_add(inherit_tree,MAP_ZONE_ALL_NAME,CONFIG_TYPE_STRING);
+ config_setting_set_string(new_entry,MAP_ZONE_ALL_NAME);
+ }
+ inherit_count = config_setting_length(inherit_tree);
+ for(h = 0; h < inherit_count; h++) {
+ struct map_zone_data *izone; /* inherit zone */
+ int disabled_skills_count_i = 0; /* disabled skill count from inherit zone */
+ int disabled_items_count_i = 0; /* disabled item count from inherit zone */
+ int mapflags_count_i = 0; /* mapflag count from inherit zone */
+ int disabled_commands_count_i = 0; /* commands count from inherit zone */
+ int capped_skills_count_i = 0; /* skill capped count from inherit zone */
+ int j;
+
+ name = config_setting_get_string_elem(inherit_tree, h);
+ config_setting_lookup_string(zone_e, "name", &zonename);/* will succeed for we validated it earlier */
+
+ if( !(izone = strdb_get(zone_db, name)) ) {
+ ShowError("map_zone_db: Unknown zone '%s' being inherit by zone '%s', skipping...\n",name,zonename);
+ continue;
+ }
+
+ if( strncmpi(zonename,MAP_ZONE_NORMAL_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
+ zone = &map_zone_all;
+ } else if( strncmpi(zonename,MAP_ZONE_PK_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
+ zone = &map_zone_pk;
+ } else
zone = strdb_get(zone_db, zonename);/* will succeed for we just put it in here */
-
- disabled_skills_count_i = izone->disabled_skills_count;
- disabled_items_count_i = izone->disabled_items_count;
- mapflags_count_i = izone->mapflags_count;
-
- /* process everything to override, paying attention to config_setting_get_bool */
- if( (skills = config_setting_get_member(zone_e, "disabled_skills")) != NULL ) {
- disabled_skills_count = config_setting_length(skills);
- for(j = 0; j < disabled_skills_count_i; j++) {
- int k;
- for(k = 0; k < disabled_skills_count; k++) {
- config_setting_t *skill = config_setting_get_elem(skills, k);
- if( strdb_iget(skilldb_name2id, config_setting_name(skill)) == izone->disabled_skills[j]->nameid ) {
- break;
- }
+
+ disabled_skills_count_i = izone->disabled_skills_count;
+ disabled_items_count_i = izone->disabled_items_count;
+ mapflags_count_i = izone->mapflags_count;
+ disabled_commands_count_i = izone->disabled_commands_count;
+ capped_skills_count_i = izone->capped_skills_count;
+
+ /* process everything to override, paying attention to config_setting_get_bool */
+ if( disabled_skills_count_i ) {
+ if( (skills = config_setting_get_member(zone_e, "disabled_skills")) == NULL )
+ skills = config_setting_add(zone_e, "disabled_skills",CONFIG_TYPE_GROUP);
+ disabled_skills_count = config_setting_length(skills);
+ for(j = 0; j < disabled_skills_count_i; j++) {
+ int k;
+ for(k = 0; k < disabled_skills_count; k++) {
+ config_setting_t *skill = config_setting_get_elem(skills, k);
+ if( map_zone_str2skillid(config_setting_name(skill)) == izone->disabled_skills[j]->nameid ) {
+ break;
}
- if( k == disabled_skills_count ) {/* we didn't find it */
- struct map_zone_disabled_skill_entry *entry;
- RECREATE( zone->disabled_skills, struct map_zone_disabled_skill_entry *, ++zone->disabled_skills_count );
- CREATE( entry, struct map_zone_disabled_skill_entry, 1 );
- entry->nameid = izone->disabled_skills[j]->nameid;
- entry->type = izone->disabled_skills[j]->type;
- zone->disabled_skills[zone->disabled_skills_count-1] = entry;
+ }
+ if( k == disabled_skills_count ) {/* we didn't find it */
+ struct map_zone_disabled_skill_entry *entry;
+ RECREATE( zone->disabled_skills, struct map_zone_disabled_skill_entry *, ++zone->disabled_skills_count );
+ CREATE( entry, struct map_zone_disabled_skill_entry, 1 );
+ entry->nameid = izone->disabled_skills[j]->nameid;
+ entry->type = izone->disabled_skills[j]->type;
+ zone->disabled_skills[zone->disabled_skills_count-1] = entry;
+ }
+ }
+ }
+
+ if( disabled_items_count_i ) {
+ if( (items = config_setting_get_member(zone_e, "disabled_items")) == NULL )
+ items = config_setting_add(zone_e, "disabled_items",CONFIG_TYPE_GROUP);
+ disabled_items_count = config_setting_length(items);
+ for(j = 0; j < disabled_items_count_i; j++) {
+ int k;
+ for(k = 0; k < disabled_items_count; k++) {
+ config_setting_t *item = config_setting_get_elem(items, k);
+
+ name = config_setting_name(item);
+
+ if( map_zone_str2itemid(name) == izone->disabled_items[j] ) {
+ if( config_setting_get_bool(item) )
+ continue;
+ break;
}
}
+ if( k == disabled_items_count ) {/* we didn't find it */
+ RECREATE( zone->disabled_items, int, ++zone->disabled_items_count );
+ zone->disabled_items[zone->disabled_items_count-1] = izone->disabled_items[j];
+ }
}
-
- if( (items = config_setting_get_member(zone_e, "disabled_items")) != NULL ) {
- disabled_items_count = config_setting_length(items);
- for(j = 0; j < disabled_items_count_i; j++) {
- int k;
- for(k = 0; k < disabled_items_count; k++) {
- config_setting_t *item = config_setting_get_elem(items, k);
-
- name = config_setting_name(item);
- data = itemdb_searchname(name);
-
- if( data->nameid == izone->disabled_items[j] ) {
- if( config_setting_get_bool(item) )
- continue;
- break;
- }
+ }
+
+ if( mapflags_count_i ) {
+ if( (mapflags = config_setting_get_member(zone_e, "mapflags")) == NULL )
+ mapflags = config_setting_add(zone_e, "mapflags",CONFIG_TYPE_ARRAY);
+ mapflags_count = config_setting_length(mapflags);
+ for(j = 0; j < mapflags_count_i; j++) {
+ int k;
+ for(k = 0; k < mapflags_count; k++) {
+ name = config_setting_get_string_elem(mapflags, k);
+
+ if( strcmpi(name,izone->mapflags[j]) == 0 ) {
+ break;
}
- if( k == disabled_items_count ) {/* we didn't find it */
- RECREATE( zone->disabled_items, int, ++zone->disabled_items_count );
- zone->disabled_items[zone->disabled_items_count-1] = izone->disabled_items[j];
+ }
+ if( k == mapflags_count ) {/* we didn't find it */
+ RECREATE( zone->mapflags, char*, ++zone->mapflags_count );
+ CREATE( zone->mapflags[zone->mapflags_count-1], char, MAP_ZONE_MAPFLAG_LENGTH );
+ safestrncpy(zone->mapflags[zone->mapflags_count-1], izone->mapflags[j], MAP_ZONE_MAPFLAG_LENGTH);
+ }
+ }
+ }
+
+ if( disabled_commands_count_i ) {
+ if( (commands = config_setting_get_member(zone_e, "disabled_commands")) == NULL )
+ commands = config_setting_add(zone_e, "disabled_commands",CONFIG_TYPE_GROUP);
+
+ disabled_commands_count = config_setting_length(commands);
+ for(j = 0; j < disabled_commands_count_i; j++) {
+ int k;
+ for(k = 0; k < disabled_commands_count; k++) {
+ config_setting_t *command = config_setting_get_elem(commands, k);
+ if( atcommand->exists(config_setting_name(command))->func == izone->disabled_commands[j]->cmd ) {
+ break;
}
}
+ if( k == disabled_commands_count ) {/* we didn't find it */
+ struct map_zone_disabled_command_entry *entry;
+ RECREATE( zone->disabled_commands, struct map_zone_disabled_command_entry *, ++zone->disabled_commands_count );
+ CREATE( entry, struct map_zone_disabled_command_entry, 1 );
+ entry->cmd = izone->disabled_commands[j]->cmd;
+ entry->group_lv = izone->disabled_commands[j]->group_lv;
+ zone->disabled_commands[zone->disabled_commands_count-1] = entry;
+ }
}
+ }
+
+ if( capped_skills_count_i ) {
+ if( (caps = config_setting_get_member(zone_e, "skill_damage_cap")) == NULL )
+ caps = config_setting_add(zone_e, "skill_damage_cap",CONFIG_TYPE_GROUP);
- if( (mapflags = config_setting_get_member(zone_e, "mapflags")) != NULL ) {
- mapflags_count = config_setting_length(mapflags);
- for(j = 0; j < mapflags_count_i; j++) {
- int k;
- for(k = 0; k < mapflags_count; k++) {
- name = config_setting_get_string_elem(mapflags, k);
-
- if( strcmpi(name,izone->mapflags[j]) == 0 ) {
- break;
- }
- }
- if( k == mapflags_count ) {/* we didn't find it */
- RECREATE( zone->mapflags, char*, ++zone->mapflags_count );
- CREATE( zone->mapflags[zone->mapflags_count-1], char, MAP_ZONE_MAPFLAG_LENGTH );
- safestrncpy(zone->mapflags[zone->mapflags_count-1], izone->mapflags[j], MAP_ZONE_MAPFLAG_LENGTH);
+ capped_skills_count = config_setting_length(caps);
+ for(j = 0; j < capped_skills_count_i; j++) {
+ int k;
+ for(k = 0; k < capped_skills_count; k++) {
+ config_setting_t *cap = config_setting_get_elem(caps, k);
+ if( map_zone_str2skillid(config_setting_name(cap)) == izone->capped_skills[j]->nameid ) {
+ break;
}
}
+ if( k == capped_skills_count ) {/* we didn't find it */
+ struct map_zone_skill_damage_cap_entry *entry;
+ RECREATE( zone->capped_skills, struct map_zone_skill_damage_cap_entry *, ++zone->capped_skills_count );
+ CREATE( entry, struct map_zone_skill_damage_cap_entry, 1 );
+ entry->nameid = izone->capped_skills[j]->nameid;
+ entry->cap = izone->capped_skills[j]->cap;
+ entry->type = izone->capped_skills[j]->type;
+ zone->capped_skills[zone->capped_skills_count-1] = entry;
+ }
}
}
+
}
}
@@ -4835,9 +5020,10 @@ void do_final(void)
chrif_char_reset_offline();
chrif_flush_fifo();
- do_final_atcommand();
+ atcommand->final();
battle->final();
do_final_chrif();
+ ircbot->final();/* before clif. */
clif->final();
do_final_npc();
do_final_script();
@@ -4849,7 +5035,7 @@ void do_final(void)
do_final_pc();
do_final_pet();
do_final_mob();
- do_final_msg();
+ atcommand->final_msg();
skill->final();
do_final_status();
do_final_unit();
@@ -4857,6 +5043,7 @@ void do_final(void)
do_final_duel();
do_final_elemental();
do_final_maps();
+ vending->final();
map_db->destroy(map_db, map_db_final);
@@ -4983,7 +5170,17 @@ static bool map_arg_next_value(const char* option, int i, int argc)
return true;
}
-
+void load_defaults(void) {
+ atcommand_defaults();
+ battle_defaults();
+ buyingstore_defaults();
+ clif_defaults();
+ ircbot_defaults();
+ log_defaults();
+ searchstore_defaults();
+ skill_defaults();
+ vending_defaults();
+}
int do_init(int argc, char *argv[])
{
int i;
@@ -5088,10 +5285,8 @@ int do_init(int argc, char *argv[])
exit(EXIT_FAILURE);
}
}
-
- battle_defaults();
- clif_defaults();
- skill_defaults();
+
+ load_defaults();
map_config_read(MAP_CONF_NAME);
// loads npcs
@@ -5119,10 +5314,10 @@ int do_init(int argc, char *argv[])
}
battle->config_read(BATTLE_CONF_FILENAME);
- msg_config_read(MSG_CONF_NAME);
+ atcommand->msg_read(MSG_CONF_NAME);
script_config_read(SCRIPT_CONF_NAME);
inter_config_read(INTER_CONF_NAME);
- log_config_read(LOG_CONF_NAME);
+ logs->config_read(LOG_CONF_NAME);
id_db = idb_alloc(DB_OPT_BASE);
pc_db = idb_alloc(DB_OPT_BASE); //Added for reliable map_id2sd() use. [Skotlex]
@@ -5138,7 +5333,7 @@ int do_init(int argc, char *argv[])
map_sql_init();
- if (log_config.sql_logs)
+ if (logs->config.sql_logs)
log_sql_init();
mapindex_init();
@@ -5152,11 +5347,12 @@ int do_init(int argc, char *argv[])
add_timer_func_list(map_removemobs_timer, "map_removemobs_timer");
add_timer_interval(gettick()+1000, map_freeblock_timer, 0, 0, 60*1000);
- do_init_atcommand();
+ atcommand->init();
battle->init();
do_init_instance();
do_init_chrif();
clif->init();
+ ircbot->init();
do_init_script();
do_init_itemdb();
skill->init();
@@ -5176,6 +5372,7 @@ int do_init(int argc, char *argv[])
do_init_unit();
do_init_battleground();
do_init_duel();
+ vending->init();
npc_event_do_oninit(); // Init npcs (OnInit)
diff --git a/src/map/map.h b/src/map/map.h
index dd0a47aaf..ae60b810c 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -13,6 +13,8 @@
#include "../config/core.h"
+#include "atcommand.h"
+
#include <stdarg.h>
struct npc_data;
@@ -106,7 +108,7 @@ enum {
MAPID_ASSASSIN,
MAPID_STAR_GLADIATOR,
MAPID_KAGEROUOBORO = JOBL_2_1|0x0A,
- MAPID_DEATH_KNIGHT = JOBL_2_1|0x0D,
+ MAPID_DEATH_KNIGHT = JOBL_2_1|0x0E,
//2-2 Jobs
MAPID_CRUSADER = JOBL_2_2|0x1,
MAPID_SAGE,
@@ -497,13 +499,35 @@ struct mapflag_skill_adjust {
unsigned short skill_id;
unsigned short modifier;
};
+
+enum map_zone_skill_subtype {
+ MZS_NONE = 0x0,
+ MZS_CLONE = 0x01,
+ MZS_BOSS = 0x02,
+
+ MZS_ALL = 0xFFF,
+};
+
struct map_zone_disabled_skill_entry {
unsigned short nameid;
enum bl_type type;
+ enum map_zone_skill_subtype subtype;
+};
+struct map_zone_disabled_command_entry {
+ AtCommandFunc cmd;
+ int group_lv;
+};
+
+struct map_zone_skill_damage_cap_entry {
+ unsigned short nameid;
+ unsigned int cap;
+ enum bl_type type;
+ enum map_zone_skill_subtype subtype;
};
#define MAP_ZONE_NAME_LENGTH 30
-#define MAP_ZONE_ALL_NAME "Normal"
+#define MAP_ZONE_ALL_NAME "All"
+#define MAP_ZONE_NORMAL_NAME "Normal"
#define MAP_ZONE_PVP_NAME "PvP"
#define MAP_ZONE_GVG_NAME "GvG"
#define MAP_ZONE_BG_NAME "Battlegrounds"
@@ -518,6 +542,10 @@ struct map_zone_data {
int disabled_items_count;
char **mapflags;
int mapflags_count;
+ struct map_zone_disabled_command_entry **disabled_commands;
+ int disabled_commands_count;
+ struct map_zone_skill_damage_cap_entry **capped_skills;
+ int capped_skills_count;
};
void map_zone_init(void);
void map_zone_remove(int m);
@@ -577,7 +605,6 @@ struct map_data {
unsigned fireworks : 1;
unsigned sakura : 1; // [Valaris]
unsigned leaves : 1; // [Valaris]
- unsigned nogo : 1; // [Valaris]
unsigned nobaseexp : 1; // [Lorky] added by Lupus
unsigned nojobexp : 1; // [Lorky]
unsigned nomobloot : 1; // [Lorky]
@@ -823,24 +850,6 @@ typedef struct elemental_data TBL_ELEM;
#define BL_CAST(type_, bl) \
( ((bl) == (struct block_list*)NULL || (bl)->type != (type_)) ? (T ## type_ *)NULL : (T ## type_ *)(bl) )
-
-#ifdef BETA_THREAD_TEST
-
-extern char default_codepage[32];
-extern int map_server_port;
-extern char map_server_ip[32];
-extern char map_server_id[32];
-extern char map_server_pw[32];
-extern char map_server_db[32];
-
-extern char log_db_ip[32];
-extern int log_db_port;
-extern char log_db_id[32];
-extern char log_db_pw[32];
-extern char log_db_db[32];
-
-#endif
-
#include "../common/sql.h"
extern int db_use_sqldbs;
diff --git a/src/map/mob.c b/src/map/mob.c
index 6a507a099..f68f85455 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -875,8 +875,8 @@ int mob_setdelayspawn(struct mob_data *md)
spawntime = spawntime/100*battle_config.mob_spawn_delay;
}
- if (spawntime < 500) //Min respawn time (is it needed?)
- spawntime = 500;
+ if (spawntime < 5000) //Monsters should never respawn faster than within 5 seconds
+ spawntime = 5000;
if( md->spawn_timer != INVALID_TIMER )
delete_timer(md->spawn_timer, mob_delayspawn);
@@ -1602,7 +1602,7 @@ static bool mob_ai_sub_hard(struct mob_data *md, unsigned int tick)
fitem = (struct flooritem_data *)tbl;
//Logs items, taken by (L)ooter Mobs [Lupus]
- log_pick_mob(md, LOG_TYPE_LOOT, fitem->item_data.amount, &fitem->item_data);
+ logs->pick_mob(md, LOG_TYPE_LOOT, fitem->item_data.amount, &fitem->item_data, NULL);
if (md->lootitem_count < LOOTITEM_SIZE) {
memcpy (&md->lootitem[md->lootitem_count++], &fitem->item_data, sizeof(md->lootitem[0]));
@@ -1789,13 +1789,12 @@ static int mob_ai_hard(int tid, unsigned int tick, int id, intptr_t data)
/*==========================================
* Initializes the delay drop structure for mob-dropped items.
*------------------------------------------*/
-static struct item_drop* mob_setdropitem(int nameid, int qty)
-{
+static struct item_drop* mob_setdropitem(int nameid, int qty, struct item_data *data) {
struct item_drop *drop = ers_alloc(item_drop_ers, struct item_drop);
memset(&drop->item_data, 0, sizeof(struct item));
drop->item_data.nameid = nameid;
drop->item_data.amount = qty;
- drop->item_data.identify = itemdb_isidentified(nameid);
+ drop->item_data.identify = data ? itemdb_isidentified2(data) : itemdb_isidentified(nameid);
drop->next = NULL;
return drop;
}
@@ -1843,7 +1842,7 @@ static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, str
TBL_PC* sd;
//Logs items, dropped by mobs [Lupus]
- log_pick_mob(md, loot?LOG_TYPE_LOOT:LOG_TYPE_PICKDROP_MONSTER, -ditem->item_data.amount, &ditem->item_data);
+ logs->pick_mob(md, loot?LOG_TYPE_LOOT:LOG_TYPE_PICKDROP_MONSTER, -ditem->item_data.amount, &ditem->item_data, NULL);
sd = map_charid2sd(dlist->first_charid);
if( sd == NULL ) sd = map_charid2sd(dlist->second_charid);
@@ -2038,8 +2037,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
return;
}
//Call when a mob has received damage.
-void mob_damage(struct mob_data *md, struct block_list *src, int damage)
-{
+void mob_damage(struct mob_data *md, struct block_list *src, int damage) {
if (damage > 0) { //Store total damage...
if (UINT_MAX - (unsigned int)damage > md->tdmg)
md->tdmg+=damage;
@@ -2069,14 +2067,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
return;
#if PACKETVER >= 20120404
- if( !(md->status.mode&MD_BOSS) ){
- int i;
- for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob.
- struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
- if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
- clif->monster_hp_bar(md, sd->fd);
- }
- }
+ clif->monster_hp_bar(md);
#endif
if( md->special_state.ai == 2 ) {//LOne WOlf explained that ANYONE can trigger the marine countdown skill. [Skotlex]
@@ -2383,7 +2374,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
continue;
}
- ditem = mob_setdropitem(md->db->dropitem[i].nameid, 1);
+ ditem = mob_setdropitem(md->db->dropitem[i].nameid, 1, it);
//A Rare Drop Global Announce by Lupus
if( mvp_sd && drop_rate <= battle_config.rare_drop_announce ) {
@@ -2399,7 +2390,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
// Ore Discovery [Celest]
if (sd == mvp_sd && pc_checkskill(sd,BS_FINDINGORE)>0 && battle_config.finding_ore_rate/10 >= rnd()%10000) {
- ditem = mob_setdropitem(itemdb_searchrandomid(IG_FINDINGORE), 1);
+ ditem = mob_setdropitem(itemdb_searchrandomid(IG_FINDINGORE), 1, NULL);
mob_item_drop(md, dlist, ditem, 0, battle_config.finding_ore_rate/10, homkillonly);
}
@@ -2429,7 +2420,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if (rnd()%10000 >= drop_rate)
continue;
itemid = (sd->add_drop[i].id > 0) ? sd->add_drop[i].id : itemdb_searchrandomid(sd->add_drop[i].group);
- mob_item_drop(md, dlist, mob_setdropitem(itemid,1), 0, drop_rate, homkillonly);
+ mob_item_drop(md, dlist, mob_setdropitem(itemid,1,NULL), 0, drop_rate, homkillonly);
}
}
@@ -2505,9 +2496,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
for(i = 0; i < MAX_MVP_DROP; i++) {
+ struct item_data *data;
if(mdrop_id[i] <= 0)
continue;
- if(!itemdb_exists(mdrop_id[i]))
+ if(! (data = itemdb_exists(mdrop_id[i])) )
continue;
temp = mdrop_p[i];
@@ -2518,16 +2510,14 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
memset(&item,0,sizeof(item));
item.nameid=mdrop_id[i];
- item.identify= itemdb_isidentified(item.nameid);
+ item.identify= itemdb_isidentified2(data);
clif->mvp_item(mvp_sd,item.nameid);
log_mvp[0] = item.nameid;
//A Rare MVP Drop Global Announce by Lupus
if(temp<=battle_config.rare_drop_announce) {
- struct item_data *i_data;
char message[128];
- i_data = itemdb_exists(item.nameid);
- sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, temp/100.);
+ sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, data->jname, temp/100.);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,0);
}
@@ -2538,12 +2528,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
//Logs items, MVP prizes [Lupus]
- log_pick_mob(md, LOG_TYPE_MVP, -1, &item);
+ logs->pick_mob(md, LOG_TYPE_MVP, -1, &item, data);
break;
}
}
- log_mvpdrop(mvp_sd, md->class_, log_mvp);
+ logs->mvpdrop(mvp_sd, md->class_, log_mvp);
}
if (type&2 && !sd && md->class_ == MOBID_EMPERIUM)
@@ -2634,8 +2624,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if (battle_config.mvp_tomb_enabled && md->spawn->state.boss)
mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
- if( !rebirth )
+ if( !rebirth ) {
+ status_change_clear(&md->bl,1);
mob_setdelayspawn(md); //Set respawning.
+ }
return 3; //Remove from map.
}
@@ -3335,7 +3327,7 @@ int mob_is_clone(int class_)
int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, int mode, int flag, unsigned int duration)
{
int class_;
- int i,j,inf,skill_id, fd;
+ int i,j,h,inf,skill_id, fd;
struct mob_data *md;
struct mob_skill *ms;
struct mob_db* db;
@@ -3389,9 +3381,16 @@ int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, cons
for (i=0,j = MAX_SKILL_TREE-1;j>=0 && i< MAX_MOBSKILL ;j--) {
skill_id = skill_tree[pc_class2idx(sd->status.class_)][j].id;
if (!skill_id || sd->status.skill[skill_id].lv < 1 ||
- (skill->get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL|INF2_CLONE_NOCOPY))
+ (skill->get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL))
)
continue;
+ for(h = 0; h < map[sd->bl.m].zone->disabled_skills_count; h++) {
+ if( skill_id == map[sd->bl.m].zone->disabled_skills[h]->nameid && map[sd->bl.m].zone->disabled_skills[h]->subtype == MZS_CLONE ) {
+ break;
+ }
+ }
+ if( h < map[sd->bl.m].zone->disabled_skills_count )
+ continue;
//Normal aggressive mob, disable skills that cannot help them fight
//against players (those with flags UF_NOMOB and UF_NOPC are specific
//to always aid players!) [Skotlex]
@@ -4013,8 +4012,8 @@ static int mob_read_randommonster(void)
memset(&summon, 0, sizeof(summon));
- for( i = 0; i < ARRAYLENGTH(mobfile) && i < MAX_RANDOMMONSTER; i++ )
- {
+ for( i = 0; i < ARRAYLENGTH(mobfile) && i < MAX_RANDOMMONSTER; i++ ) {
+ unsigned int count = 0;
mob_db_data[0]->summonper[i] = 1002; // Default fallback value, in case the database does not provide one
sprintf(line, "%s/%s", db_path, mobfile[i]);
fp=fopen(line,"r");
@@ -4040,6 +4039,7 @@ static int mob_read_randommonster(void)
class_ = atoi(str[0]);
if(mob_db(class_) == mob_dummy)
continue;
+ count++;
mob_db_data[class_]->summonper[i]=atoi(str[2]);
if (i) {
if( summon[i].qty < ARRAYLENGTH(summon[i].class_) ) //MvPs
@@ -4050,13 +4050,12 @@ static int mob_read_randommonster(void)
}
}
}
- if (i && !summon[i].qty)
- { //At least have the default here.
+ if (i && !summon[i].qty) { //At least have the default here.
summon[i].class_[0] = mob_db_data[0]->summonper[i];
summon[i].qty = 1;
}
fclose(fp);
- ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n",mobfile[i]);
+ ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n",count,mobfile[i]);
}
return 0;
}
@@ -4173,7 +4172,7 @@ static void mob_readchatdb(void)
count++;
}
fclose(fp);
- ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n", arc);
+ ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, arc);
}
/*==========================================
diff --git a/src/map/npc.c b/src/map/npc.c
index aa44d8840..dee5f4f50 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -96,6 +96,7 @@ static DBMap *npc_path_db;
//For holding the view data of npc classes. [Skotlex]
static struct view_data npc_viewdb[MAX_NPC_CLASS];
+static struct view_data npc_viewdb2[MAX_NPC_CLASS2_END-MAX_NPC_CLASS2_START];
static struct script_event_s
{ //Holds pointers to the commonly executed scripts for speedup. [Skotlex]
@@ -108,8 +109,13 @@ struct view_data* npc_get_viewdata(int class_)
{ //Returns the viewdata for normal npc classes.
if( class_ == INVISIBLE_CLASS )
return &npc_viewdb[0];
- if (npcdb_checkid(class_) || class_ == WARP_CLASS)
- return &npc_viewdb[class_];
+ if (npcdb_checkid(class_) || class_ == WARP_CLASS){
+ if( class_ > MAX_NPC_CLASS2_START ){
+ return &npc_viewdb2[class_-MAX_NPC_CLASS2_START];
+ }else{
+ return &npc_viewdb[class_];
+ }
+ }
return NULL;
}
@@ -234,17 +240,29 @@ struct npc_data* npc_name2id(const char* name)
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
/**
* Timer to check for idle time and timeout the dialog if necessary
**/
int npc_rr_secure_timeout_timer(int tid, unsigned int tick, int id, intptr_t data) {
struct map_session_data* sd = NULL;
+ unsigned int timeout = NPC_SECURE_TIMEOUT_NEXT;
if( (sd = map_id2sd(id)) == NULL || !sd->npc_id ) {
if( sd ) sd->npc_idle_timer = INVALID_TIMER;
return 0;//Not logged in anymore OR no longer attached to a npc
}
- if( DIFF_TICK(tick,sd->npc_idle_tick) > (SECURE_NPCTIMEOUT*1000) ) {
+
+ switch( sd->npc_idle_type ) {
+ case NPCT_INPUT:
+ timeout = NPC_SECURE_TIMEOUT_INPUT;
+ break;
+ case NPCT_MENU:
+ timeout = NPC_SECURE_TIMEOUT_MENU;
+ break;
+ //case NPCT_WAIT: var starts with this value
+ }
+
+ if( DIFF_TICK(tick,sd->npc_idle_tick) > (timeout*1000) ) {
/**
* If we still have the NPC script attached, tell it to stop.
**/
@@ -1234,7 +1252,7 @@ int npc_scriptcont(struct map_session_data* sd, int id, bool closing)
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
/**
* Update the last NPC iteration
**/
@@ -2133,6 +2151,11 @@ static const char* npc_parse_warp(char* w1, char* w2, char* w3, char* w4, const
return strchr(start,'\n');// skip and continue
}
+ if( m != -1 && ( x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys ) ) {
+ ShowError("npc_parse_warp: out-of-bounds coordinates (\"%s\",%d,%d), map is %dx%d, in file '%s', line '%d'\n", map[m].name, x, y, map[m].xs, map[m].ys,filepath,strline(buffer,start-buffer));
+ return strchr(start,'\n');;//try next
+ }
+
CREATE(nd, struct npc_data, 1);
nd->bl.id = npc_get_new_npc_id();
@@ -2180,13 +2203,10 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
struct npc_data *nd;
enum npc_subtype type;
- if( strcmp(w1,"-") == 0 )
- {// 'floating' shop?
+ if( strcmp(w1,"-") == 0 ) {// 'floating' shop?
x = y = dir = 0;
m = -1;
- }
- else
- {// w1=<map name>,<x>,<y>,<facing>
+ } else {// w1=<map name>,<x>,<y>,<facing>
char mapname[32];
if( sscanf(w1, "%31[^,],%d,%d,%d", mapname, &x, &y, &dir) != 4
|| strchr(w4, ',') == NULL )
@@ -2198,6 +2218,11 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
m = map_mapname2mapid(mapname);
}
+ if( m != -1 && ( x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys ) ) {
+ ShowError("npc_parse_shop: out-of-bounds coordinates (\"%s\",%d,%d), map is %dx%d, in file '%s', line '%d'\n", map[m].name, x, y, map[m].xs, map[m].ys,filepath,strline(buffer,start-buffer));
+ return strchr(start,'\n');;//try next
+ }
+
if( !strcasecmp(w2,"cashshop") )
type = CASHSHOP;
else
@@ -2583,6 +2608,11 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
m = map_mapname2mapid(mapname);
}
+ if( m != -1 && ( x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys ) ) {
+ ShowError("npc_parse_duplicate: out-of-bounds coordinates (\"%s\",%d,%d), map is %dx%d, in file '%s', line '%d'\n", map[m].name, x, y, map[m].xs, map[m].ys,filepath,strline(buffer,start-buffer));
+ return end;//try next
+ }
+
if( type == WARP && sscanf(w4, "%d,%d", &xs, &ys) == 2 );// <spanx>,<spany>
else if( type == SCRIPT && sscanf(w4, "%d,%d,%d", &class_, &xs, &ys) == 3);// <sprite id>,<triggerX>,<triggerY>
else if( type != WARP ) class_ = atoi(w4);// <sprite id>
@@ -2911,18 +2941,20 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c
for( i = 0; i < ( strlen( message ) + 1 ) && k < 127; i ++ ) {
if( message[i] == ' ' || message[i] == '\0' ) {
if( message[ ( i - 1 ) ] == ' ' ) {
- continue; // To prevent "@atcmd [space][space][space]..."
+ continue; // To prevent "@atcmd [space][space]" and .@atcmd_numparameters return 1 without any parameter.
}
temp[k] = '\0';
k = 0;
- setd_sub( st, NULL, ".@atcmd_parameters$", j++, (void *)temp, NULL );
+ if( temp[0] != '\0' ) {
+ setd_sub( st, NULL, ".@atcmd_parameters$", j++, (void *)temp, NULL );
+ }
} else {
temp[k] = message[i];
k++;
}
}
- setd_sub(st, NULL, ".@atcmd_numparameters", 0, (void *)__64BPRTSIZE(j), NULL);
+ setd_sub(st, NULL, ".@atcmd_numparameters", 0, (void *)__64BPTRSIZE(j), NULL);
aFree(temp);
run_script_main(st);
@@ -3365,8 +3397,6 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
map[m].flag.leaves=state;
else if (!strcmpi(w3,"nightenabled"))
map[m].flag.nightenabled=state;
- else if (!strcmpi(w3,"nogo"))
- map[m].flag.nogo=state;
else if (!strcmpi(w3,"noexp")) {
map[m].flag.nobaseexp=state;
map[m].flag.nojobexp=state;
@@ -3992,6 +4022,8 @@ int do_init_npc(void)
npc_viewdb[0].class_ = INVISIBLE_CLASS; //Invisible class is stored here.
for( i = 1; i < MAX_NPC_CLASS; i++ )
npc_viewdb[i].class_ = i;
+ for( i = MAX_NPC_CLASS2_START; i < MAX_NPC_CLASS2_END; i++ )
+ npc_viewdb2[i - MAX_NPC_CLASS2_START].class_ = i;
ev_db = strdb_alloc((DBOptions)(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA),2*NAME_LENGTH+2+1);
npcname_db = strdb_alloc(DB_OPT_BASE,NAME_LENGTH);
diff --git a/src/map/npc.h b/src/map/npc.h
index c2351a836..8800b4e5b 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -88,7 +88,12 @@ enum actor_classes
INVISIBLE_CLASS = 32767,
};
+// Old NPC range
#define MAX_NPC_CLASS 1000
+// New NPC range
+#define MAX_NPC_CLASS2_START 10000
+#define MAX_NPC_CLASS2_END 10049
+
//Checks if a given id is a valid npc id. [Skotlex]
//Since new npcs are added all the time, the max valid value is the one before the first mob (Scorpion = 1001)
#define npcdb_checkid(id) ( ( (id) >= 46 && (id) <= 125) || (id) == HIDDEN_WARP_CLASS || ( (id) > 400 && (id) < MAX_NPC_CLASS ) || (id) == INVISIBLE_CLASS || ( (id) > 10000 && (id) < 10049 ) )
@@ -174,7 +179,7 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
int npc_rr_secure_timeout_timer(int tid, unsigned int tick, int id, intptr_t data);
#endif
diff --git a/src/map/packets.h b/src/map/packets.h
index 29181d392..3c204c978 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -1116,7 +1116,7 @@ packet(0x020d,-1);
packet(0x02c5,30);
packet(0x02c6,30);
packet(0x02c7,7,clif->pReplyPartyInvite2,2,6);
- packet(0x02c8,3);
+ packet(0x02c8,3,clif->pPartyTick,2);
packet(0x02c9,3);
packet(0x02ca,3);
packet(0x02cb,20);
@@ -2045,9 +2045,7 @@ packet(0x020d,-1);
packet(0x094C,6,clif->pSolveCharName,2);
packet(0x0907,5,clif->pMoveItem,2,4);
packet(0x0908,5);
- packet(0x08CF,10); //Amulet spirits
packet(0x08d2,10);
- packet(0x0977,14); //Monster HP Bar
packet(0x0998,8,clif->pEquipItem,2,4);
//packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x0938,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
@@ -2061,6 +2059,7 @@ packet(0x020d,-1);
packet(0x084a,2,clif->pCashShopClose,0);/* tell server cashshop window is being closed */
packet(0x08c9,4,clif->pCashShopSchedule,0);
packet(0x0848,-1,clif->pCashShopBuy,0);
+ packet(0x0447,2);
#endif
#endif /* _PACKETS_H_ */
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
new file mode 100644
index 000000000..17c6777e8
--- /dev/null
+++ b/src/map/packets_struct.h
@@ -0,0 +1,376 @@
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+
+/* Hercules Renewal: Phase Two http://hercules.ws/board/topic/383-hercules-renewal-phase-two/ */
+
+#ifndef _PACKETS_STRUCT_H_
+#define _PACKETS_STRUCT_H_
+
+#include "../common/mmo.h"
+
+/**
+ * structs for data
+ */
+struct EQUIPSLOTINFO {
+ unsigned short card[4];
+};
+/**
+ *
+ **/
+enum packet_headers {
+ sc_notickType = 0x196,
+#if PACKETVER < 20061218
+ additemType = 0xa0,
+#elif PACKETVER < 20071002
+ additemType = 0x29a,
+#elif PACKETVER < 2013000 /* not sure date */
+ additemType = 0x2d4,
+#else
+ additemType = 0x990,
+#endif
+#if PACKETVER < 4
+ idle_unitType = 0x78,
+#elif PACKETVER < 7
+ idle_unitType = 0x1d8,
+#elif PACKETVER < 20080102
+ idle_unitType = 0x22a,
+#elif PACKETVER < 20091103
+ idle_unitType = 0x2ee,
+#elif PACKETVER < 20101124
+ idle_unitType = 0x7f9,
+#elif PACKETVER < 20120712
+ idle_unitType = 0x857,
+#else
+ idle_unitType = 0x915,
+#endif
+#if PACKETVER >= 20120618
+ status_changeType = 0x983,
+#elif PACKETVER >= 20090121
+ status_changeType = 0x43f,
+#else
+ status_changeType = sc_notickType,/* 0x196 */
+#endif
+#if PACKETVER < 4
+ spawn_unitType = 0x79,
+#elif PACKETVER < 7
+ spawn_unitType = 0x1d9,
+#elif PACKETVER < 20080102
+ spawn_unitType = 0x22b,
+#elif PACKETVER < 20091103
+ spawn_unitType = 0x2ed,
+#elif PACKETVER < 20101124
+ spawn_unitType = 0x7f8,
+#elif PACKETVER < 20120712
+ spawn_unitType = 0x858,
+#else
+ spawn_unitType = 0x90f,
+#endif
+#if PACKETVER < 20080102
+ authokType = 0x73,
+#else
+ authokType = 0x2eb,
+#endif
+#if PACKETVER < 4
+ unit_walkingType = 0x7b,
+#elif PACKETVER < 7
+ unit_walkingType = 0x1da,
+#elif PACKETVER < 20080102
+ unit_walkingType = 0x22c,
+#elif PACKETVER < 20091103
+ unit_walkingType = 0x2ec,
+#elif PACKETVER < 20101124
+ unit_walkingType = 0x7f7,
+#elif PACKETVER < 20120712
+ unit_walkingType = 0x856,
+#else
+ unit_walkingType = 0x914,
+#endif
+#if PACKETVER > 2013000 /* not sure date */
+ dropflooritemType = 0x84b,
+#else
+ dropflooritemType = 0x9e,
+#endif
+ monsterhpType = 0x977,
+ maptypeproperty2Type = 0x99b,
+};
+
+#pragma pack(push, 1)
+
+struct packet_authok {
+ short PacketType;
+ unsigned int startTime;
+ char PosDir[3];
+ unsigned char xSize;
+ unsigned char ySize;
+#if PACKETVER >= 20080102
+ short font;
+#endif
+} __attribute__((packed));
+
+struct packet_monster_hp {
+ short PacketType;
+ unsigned int GID;
+ int HP;
+ int MaxHP;
+} __attribute__((packed));
+
+struct packet_sc_notick {
+ short PacketType;
+ short index;
+ unsigned int AID;
+ unsigned char state;
+} __attribute__((packed));
+
+struct packet_additem {
+ short PacketType;
+ unsigned short Index;
+ unsigned short count;
+ unsigned short nameid;
+ bool IsIdentified;
+ bool IsDamaged;
+ unsigned char refiningLevel;
+ struct EQUIPSLOTINFO slot;
+#if PACKETVER >= 20130000 /* not sure */
+ unsigned int location;
+#else
+ unsigned short location;
+#endif
+ unsigned char type;
+ unsigned char result;
+#if PACKETVER >= 20061218
+ int HireExpireDate;
+#endif
+#if PACKETVER >= 20071002
+ unsigned short bindOnEquipType;
+#endif
+} __attribute__((packed));
+
+struct packet_dropflooritem {
+ short PacketType;
+ unsigned int ITAID;
+ unsigned short ITID;
+#if PACKETVER >= 20130000 /* not sure date */
+ unsigned short type;
+#endif
+ bool IsIdentified;
+ short xPos;
+ short yPos;
+ unsigned char subX;
+ unsigned char subY;
+ short count;
+} __attribute__((packed));
+
+struct packet_spawn_unit {
+ short PacketType;
+#if PACKETVER >= 20091103
+ short PacketLength;
+ unsigned char objecttype;
+#endif
+ unsigned int GID;
+ short speed;
+ short bodyState;
+ short healthState;
+#if PACKETVER < 20080102
+ short effectState;
+#else
+ int effectState;
+#endif
+ short job;
+ short head;
+#if PACKETVER < 7
+ short weapon;
+#else
+ int weapon;
+#endif
+ short accessory;
+#if PACKETVER < 7
+ short shield;
+#endif
+ short accessory2;
+ short accessory3;
+ short headpalette;
+ short bodypalette;
+ short headDir;
+#if PACKETVER >= 20101124
+ short robe;
+#endif
+ unsigned int GUID;
+ short GEmblemVer;
+ short honor;
+#if PACKETVER >= 20091103
+ int virtue;
+#else
+ short virtue;
+#endif
+ bool isPKModeON;
+ unsigned char sex;
+ char PosDir[3];
+ unsigned char xSize;
+ unsigned char ySize;
+ short clevel;
+#if PACKETVER >= 20080102
+ short font;
+#endif
+#if PACKETVER >= 20120712
+ int maxHP;
+ int HP;
+ unsigned char isBoss;
+#endif
+} __attribute__((packed));
+
+struct packet_unit_walking {
+ short PacketType;
+#if PACKETVER >= 20091103
+ short PacketLength;
+ unsigned char objecttype;
+#endif
+ unsigned int GID;
+ short speed;
+ short bodyState;
+ short healthState;
+#if PACKETVER < 20080102
+ short effectState;
+#else
+ int effectState;
+#endif
+ short job;
+ short head;
+#if PACKETVER < 7
+ short weapon;
+#else
+ int weapon;
+#endif
+ short accessory;
+ unsigned int moveStartTime;
+#if PACKETVER < 7
+ short shield;
+#endif
+ short accessory2;
+ short accessory3;
+ short headpalette;
+ short bodypalette;
+ short headDir;
+#if PACKETVER >= 20101124
+ short robe;
+#endif
+ unsigned int GUID;
+ short GEmblemVer;
+ short honor;
+#if PACKETVER >= 20091103
+ int virtue;
+#else
+ short virtue;
+#endif
+ bool isPKModeON;
+ unsigned char sex;
+ char MoveData[6];
+ unsigned char xSize;
+ unsigned char ySize;
+ short clevel;
+#if PACKETVER >= 20080102
+ short font;
+#endif
+#if PACKETVER >= 20120712
+ int maxHP;
+ int HP;
+ unsigned char isBoss;
+#endif
+} __attribute__((packed));
+
+struct packet_idle_unit {
+ short PacketType;
+#if PACKETVER >= 20091103
+ short PacketLength;
+ unsigned char objecttype;
+#endif
+ unsigned int GID;
+ short speed;
+ short bodyState;
+ short healthState;
+#if PACKETVER < 20080102
+ short effectState;
+#else
+ int effectState;
+#endif
+ short job;
+ short head;
+#if PACKETVER < 7
+ short weapon;
+#else
+ int weapon;
+#endif
+ short accessory;
+#if PACKETVER < 7
+ short shield;
+#endif
+ short accessory2;
+ short accessory3;
+ short headpalette;
+ short bodypalette;
+ short headDir;
+#if PACKETVER >= 20101124
+ short robe;
+#endif
+ unsigned int GUID;
+ short GEmblemVer;
+ short honor;
+#if PACKETVER >= 20091103
+ int virtue;
+#else
+ short virtue;
+#endif
+ bool isPKModeON;
+ unsigned char sex;
+ char PosDir[3];
+ unsigned char xSize;
+ unsigned char ySize;
+ unsigned char state;
+ short clevel;
+#if PACKETVER >= 20080102
+ short font;
+#endif
+#if PACKETVER >= 20120712
+ int maxHP;
+ int HP;
+ unsigned char isBoss;
+#endif
+} __attribute__((packed));
+
+struct packet_status_change {
+ short PacketType;
+ short index;
+ unsigned int AID;
+ unsigned char state;
+#if PACKETVER >= 20120618
+ unsigned int Total;
+#endif
+#if PACKETVER >= 20090121
+ unsigned int Left;
+ int val1;
+ int val2;
+ int val3;
+#endif
+} __attribute__((packed));
+
+struct packet_maptypeproperty2 {
+ short PacketType;
+ short type;
+ struct {
+ unsigned int party : 1;
+ unsigned int guild : 1;
+ unsigned int siege : 1;
+ unsigned int mineffect : 1;
+ unsigned int nolockon : 1;
+ unsigned int countpk : 1;
+ unsigned int nopartyformation : 1;
+ unsigned int bg : 1;
+ unsigned int noitemconsumption : 1;
+ unsigned int usecart : 1;
+ unsigned int summonstarmiracle : 1;
+ unsigned int SpareBits : 15;
+ } flag;
+} __attribute__((packed));
+
+#pragma pack(pop)
+
+#endif /* _PACKETS_STRUCT_H_ */
diff --git a/src/map/party.c b/src/map/party.c
index f69a843fc..d8bb321f1 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -786,7 +786,7 @@ int party_send_message(struct map_session_data *sd,const char *mes,int len)
party_recv_message(sd->status.party_id,sd->status.account_id,mes,len);
// Chat logging type 'P' / Party Chat
- log_chat(LOG_CHAT_PARTY, sd->status.party_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes);
+ logs->chat(LOG_CHAT_PARTY, sd->status.party_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes);
return 0;
}
@@ -910,6 +910,9 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
{
struct map_session_data* sd[MAX_PARTY];
unsigned int i, c;
+#ifdef RENEWAL_EXP
+ unsigned int job_exp_bonus, base_exp_bonus;
+#endif
nullpo_ret(p);
@@ -926,8 +929,7 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
job_exp/=c;
zeny/=c;
- if (battle_config.party_even_share_bonus && c > 1)
- {
+ if (battle_config.party_even_share_bonus && c > 1) {
double bonus = 100 + battle_config.party_even_share_bonus*(c-1);
if (base_exp)
base_exp = (unsigned int) cap_value(base_exp * bonus/100, 0, UINT_MAX);
@@ -937,12 +939,17 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX);
}
+#ifdef RENEWAL_EXP
+ base_exp_bonus = base_exp;
+ job_exp_bonus = job_exp;
+#endif
+
for (i = 0; i < c; i++) {
#ifdef RENEWAL_EXP
if( !(src && src->type == BL_MOB && ((TBL_MOB*)src)->db->mexp) ){
int rate = pc_level_penalty_mod(sd[i], (TBL_MOB*)src, 1);
- base_exp = (unsigned int)cap_value(base_exp * rate / 100, 1, UINT_MAX);
- job_exp = (unsigned int)cap_value(job_exp * rate / 100, 1, UINT_MAX);
+ base_exp = (unsigned int)cap_value(base_exp_bonus * rate / 100, 1, UINT_MAX);
+ job_exp = (unsigned int)cap_value(job_exp_bonus * rate / 100, 1, UINT_MAX);
}
#endif
pc_gainexp(sd[i], src, base_exp, job_exp, false);
diff --git a/src/map/pc.c b/src/map/pc.c
index 796280308..7427348fe 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -99,10 +99,6 @@ int pc_class2idx(int class_) {
return class_;
}
-inline int pc_get_group_id(struct map_session_data *sd) {
- return sd->group_id;
-}
-
inline int pc_get_group_level(struct map_session_data *sd) {
return sd->group_level;
}
@@ -522,9 +518,9 @@ int pc_makesavestatus(struct map_session_data *sd)
//Only copy the Cart/Peco/Falcon options, the rest are handled via
//status change load/saving. [Skotlex]
#ifdef NEW_CARTS
- sd->status.option = sd->sc.option&(OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_MOUNTING);
+ sd->status.option = sd->sc.option&(OPTION_INVISIBLE|OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_MOUNTING);
#else
- sd->status.option = sd->sc.option&(OPTION_CART|OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_MOUNTING);
+ sd->status.option = sd->sc.option&(OPTION_INVISIBLE|OPTION_CART|OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_MOUNTING);
#endif
if (sd->sc.data[SC_JAILED])
{ //When Jailed, do not move last point.
@@ -968,12 +964,13 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
/**
* Initialize to defaults/expected
**/
sd->npc_idle_timer = INVALID_TIMER;
sd->npc_idle_tick = tick;
+ sd->npc_idle_type = NPCT_INPUT;
#endif
sd->canuseitem_tick = tick;
@@ -982,6 +979,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->cantalk_tick = tick;
sd->canskill_tick = tick;
sd->cansendmail_tick = tick;
+ sd->hchsysch_tick = tick;
for(i = 0; i < MAX_SKILL_LEVEL; i++)
sd->spirit_timer[i] = INVALID_TIMER;
@@ -1006,14 +1004,13 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
pc_setinventorydata(sd);
pc_setequipindex(sd);
+ if( sd->status.option & OPTION_INVISIBLE && !pc_can_use_command(sd, "@hide") )
+ sd->status.option &=~ OPTION_INVISIBLE;
+
status_change_init(&sd->bl);
-
- if (pc_can_use_command(sd, "hide", COMMAND_ATCOMMAND))
- sd->status.option &= (OPTION_MASK | OPTION_INVISIBLE);
- else
- sd->status.option &= OPTION_MASK;
-
+
sd->sc.option = sd->status.option; //This is the actual option used in battle.
+
//Set here because we need the inventory data for weapon sprite parsing.
status_set_viewdata(&sd->bl, sd->status.class_);
unit_dataset(&sd->bl);
@@ -1242,6 +1239,20 @@ int pc_reg_received(struct map_session_data *sd)
pc_inventory_rentals(sd);
+ if( sd->sc.option & OPTION_INVISIBLE ) {
+ sd->vd.class_ = INVISIBLE_CLASS;
+ clif->message(sd->fd, msg_txt(11)); // Invisible: On
+ // decrement the number of pvp players on the map
+ map[sd->bl.m].users_pvp--;
+
+ if( map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER ) {// unregister the player for ranking
+ delete_timer( sd->pvp_timer, pc_calc_pvprank_timer );
+ sd->pvp_timer = INVALID_TIMER;
+ }
+ clif->changeoption(&sd->bl);
+ }
+
+
return 1;
}
@@ -3435,11 +3446,11 @@ int pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type4
}
/*==========================================
- * Grants a player a given skill. Flag values are:
- * 0 - Grant skill unconditionally and forever (only this one invokes status_calc_pc,
- * as the other two are assumed to be invoked from within it)
- * 1 - Grant an item skill (temporary)
- * 2 - Like 1, except the level granted can stack with previously learned level.
+ * Grants a player a given skill. Flag values are:
+ * 0 - Grant permanent skill to be bound to skill tree
+ * 1 - Grant an item skill (temporary)
+ * 2 - Like 1, except the level granted can stack with previously learned level.
+ * 3 - Grant skill unconditionally and forever (persistent to job changes and skill resets)
*------------------------------------------*/
int pc_skill(TBL_PC* sd, int id, int level, int flag)
{
@@ -3459,42 +3470,52 @@ int pc_skill(TBL_PC* sd, int id, int level, int flag)
}
switch( flag ){
- case 0: //Set skill data overwriting whatever was there before.
- sd->status.skill[id].id = id;
- sd->status.skill[id].lv = level;
- sd->status.skill[id].flag = SKILL_FLAG_PERM_GRANTED;
- if( level == 0 ) //Remove skill.
- {
- sd->status.skill[id].id = 0;
- clif->deleteskill(sd,id);
- }
- else
- clif->addskill(sd,id);
- if( !skill->get_inf(id) ) //Only recalculate for passive skills.
- status_calc_pc(sd, 0);
- break;
- case 1: //Item bonus skill.
- if( sd->status.skill[id].id == id ){
- if( sd->status.skill[id].lv >= level )
- return 0;
- if( sd->status.skill[id].flag == SKILL_FLAG_PERMANENT ) //Non-granted skill, store it's level.
- sd->status.skill[id].flag = SKILL_FLAG_REPLACED_LV_0 + sd->status.skill[id].lv;
- } else {
+ case 0: //Set skill data overwriting whatever was there before.
sd->status.skill[id].id = id;
- sd->status.skill[id].flag = SKILL_FLAG_TEMPORARY;
- }
- sd->status.skill[id].lv = level;
- break;
- case 2: //Add skill bonus on top of what you had.
- if( sd->status.skill[id].id == id ){
- if( sd->status.skill[id].flag == SKILL_FLAG_PERMANENT )
- sd->status.skill[id].flag = SKILL_FLAG_REPLACED_LV_0 + sd->status.skill[id].lv; // Store previous level.
- } else {
+ sd->status.skill[id].lv = level;
+ sd->status.skill[id].flag = SKILL_FLAG_PERMANENT;
+ if( level == 0 ) { //Remove skill.
+ sd->status.skill[id].id = 0;
+ clif->deleteskill(sd,id);
+ } else
+ clif->addskill(sd,id);
+ if( !skill->get_inf(id) ) //Only recalculate for passive skills.
+ status_calc_pc(sd, 0);
+ break;
+ case 1: //Item bonus skill.
+ if( sd->status.skill[id].id == id ) {
+ if( sd->status.skill[id].lv >= level )
+ return 0;
+ if( sd->status.skill[id].flag == SKILL_FLAG_PERMANENT ) //Non-granted skill, store it's level.
+ sd->status.skill[id].flag = SKILL_FLAG_REPLACED_LV_0 + sd->status.skill[id].lv;
+ } else {
+ sd->status.skill[id].id = id;
+ sd->status.skill[id].flag = SKILL_FLAG_TEMPORARY;
+ }
+ sd->status.skill[id].lv = level;
+ break;
+ case 2: //Add skill bonus on top of what you had.
+ if( sd->status.skill[id].id == id ) {
+ if( sd->status.skill[id].flag == SKILL_FLAG_PERMANENT )
+ sd->status.skill[id].flag = SKILL_FLAG_REPLACED_LV_0 + sd->status.skill[id].lv; // Store previous level.
+ } else {
+ sd->status.skill[id].id = id;
+ sd->status.skill[id].flag = SKILL_FLAG_TEMPORARY; //Set that this is a bonus skill.
+ }
+ sd->status.skill[id].lv += level;
+ break;
+ case 3:
sd->status.skill[id].id = id;
- sd->status.skill[id].flag = SKILL_FLAG_TEMPORARY; //Set that this is a bonus skill.
- }
- sd->status.skill[id].lv += level;
- break;
+ sd->status.skill[id].lv = level;
+ sd->status.skill[id].flag = SKILL_FLAG_PERM_GRANTED;
+ if( level == 0 ) { //Remove skill.
+ sd->status.skill[id].id = 0;
+ clif->deleteskill(sd,id);
+ } else
+ clif->addskill(sd,id);
+ if( !skill->get_inf(id) ) //Only recalculate for passive skills.
+ status_calc_pc(sd, 0);
+ break;
default: //Unknown flag?
return 0;
}
@@ -3546,9 +3567,9 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
}
else
{// success
- log_pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->status.inventory[idx_equip]);
+ logs->pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]);
sd->status.inventory[idx_equip].card[i] = nameid;
- log_pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->status.inventory[idx_equip]);
+ logs->pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]);
clif->insert_card(sd,idx_equip,idx_card,0);
}
@@ -3667,7 +3688,7 @@ int pc_payzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type,
clif->updatestatus(sd,SP_ZENY);
if(!tsd) tsd = sd;
- log_zeny(sd, type, tsd, -zeny);
+ logs->zeny(sd, type, tsd, -zeny);
if( zeny > 0 && sd->state.showzeny ) {
char output[255];
sprintf(output, "Removed %dz.", zeny);
@@ -3795,7 +3816,7 @@ int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type,
clif->updatestatus(sd,SP_ZENY);
if(!tsd) tsd = sd;
- log_zeny(sd, type, tsd, zeny);
+ logs->zeny(sd, type, tsd, zeny);
if( zeny > 0 && sd->state.showzeny ) {
char output[255];
sprintf(output, "Gained %dz.", zeny);
@@ -3890,7 +3911,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
if( !itemdb_isstackable2(data) && !item_data->unique_id )
sd->status.inventory[i].unique_id = itemdb_unique_id(0,0);
#endif
- log_pick_pc(sd, log_type, amount, &sd->status.inventory[i]);
+ logs->pick_pc(sd, log_type, amount, &sd->status.inventory[i],sd->inventory_data[i]);
sd->weight += w;
clif->updatestatus(sd,SP_WEIGHT);
@@ -3930,7 +3951,7 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reas
if(sd->status.inventory[n].nameid==0 || amount <= 0 || sd->status.inventory[n].amount<amount || sd->inventory_data[n] == NULL)
return 1;
- log_pick_pc(sd, log_type, -amount, &sd->status.inventory[n]);
+ logs->pick_pc(sd, log_type, -amount, &sd->status.inventory[n],sd->inventory_data[n]);
sd->status.inventory[n].amount -= amount;
sd->weight -= sd->inventory_data[n]->weight*amount ;
@@ -4213,7 +4234,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
//Dead Branch & Bloody Branch & Porings Box
// FIXME: outdated, use constants or database
if( nameid == 604 || nameid == 12103 || nameid == 12109 )
- log_branch(sd);
+ logs->branch(sd);
return 1;
}
@@ -4302,7 +4323,7 @@ int pc_useitem(struct map_session_data *sd,int n)
sprintf(e_msg,"Item Failed. [%s] is cooling down. wait %d seconds.",
itemdb_jname(sd->status.inventory[n].nameid),
e_tick+1);
- clif->colormes(sd,COLOR_RED,e_msg);
+ clif->colormes(sd->fd,COLOR_RED,e_msg);
return 0; // Delay has not expired yet
}
} else {// not yet used item (all slots are initially empty)
@@ -4428,7 +4449,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
clif->cart_additem(sd,i,amount,0);
}
sd->status.cart[i].favorite = 0;/* clear */
- log_pick_pc(sd, log_type, amount, &sd->status.cart[i]);
+ logs->pick_pc(sd, log_type, amount, &sd->status.cart[i],data);
sd->cart_weight += w;
clif->updatestatus(sd,SP_CARTINFO);
@@ -4442,18 +4463,17 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
* 0 = success
* 1 = fail
*------------------------------------------*/
-int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type)
-{
+int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type) {
+ struct item_data * data;
nullpo_retr(1, sd);
- if(sd->status.cart[n].nameid==0 ||
- sd->status.cart[n].amount<amount)
+ if( sd->status.cart[n].nameid == 0 || sd->status.cart[n].amount < amount || !(data = itemdb_exists(sd->status.cart[n].nameid)) )
return 1;
- log_pick_pc(sd, log_type, -amount, &sd->status.cart[n]);
+ logs->pick_pc(sd, log_type, -amount, &sd->status.cart[n],data);
sd->status.cart[n].amount -= amount;
- sd->cart_weight -= itemdb_weight(sd->status.cart[n].nameid)*amount ;
+ sd->cart_weight -= data->weight*amount ;
if(sd->status.cart[n].amount <= 0){
memset(&sd->status.cart[n],0,sizeof(sd->status.cart[0]));
sd->cart_num--;
@@ -4573,6 +4593,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
struct status_data *sd_status, *md_status;
struct mob_data *md;
struct item tmp_item;
+ struct item_data *data;
if(!sd || !bl || bl->type!=BL_MOB)
return 0;
@@ -4604,7 +4625,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
// Try dropping one item, in the order from first to last possible slot.
// Droprate is affected by the skill success rate.
for( i = 0; i < MAX_STEAL_DROP; i++ )
- if( md->db->dropitem[i].nameid > 0 && itemdb_exists(md->db->dropitem[i].nameid) && rnd() % 10000 < md->db->dropitem[i].p * rate/100. )
+ if( md->db->dropitem[i].nameid > 0 && (data = itemdb_exists(md->db->dropitem[i].nameid)) && rnd() % 10000 < md->db->dropitem[i].p * rate/100. )
break;
if( i == MAX_STEAL_DROP )
return 0;
@@ -4613,7 +4634,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = itemid;
tmp_item.amount = 1;
- tmp_item.identify = itemdb_isidentified(itemid);
+ tmp_item.identify = itemdb_isidentified2(data);
flag = pc_additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER);
//TODO: Should we disable stealing when the item you stole couldn't be added to your inventory? Perhaps players will figure out a way to exploit this behaviour otherwise?
@@ -4628,14 +4649,12 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
party_foreachsamemap(pc_show_steal,sd,AREA_SIZE,sd,tmp_item.nameid);
//Logs items, Stolen from mobs [Lupus]
- log_pick_mob(md, LOG_TYPE_STEAL, -1, &tmp_item);
+ logs->pick_mob(md, LOG_TYPE_STEAL, -1, &tmp_item, data);
//A Rare Steal Global Announce by Lupus
if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) {
- struct item_data *i_data;
char message[128];
- i_data = itemdb_search(itemid);
- sprintf (message, msg_txt(542), (sd->status.name != NULL)?sd->status.name :"GM", md->db->jname, i_data->jname, (float)md->db->dropitem[i].p/100);
+ sprintf (message, msg_txt(542), (sd->status.name != NULL)?sd->status.name :"GM", md->db->jname, data->jname, (float)md->db->dropitem[i].p/100);
//MSG: "'%s' stole %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,0);
}
@@ -4755,7 +4774,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
// make sure vending is allowed here
if (sd->state.vending && map[m].flag.novending) {
clif->message (sd->fd, msg_txt(276)); // "You can't open a shop on this map"
- vending_closevending(sd);
+ vending->close(sd);
}
if( hChSys.local && map[sd->bl.m].channel && idb_exists(map[sd->bl.m].channel->users, sd->status.char_id) ) {
@@ -4806,7 +4825,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
if (sd->state.vending && map_getcell(m,x,y,CELL_CHKNOVENDING)) {
clif->message (sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
- vending_closevending(sd);
+ vending->close(sd);
}
if(sd->bl.prev != NULL){
@@ -6306,7 +6325,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
if( pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd) )
clif->status_change(&sd->bl, SI_DEVIL, 0, 0, 0, 0, 0); //Remove perma blindness due to skill-reset. [Skotlex]
i = sd->sc.option;
- if( i&OPTION_RIDING && pc_checkskill(sd, KN_RIDING) )
+ if( i&OPTION_RIDING && (!pc_checkskill(sd, KN_RIDING) || (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) )
i &= ~OPTION_RIDING;
if( i&OPTION_FALCON && pc_checkskill(sd, HT_FALCON) )
i &= ~OPTION_FALCON;
@@ -7085,7 +7104,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
case SP_ZENY:
if( val < 0 )
return 0;// can't set negative zeny
- log_zeny(sd, LOG_TYPE_SCRIPT, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY)));
+ logs->zeny(sd, LOG_TYPE_SCRIPT, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY)));
sd->status.zeny = cap_value(val, 0, MAX_ZENY);
break;
case SP_BASEEXP:
@@ -7444,7 +7463,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
if (sd->ed)
elemental_delete(sd->ed, 0);
if (sd->state.vending)
- vending_closevending(sd);
+ vending->close(sd);
map_foreachinmap(jobchange_killclone, sd->bl.m, BL_MOB, sd->bl.id);
@@ -7594,7 +7613,7 @@ int pc_setoption(struct map_session_data *sd,int type)
clif->status_change(&sd->bl, SI_RIDING, 1, 0, 0, 0, 0);
status_calc_pc(sd,0);
}
- else if( (!(type&OPTION_RIDING) && p_type&OPTION_RIDING) || (!(type&OPTION_DRAGON) && p_type&OPTION_DRAGON && pc_checkskill(sd,RK_DRAGONTRAINING) > 0) )
+ else if( (!(type&OPTION_RIDING) && p_type&OPTION_RIDING) || (!(type&OPTION_DRAGON) && p_type&OPTION_DRAGON) )
{ // Dismount
clif->status_change(&sd->bl, SI_RIDING, 0, 0, 0, 0, 0);
status_calc_pc(sd,0);
@@ -9243,22 +9262,10 @@ bool pc_isautolooting(struct map_session_data *sd, int nameid)
/**
* Checks if player can use @/#command
* @param sd Player map session data
- * @param command Command name without @/# and params
- * @param type is it atcommand or charcommand
+ * @param command Command name with @/# and without params
*/
-bool pc_can_use_command(struct map_session_data *sd, const char *command, AtCommandType type)
-{
- return pc_group_can_use_command(pc_get_group_id(sd), command, type);
-}
-
-/**
- * Checks if commands used by a player should be logged
- * according to their group setting.
- * @param sd Player map session data
- */
-bool pc_should_log_commands(struct map_session_data *sd)
-{
- return pc_group_should_log_commands(pc_get_group_id(sd));
+bool pc_can_use_command(struct map_session_data *sd, const char *command) {
+ return atcommand->can_use(sd,command);
}
static int pc_talisman_timer(int tid, unsigned int tick, int id, intptr_t data)
@@ -9542,7 +9549,8 @@ static bool pc_readdb_levelpenalty(char* fields[], int columns, int current)
*------------------------------------------*/
int pc_readdb(void)
{
- int i,j,k,tmp=0;
+ int i,j,k;
+ unsigned int count = 0;
FILE *fp;
char line[24000],*p;
@@ -9586,7 +9594,7 @@ int pc_readdb(void)
ShowWarning("pc_readdb: Specified max level %u for job %d is beyond server's limit (%u).\n ", maxlv, job_id, MAX_LEVEL);
maxlv = MAX_LEVEL;
}
-
+ count++;
job = jobs[0] = pc_class2idx(job_id);
//We send one less and then one more because the last entry in the exp array should hold 0.
max_level[job][type] = pc_split_atoui(split[3], exp_table[job][type],',',maxlv-1)+1;
@@ -9629,8 +9637,8 @@ int pc_readdb(void)
if (!max_level[j][1])
ShowWarning("Class %s (%d) does not has a job exp table.\n", job_name(i), i);
}
- ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt");
-
+ ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s/"DBPATH"%s"CL_RESET"'.\n",count,db_path,"exp.txt");
+ count = 0;
// Reset and read skilltree
memset(skill_tree,0,sizeof(skill_tree));
sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree);
@@ -9639,7 +9647,7 @@ int pc_readdb(void)
sv_readdb(db_path, "re/level_penalty.txt", ',', 4, 4, -1, &pc_readdb_levelpenalty);
for( k=1; k < 3; k++ ){ // fill in the blanks
for( j = 0; j < RC_MAX; j++ ){
- tmp = 0;
+ int tmp = 0;
for( i = 0; i < MAX_LEVEL*2; i++ ){
if( i == MAX_LEVEL+1 )
tmp = level_penalty[k][j][0];// reset
@@ -9681,7 +9689,7 @@ int pc_readdb(void)
lv=atoi(split[0]);
n=atoi(split[1]);
-
+ count++;
for(i=0;i<n && i<ELE_MAX;){
if( !fgets(line, sizeof(line), fp) )
break;
@@ -9702,8 +9710,8 @@ int pc_readdb(void)
}
}
fclose(fp);
- ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","attr_fix.txt");
-
+ ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s/"DBPATH"%s"CL_RESET"'.\n",count,db_path,"attr_fix.txt");
+ count = 0;
// reset then read statspoint
memset(statp,0,sizeof(statp));
i=1;
@@ -9723,12 +9731,13 @@ int pc_readdb(void)
stat=0;
if (i > MAX_LEVEL)
break;
+ count++;
statp[i]=stat;
i++;
}
fclose(fp);
- ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","statpoint.txt");
+ ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s/"DBPATH"%s"CL_RESET"'.\n",count,db_path,"statpoint.txt");
}
// generate the remaining parts of the db if necessary
k = battle_config.use_statpoint_table; //save setting
diff --git a/src/map/pc.h b/src/map/pc.h
index 809822e78..ff65d9824 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -109,6 +109,12 @@ struct s_autobonus {
unsigned short pos;
};
+enum npc_timeout_type {
+ NPCT_INPUT = 0,
+ NPCT_MENU = 1,
+ NPCT_WAIT = 2,
+};
+
struct map_session_data {
struct block_list bl;
struct unit_data ud;
@@ -165,6 +171,7 @@ struct map_session_data {
struct guild *gmaster_flag;
unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
unsigned int warping : 1;//states whether you're in the middle of a warp processing
+ unsigned int permanent_speed : 1; // When 1, speed cannot be changed through status_calc_pc().
} state;
struct {
unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
@@ -182,7 +189,8 @@ struct map_session_data {
unsigned short class_; //This is the internal job ID used by the map server to simplify comparisons/queries/etc. [Skotlex]
int group_id, group_pos, group_level;
unsigned int permissions;/* group permissions */
-
+ bool group_log_command;
+
struct mmo_charstatus status;
struct registry save_reg;
@@ -391,8 +399,8 @@ struct map_session_data {
int guildspy; // [Syrus22]
int partyspy; // [Syrus22]
- int vended_id;
- int vender_id;
+ unsigned int vended_id;
+ unsigned int vender_id;
int vend_num;
char message[MESSAGE_SIZE];
struct s_vending vending[MAX_VENDING];
@@ -466,7 +474,7 @@ struct map_session_data {
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
/**
* ID of the timer
* @info
@@ -480,6 +488,8 @@ struct map_session_data {
* - It is updated on every NPC iteration as mentioned above
**/
unsigned int npc_idle_tick;
+ /* */
+ enum npc_timeout_type npc_idle_type;
#endif
struct {
@@ -500,7 +510,8 @@ struct map_session_data {
unsigned char channel_count;
struct hChSysCh *gcbind;
bool stealth;
- unsigned char fontcolor; /* debug-only */
+ unsigned char fontcolor;
+ unsigned int hchsysch_tick;
// temporary debugging of bug #3504
const char* delunit_prevfile;
@@ -685,13 +696,13 @@ enum equip_pos {
int pc_class2idx(int class_);
int pc_get_group_level(struct map_session_data *sd);
-int pc_get_group_id(struct map_session_data *sd);
+#define pc_get_group_id(sd) ( (sd)->group_id )
int pc_getrefinebonus(int lv,int type);
bool pc_can_give_items(struct map_session_data *sd);
-bool pc_can_use_command(struct map_session_data *sd, const char *command, AtCommandType type);
+bool pc_can_use_command(struct map_session_data *sd, const char *command);
#define pc_has_permission(sd, permission) ( ((sd)->permissions&permission) != 0 )
-bool pc_should_log_commands(struct map_session_data *sd);
+#define pc_should_log_commands(sd) ( (sd)->group_log_command != false )
int pc_setrestartvalue(struct map_session_data *sd,int type);
int pc_makesavestatus(struct map_session_data *);
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index 31ae03e2a..2fd143b53 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/conf.h"
#include "../common/db.h"
@@ -20,21 +21,20 @@ typedef struct GroupSettings GroupSettings;
struct GroupSettings {
unsigned int id; // groups.[].id
int level; // groups.[].level
- const char *name; // groups.[].name
- config_setting_t *commands; // groups.[].commands
+ char name[60]; // copy of groups.[].name
unsigned int e_permissions; // packed groups.[].permissions
bool log_commands; // groups.[].log_commands
- /// Following are used only during config reading
+ int group_pos;/* pos on load [Ind] */
+ /// Following are used/avaialble only during config reading
+ config_setting_t *commands; // groups.[].commands
config_setting_t *permissions; // groups.[].permissions
config_setting_t *inherit; // groups.[].inherit
bool inheritance_done; // have all inheritance rules been evaluated?
config_setting_t *root; // groups.[]
- int group_pos;/* pos on load */
};
int pc_group_max; /* known number of groups */
-static config_t pc_group_config;
static DBMap* pc_group_db; // id -> GroupSettings
static DBMap* pc_groupname_db; // name -> GroupSettings
@@ -60,8 +60,8 @@ static inline GroupSettings* name2group(const char* group_name)
* Loads group configuration from config file into memory.
* @private
*/
-static void read_config(void)
-{
+static void read_config(void) {
+ config_t pc_group_config;
config_setting_t *groups = NULL;
const char *config_filename = "conf/groups.conf"; // FIXME hardcoded name
int group_count = 0;
@@ -126,7 +126,7 @@ static void read_config(void)
CREATE(group_settings, GroupSettings, 1);
group_settings->id = id;
group_settings->level = level;
- group_settings->name = groupname;
+ safestrncpy(group_settings->name, groupname, 60);
group_settings->log_commands = (bool)log_commands;
group_settings->inherit = config_setting_get_member(group, "inherit");
group_settings->commands = config_setting_get_member(group, "commands");
@@ -155,7 +155,7 @@ static void read_config(void)
for (i = 0; i < count; ++i) {
config_setting_t *command = config_setting_get_elem(commands, i);
const char *name = config_setting_name(command);
- if (!atcommand_exists(name)) {
+ if (!atcommand->exists(name)) {
ShowConfigWarning(command, "pc_groups:read_config: non-existent command name '%s', removing...", name);
config_setting_remove(commands, name);
--i;
@@ -284,20 +284,13 @@ static void read_config(void)
group_ids[i++] = group_settings->id;
}
- atcommand_db_load_groups(group_ids);
+ atcommand->load_groups(group_ids);
aFree(group_ids);
dbi_destroy(iter);
}
-}
-
-/**
- * Removes group configuration from memory.
- * @private
- */
-static void destroy_config(void)
-{
+
config_destroy(&pc_group_config);
}
@@ -312,13 +305,12 @@ static void destroy_config(void)
static inline int AtCommandType2idx(AtCommandType type) { return (type-1); }
/**
- * Checks if player group can use @/#command
+ * Checks if player group can use @/#command, used only during parse (only available during parse)
* @param group_id ID of the group
* @param command Command name without @/# and params
* @param type enum AtCommanndType { COMMAND_ATCOMMAND = 1, COMMAND_CHARCOMMAND = 2 }
*/
-bool pc_group_can_use_command(int group_id, const char *command, AtCommandType type)
-{
+bool pc_group_can_use_command(int group_id, const char *command, AtCommandType type) {
int result = 0;
config_setting_t *commands = NULL;
GroupSettings *group = NULL;
@@ -357,6 +349,7 @@ void pc_group_pc_load(struct map_session_data * sd) {
sd->permissions = group->e_permissions;
sd->group_pos = group->group_pos;
sd->group_level = group->level;
+ sd->group_log_command = group->log_commands;
}
/**
* Checks if player group has a permission
@@ -442,7 +435,6 @@ void do_final_pc_groups(void)
db_destroy(pc_group_db);
if (pc_groupname_db != NULL )
db_destroy(pc_groupname_db);
- destroy_config();
}
/**
diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h
index dea689ebd..26cd8f39f 100644
--- a/src/map/pc_groups.h
+++ b/src/map/pc_groups.h
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _PC_GROUPS_H_
#define _PC_GROUPS_H_
diff --git a/src/map/pet.c b/src/map/pet.c
index 28f841809..c85092a01 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -76,6 +76,7 @@ int pet_create_egg(struct map_session_data *sd, int item_id)
{
int pet_id = search_petDB_index(item_id, PET_EGG);
if (pet_id < 0) return 0; //No pet egg here.
+ if (!pc_inventoryblank(sd)) return 0; // Inventory full
sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(sd->status.account_id, sd->status.char_id,
(short)pet_db[pet_id].class_,
@@ -582,6 +583,7 @@ static int pet_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap);
int pet_menu(struct map_session_data *sd,int menunum)
{
+ struct item_data *egg_id;
nullpo_ret(sd);
if (sd->pd == NULL)
return 1;
@@ -589,6 +591,14 @@ int pet_menu(struct map_session_data *sd,int menunum)
//You lost the pet already.
if(!sd->status.pet_id || sd->pd->pet.intimate <= 0 || sd->pd->pet.incuvate)
return 1;
+
+ egg_id = itemdb_exists(sd->pd->petDB->EggID);
+ if (egg_id) {
+ if ((egg_id->flag.trade_restriction&0x01) && !pc_inventoryblank(sd)) {
+ clif->message(sd->fd, msg_txt(451)); // You can't return your pet because your inventory is full.
+ return 1;
+ }
+ }
switch(menunum) {
case 0:
@@ -875,7 +885,7 @@ static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, uns
}
}
- if(!target && pd->loot && pd->loot->count < pd->loot->max && DIFF_TICK(tick,pd->ud.canact_tick)>0) {
+ if(!target && pd->loot && pd->msd && pc_has_permission(pd->msd, PC_PERM_TRADE) && pd->loot->count < pd->loot->max && DIFF_TICK(tick,pd->ud.canact_tick)>0) {
//Use half the pet's range of sight.
map_foreachinrange(pet_ai_sub_hard_lootsearch,&pd->bl,
pd->db->range2/2, BL_ITEM,pd,&target);
diff --git a/src/map/script.c b/src/map/script.c
index 3e51859d1..a061fcdd1 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -50,6 +50,7 @@
#include "script.h"
#include "quest.h"
#include "elemental.h"
+#include "../config/core.h"
#include <stdio.h>
#include <stdlib.h>
@@ -62,13 +63,6 @@
#include <setjmp.h>
#include <errno.h>
-#ifdef BETA_THREAD_TEST
- #include "../common/atomic.h"
- #include "../common/spinlock.h"
- #include "../common/thread.h"
- #include "../common/mutex.h"
-#endif
-
///////////////////////////////////////////////////////////////////////////////
//## TODO possible enhancements: [FlavioJS]
@@ -199,7 +193,7 @@ static struct str_data_struct {
int str;
int backpatch;
int label;
- int (*func)(struct script_state *st);
+ bool (*func)(struct script_state *st);
int val;
int next;
} *str_data = NULL;
@@ -305,39 +299,15 @@ c_op get_com(unsigned char *script,int *pos);
int get_num(unsigned char *script,int *pos);
typedef struct script_function {
- int (*func)(struct script_state *st);
+ bool (*func)(struct script_state *st);
const char *name;
const char *arg;
} script_function;
-extern script_function buildin_func[];
+extern script_function BUILDIN[];
static struct linkdb_node* sleep_db;// int oid -> struct script_state*
-#ifdef BETA_THREAD_TEST
-/**
- * MySQL Query Slave
- **/
-static SPIN_LOCK queryThreadLock;
-static rAthread queryThread = NULL;
-static ramutex queryThreadMutex = NULL;
-static racond queryThreadCond = NULL;
-static volatile int32 queryThreadTerminate = 0;
-
-struct queryThreadEntry {
- bool ok;
- bool type; /* main db or log db? */
- struct script_state *st;
-};
-
-/* Ladies and Gentleman the Manager! */
-struct {
- struct queryThreadEntry **entry;/* array of structs */
- int count;
- int timer;/* used to receive processed entries */
-} queryThreadData;
-#endif
-
/*==========================================
* (Only those needed) local declaration prototype
*------------------------------------------*/
@@ -365,13 +335,8 @@ enum {
MF_FOG,
MF_SAKURA,
MF_LEAVES,
- /**
- * No longer available, keeping here just in case it's back someday. [Ind]
- **/
- //MF_RAIN, //20
- // 21 free
- MF_NOGO = 22,
- MF_CLOUDS,
+ /* 21 - 22 free */
+ MF_CLOUDS = 23,
MF_CLOUDS2,
MF_FIREWORKS,
MF_GVG_CASTLE,
@@ -971,13 +936,13 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom)
// buildin function
add_scriptl(func);
add_scriptc(C_ARG);
- arg = buildin_func[str_data[func].val].arg;
+ arg = BUILDIN[str_data[func].val].arg;
} else if( str_data[func].type == C_USERFUNC || str_data[func].type == C_USERFUNC_POS ){
// script defined function
add_scriptl(buildin_callsub_ref);
add_scriptc(C_ARG);
add_scriptl(func);
- arg = buildin_func[str_data[buildin_callsub_ref].val].arg;
+ arg = BUILDIN[str_data[buildin_callsub_ref].val].arg;
if( *arg == 0 )
disp_error_message("parse_callfunc: callsub has no arguments, please review it's definition",p);
if( *arg != '*' )
@@ -995,7 +960,7 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom)
add_scriptc(C_STR);
while( *name ) add_scriptb(*name ++);
add_scriptb(0);
- arg = buildin_func[str_data[buildin_callfunc_ref].val].arg;
+ arg = BUILDIN[str_data[buildin_callfunc_ref].val].arg;
if( *arg != '*' ) ++ arg;
}
#endif
@@ -1610,9 +1575,9 @@ const char* parse_syntax(const char* p)
set_label(l,script_pos,p);
}
// check duplication of case label [Rayce]
- if(linkdb_search(&syntax.curly[pos].case_label, (void*)__64BPRTSIZE(v)) != NULL)
+ if(linkdb_search(&syntax.curly[pos].case_label, (void*)__64BPTRSIZE(v)) != NULL)
disp_error_message("parse_syntax: dup 'case'",p);
- linkdb_insert(&syntax.curly[pos].case_label, (void*)__64BPRTSIZE(v), (void*)1);
+ linkdb_insert(&syntax.curly[pos].case_label, (void*)__64BPTRSIZE(v), (void*)1);
sprintf(label,"set $@__SW%x_VAL,0;",syntax.curly[pos].index);
syntax.curly[syntax.curly_count++].type = TYPE_NULL;
@@ -2125,11 +2090,11 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
/*==========================================
* Added built-in functions
*------------------------------------------*/
-static void add_buildin_func(void)
+static void add_BUILDIN(void)
{
int i,n;
const char* p;
- for( i = 0; buildin_func[i].func; i++ )
+ for( i = 0; BUILDIN[i].func; i++ )
{
// arg must follow the pattern: (v|s|i|r|l)*\?*\*?
// 'v' - value (either string or int or reference)
@@ -2139,24 +2104,24 @@ static void add_buildin_func(void)
// 'l' - label
// '?' - one optional parameter
// '*' - unknown number of optional parameters
- p = buildin_func[i].arg;
+ p = BUILDIN[i].arg;
while( *p == 'v' || *p == 's' || *p == 'i' || *p == 'r' || *p == 'l' ) ++p;
while( *p == '?' ) ++p;
if( *p == '*' ) ++p;
if( *p != 0){
- ShowWarning("add_buildin_func: ignoring function \"%s\" with invalid arg \"%s\".\n", buildin_func[i].name, buildin_func[i].arg);
- } else if( *skip_word(buildin_func[i].name) != 0 ){
- ShowWarning("add_buildin_func: ignoring function with invalid name \"%s\" (must be a word).\n", buildin_func[i].name);
+ ShowWarning("add_BUILDIN: ignoring function \"%s\" with invalid arg \"%s\".\n", BUILDIN[i].name, BUILDIN[i].arg);
+ } else if( *skip_word(BUILDIN[i].name) != 0 ){
+ ShowWarning("add_BUILDIN: ignoring function with invalid name \"%s\" (must be a word).\n", BUILDIN[i].name);
} else {
- n = add_str(buildin_func[i].name);
+ n = add_str(BUILDIN[i].name);
str_data[n].type = C_FUNC;
str_data[n].val = i;
- str_data[n].func = buildin_func[i].func;
+ str_data[n].func = BUILDIN[i].func;
- if (!strcmp(buildin_func[i].name, "set")) buildin_set_ref = n;
- else if (!strcmp(buildin_func[i].name, "callsub")) buildin_callsub_ref = n;
- else if (!strcmp(buildin_func[i].name, "callfunc")) buildin_callfunc_ref = n;
- else if( !strcmp(buildin_func[i].name, "getelementofarray") ) buildin_getelementofarray_ref = n;
+ if (!strcmp(BUILDIN[i].name, "set")) buildin_set_ref = n;
+ else if (!strcmp(BUILDIN[i].name, "callsub")) buildin_callsub_ref = n;
+ else if (!strcmp(BUILDIN[i].name, "callfunc")) buildin_callfunc_ref = n;
+ else if( !strcmp(BUILDIN[i].name, "getelementofarray") ) buildin_getelementofarray_ref = n;
}
}
}
@@ -2298,7 +2263,7 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
memset(&syntax,0,sizeof(syntax));
if(first){
- add_buildin_func();
+ add_BUILDIN();
read_constdb();
first=0;
}
@@ -2650,7 +2615,7 @@ void* get_val2(struct script_state* st, int uid, struct DBMap** ref)
push_val2(st->stack, C_NAME, uid, ref);
data = script_getdatatop(st, -1);
get_val(st, data);
- return (data->type == C_INT ? (void*)__64BPRTSIZE(data->u.num) : (void*)__64BPRTSIZE(data->u.str));
+ return (data->type == C_INT ? (void*)__64BPTRSIZE(data->u.num) : (void*)__64BPTRSIZE(data->u.str));
}
/*==========================================
@@ -2695,7 +2660,7 @@ static int set_reg(struct script_state* st, TBL_PC* sd, int num, const char* nam
}
else
{// integer variable
- int val = (int)__64BPRTSIZE(value);
+ int val = (int)__64BPTRSIZE(value);
if(str_data[num&0x00ffffff].type == C_PARAM)
{
if( pc_setparam(sd, str_data[num&0x00ffffff].val, val) == 0 )
@@ -3341,7 +3306,7 @@ static void script_check_buildin_argtype(struct script_state* st, int func)
{
char type;
int idx, invalid = 0;
- script_function* sf = &buildin_func[str_data[func].val];
+ script_function* sf = &BUILDIN[str_data[func].val];
for( idx = 2; script_hasdata(st, idx); idx++ )
{
@@ -3462,7 +3427,7 @@ int run_func(struct script_state *st)
}
if(str_data[func].func){
- if (str_data[func].func(st)) //Report error
+ if (!(str_data[func].func(st))) //Report error
script_reportsrc(st);
} else {
ShowError("script:run_func: '%s' (id=%d type=%s) has no C function. please report this!!!\n", get_str(func), func, script_op2name(str_data[func].type));
@@ -3529,7 +3494,7 @@ void script_stop_sleeptimers(int id)
struct script_state* st;
for(;;)
{
- st = (struct script_state*)linkdb_erase(&sleep_db,(void*)__64BPRTSIZE(id));
+ st = (struct script_state*)linkdb_erase(&sleep_db,(void*)__64BPTRSIZE(id));
if( st == NULL )
break; // no more sleep timers
script_free_state(st);
@@ -3571,7 +3536,7 @@ int run_script_timer(int tid, unsigned int tick, int id, intptr_t data)
st->state = END;
}
while( node && st->sleep.timer != INVALID_TIMER ) {
- if( (int)__64BPRTSIZE(node->key) == st->oid && ((struct script_state *)node->data)->sleep.timer == st->sleep.timer ) {
+ if( (int)__64BPTRSIZE(node->key) == st->oid && ((struct script_state *)node->data)->sleep.timer == st->sleep.timer ) {
script_erase_sleepdb(node);
st->sleep.timer = INVALID_TIMER;
break;
@@ -3603,7 +3568,7 @@ static void script_detach_state(struct script_state* st, bool dequeue_event)
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
/**
* We're done with this NPC session, so we cancel the timer (if existent) and move on
**/
@@ -3649,7 +3614,7 @@ static void script_attach_state(struct script_state* st)
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
-#if SECURE_NPCTIMEOUT
+#ifdef SECURE_NPCTIMEOUT
if( sd->npc_idle_timer == INVALID_TIMER )
sd->npc_idle_timer = add_timer(gettick() + (SECURE_NPCTIMEOUT_INTERVAL*1000),npc_rr_secure_timeout_timer,sd->bl.id,0);
sd->npc_idle_tick = gettick();
@@ -3777,7 +3742,7 @@ void run_script_main(struct script_state *st)
st->sleep.charid = sd?sd->status.char_id:0;
st->sleep.timer = add_timer(gettick()+st->sleep.tick,
run_script_timer, st->sleep.charid, (intptr_t)st);
- linkdb_insert(&sleep_db, (void*)__64BPRTSIZE(st->oid), st);
+ linkdb_insert(&sleep_db, (void*)__64BPTRSIZE(st->oid), st);
}
else if(st->state != END && st->rid){
//Resume later (st is already attached to player).
@@ -3921,7 +3886,7 @@ void script_cleararray_pc(struct map_session_data* sd, const char* varname, void
{
for( idx = 0; idx < SCRIPT_MAX_ARRAYSIZE; idx++ )
{
- pc_setreg(sd, reference_uid(key, idx), (int)__64BPRTSIZE(value));
+ pc_setreg(sd, reference_uid(key, idx), (int)__64BPTRSIZE(value));
}
}
}
@@ -3953,7 +3918,7 @@ void script_setarray_pc(struct map_session_data* sd, const char* varname, uint8
}
else
{
- pc_setreg(sd, reference_uid(key, idx), (int)__64BPRTSIZE(value));
+ pc_setreg(sd, reference_uid(key, idx), (int)__64BPTRSIZE(value));
}
if( refcache )
@@ -3961,175 +3926,6 @@ void script_setarray_pc(struct map_session_data* sd, const char* varname, uint8
refcache[0] = key;
}
}
-#ifdef BETA_THREAD_TEST
-int buildin_query_sql_sub(struct script_state* st, Sql* handle);
-
-/* used to receive items the queryThread has already processed */
-int queryThread_timer(int tid, unsigned int tick, int id, intptr_t data) {
- int i, cursor = 0;
- bool allOk = true;
-
- EnterSpinLock(&queryThreadLock);
-
- for( i = 0; i < queryThreadData.count; i++ ) {
- struct queryThreadEntry *entry = queryThreadData.entry[i];
-
- if( !entry->ok ) {
- allOk = false;
- continue;
- }
-
- run_script_main(entry->st);
-
- entry->st = NULL;/* empty entries */
- aFree(entry);
- queryThreadData.entry[i] = NULL;
- }
-
-
- if( allOk ) {
- /* cancel the repeating timer -- it'll re-create itself when necessary, dont need to remain looping */
- delete_timer(queryThreadData.timer, queryThread_timer);
- queryThreadData.timer = INVALID_TIMER;
- }
-
- /* now lets clear the mess. */
- for( i = 0; i < queryThreadData.count; i++ ) {
- struct queryThreadEntry *entry = queryThreadData.entry[i];
- if( entry == NULL )
- continue;/* entry on hold */
-
- /* move */
- memmove(&queryThreadData.entry[cursor], &queryThreadData.entry[i], sizeof(struct queryThreadEntry*));
-
- cursor++;
- }
-
- queryThreadData.count = cursor;
-
- LeaveSpinLock(&queryThreadLock);
-
- return 0;
-}
-
-void queryThread_add(struct script_state *st, bool type) {
- int idx = 0;
- struct queryThreadEntry* entry = NULL;
-
- EnterSpinLock(&queryThreadLock);
-
- if( queryThreadData.count++ != 0 )
- RECREATE(queryThreadData.entry, struct queryThreadEntry* , queryThreadData.count);
-
- idx = queryThreadData.count-1;
-
- CREATE(queryThreadData.entry[idx],struct queryThreadEntry,1);
-
- entry = queryThreadData.entry[idx];
-
- entry->st = st;
- entry->ok = false;
- entry->type = type;
- if( queryThreadData.timer == INVALID_TIMER ) { /* start the receiver timer */
- queryThreadData.timer = add_timer_interval(gettick() + 100, queryThread_timer, 0, 0, 100);
- }
-
- LeaveSpinLock(&queryThreadLock);
-
- /* unlock the queryThread */
- racond_signal(queryThreadCond);
-}
-/* adds a new log to the queue */
-void queryThread_log(char * entry, int length) {
- int idx = logThreadData.count;
-
- EnterSpinLock(&queryThreadLock);
-
- if( logThreadData.count++ != 0 )
- RECREATE(logThreadData.entry, char* , logThreadData.count);
-
- CREATE(logThreadData.entry[idx], char, length + 1 );
- safestrncpy(logThreadData.entry[idx], entry, length + 1 );
-
- LeaveSpinLock(&queryThreadLock);
-
- /* unlock the queryThread */
- racond_signal(queryThreadCond);
-}
-
-/* queryThread_main */
-static void *queryThread_main(void *x) {
- Sql *queryThread_handle = Sql_Malloc();
- int i;
-
- if ( SQL_ERROR == Sql_Connect(queryThread_handle, map_server_id, map_server_pw, map_server_ip, map_server_port, map_server_db) )
- exit(EXIT_FAILURE);
-
- if( strlen(default_codepage) > 0 )
- if ( SQL_ERROR == Sql_SetEncoding(queryThread_handle, default_codepage) )
- Sql_ShowDebug(queryThread_handle);
-
- if( log_config.sql_logs ) {
- logmysql_handle = Sql_Malloc();
-
- if ( SQL_ERROR == Sql_Connect(logmysql_handle, log_db_id, log_db_pw, log_db_ip, log_db_port, log_db_db) )
- exit(EXIT_FAILURE);
-
- if( strlen(default_codepage) > 0 )
- if ( SQL_ERROR == Sql_SetEncoding(logmysql_handle, default_codepage) )
- Sql_ShowDebug(logmysql_handle);
- }
-
- while( 1 ) {
-
- if(queryThreadTerminate > 0)
- break;
-
- EnterSpinLock(&queryThreadLock);
-
- /* mess with queryThreadData within the lock */
- for( i = 0; i < queryThreadData.count; i++ ) {
- struct queryThreadEntry *entry = queryThreadData.entry[i];
-
- if( entry->ok )
- continue;
- else if ( !entry->st || !entry->st->stack ) {
- entry->ok = true;/* dispose */
- continue;
- }
-
- buildin_query_sql_sub(entry->st, entry->type ? logmysql_handle : queryThread_handle);
-
- entry->ok = true;/* we're done with this */
- }
-
- /* also check for any logs in need to be sent */
- if( log_config.sql_logs ) {
- for( i = 0; i < logThreadData.count; i++ ) {
- if( SQL_ERROR == Sql_Query(logmysql_handle, logThreadData.entry[i]) )
- Sql_ShowDebug(logmysql_handle);
- aFree(logThreadData.entry[i]);
- }
- logThreadData.count = 0;
- }
-
- LeaveSpinLock(&queryThreadLock);
-
- ramutex_lock( queryThreadMutex );
- racond_wait( queryThreadCond, queryThreadMutex, -1 );
- ramutex_unlock( queryThreadMutex );
-
- }
-
- Sql_Free(queryThread_handle);
-
- if( log_config.sql_logs ) {
- Sql_Free(logmysql_handle);
- }
-
- return NULL;
-}
-#endif
/*==========================================
* Destructor
*------------------------------------------*/
@@ -4210,35 +4006,12 @@ int do_final_script() {
if (str_buf)
aFree(str_buf);
- for( i = 0; i < atcmd_binding_count; i++ ) {
- aFree(atcmd_binding[i]);
+ for( i = 0; i < atcommand->binding_count; i++ ) {
+ aFree(atcommand->binding[i]);
}
- if( atcmd_binding_count != 0 )
- aFree(atcmd_binding);
-#ifdef BETA_THREAD_TEST
- /* QueryThread */
- InterlockedIncrement(&queryThreadTerminate);
- racond_signal(queryThreadCond);
- rathread_wait(queryThread, NULL);
-
- // Destroy cond var and mutex.
- racond_destroy( queryThreadCond );
- ramutex_destroy( queryThreadMutex );
-
- /* Clear missing vars */
- for( i = 0; i < queryThreadData.count; i++ ) {
- aFree(queryThreadData.entry[i]);
- }
-
- aFree(queryThreadData.entry);
-
- for( i = 0; i < logThreadData.count; i++ ) {
- aFree(logThreadData.entry[i]);
- }
-
- aFree(logThreadData.entry);
-#endif
+ if( atcommand->binding_count != 0 )
+ aFree(atcommand->binding);
return 0;
}
@@ -4251,66 +4024,23 @@ int do_init_script() {
autobonus_db = strdb_alloc(DB_OPT_DUP_KEY,0);
mapreg_init();
-#ifdef BETA_THREAD_TEST
- CREATE(queryThreadData.entry, struct queryThreadEntry*, 1);
- queryThreadData.count = 0;
- CREATE(logThreadData.entry, char *, 1);
- logThreadData.count = 0;
- /* QueryThread Start */
-
- InitializeSpinLock(&queryThreadLock);
-
- queryThreadData.timer = INVALID_TIMER;
- queryThreadTerminate = 0;
- queryThreadMutex = ramutex_create();
- queryThreadCond = racond_create();
-
- queryThread = rathread_create(queryThread_main, NULL);
-
- if(queryThread == NULL){
- ShowFatalError("do_init_script: cannot spawn Query Thread.\n");
- exit(EXIT_FAILURE);
- }
-
- add_timer_func_list(queryThread_timer, "queryThread_timer");
-#endif
return 0;
}
int script_reload() {
int i;
-#ifdef BETA_THREAD_TEST
- /* we're reloading so any queries undergoing should be...exterminated. */
- EnterSpinLock(&queryThreadLock);
-
- for( i = 0; i < queryThreadData.count; i++ ) {
- aFree(queryThreadData.entry[i]);
- }
- queryThreadData.count = 0;
-
- if( queryThreadData.timer != INVALID_TIMER ) {
- delete_timer(queryThreadData.timer, queryThread_timer);
- queryThreadData.timer = INVALID_TIMER;
- }
-
- LeaveSpinLock(&queryThreadLock);
-#endif
-
-
userfunc_db->clear(userfunc_db, db_script_free_code_sub);
db_clear(scriptlabel_db);
- // @commands (script based)
- // Clear bindings
- for( i = 0; i < atcmd_binding_count; i++ ) {
- aFree(atcmd_binding[i]);
+ for( i = 0; i < atcommand->binding_count; i++ ) {
+ aFree(atcommand->binding[i]);
}
- if( atcmd_binding_count != 0 )
- aFree(atcmd_binding);
+ if( atcommand->binding_count != 0 )
+ aFree(atcommand->binding);
- atcmd_binding_count = 0;
+ atcommand->binding_count = 0;
if(sleep_db) {
struct linkdb_node *n = (struct linkdb_node *)sleep_db;
@@ -4331,7 +4061,7 @@ int script_reload() {
#define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args }
#define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args }
-#define BUILDIN_FUNC(x) int buildin_ ## x (struct script_state* st)
+#define BUILDIN(x) bool buildin_ ## x (struct script_state* st)
/////////////////////////////////////////////////////////////////////
// NPC interaction
@@ -4341,12 +4071,12 @@ int script_reload() {
/// If a dialog doesn't exist yet, one is created.
///
/// mes "<message>";
-BUILDIN_FUNC(mes)
+BUILDIN(mes)
{
TBL_PC* sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if( !script_hasdata(st, 3) )
{// only a single line detected in the script
clif->scriptmes(sd, st->oid, script_getstr(st, 2));
@@ -4354,66 +4084,68 @@ BUILDIN_FUNC(mes)
else
{// parse multiple lines as they exist
int i;
-
+
for( i = 2; script_hasdata(st, i); i++ )
{
// send the message to the client
clif->scriptmes(sd, st->oid, script_getstr(st, i));
}
}
-
- return 0;
+
+ return true;
}
/// Displays the button 'next' in the npc dialog.
/// The dialog text is cleared and the script continues when the button is pressed.
///
/// next;
-BUILDIN_FUNC(next)
+BUILDIN(next)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+#ifdef SECURE_NPCTIMEOUT
+ sd->npc_idle_type = NPCT_WAIT;
+#endif
st->state = STOP;
clif->scriptnext(sd, st->oid);
- return 0;
+ return true;
}
/// Ends the script and displays the button 'close' on the npc dialog.
/// The dialog is closed when the button is pressed.
///
/// close;
-BUILDIN_FUNC(close)
+BUILDIN(close)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
st->state = CLOSE;
clif->scriptclose(sd, st->oid);
- return 0;
+ return true;
}
/// Displays the button 'close' on the npc dialog.
/// The dialog is closed and the script continues when the button is pressed.
///
/// close2;
-BUILDIN_FUNC(close2)
+BUILDIN(close2)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
st->state = STOP;
clif->scriptclose(sd, st->oid);
- return 0;
+ return true;
}
/// Counts the number of valid and total number of options in 'str'
@@ -4423,11 +4155,11 @@ static int menu_countoptions(const char* str, int max_count, int* total)
{
int count = 0;
int bogus_total;
-
+
if( total == NULL )
total = &bogus_total;
++(*total);
-
+
// initial empty options
while( *str == ':' )
{
@@ -4468,36 +4200,40 @@ static int menu_countoptions(const char* str, int max_count, int* total)
/// NOTE: the client closes the npc dialog when cancel is pressed
///
/// menu "<option_text>",<target_label>{,"<option_text>",<target_label>,...};
-BUILDIN_FUNC(menu)
+BUILDIN(menu)
{
int i;
const char* text;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
+#ifdef SECURE_NPCTIMEOUT
+ sd->npc_idle_type = NPCT_MENU;
+#endif
+
// TODO detect multiple scripts waiting for input at the same time, and what to do when that happens
if( sd->state.menu_or_input == 0 )
{
struct StringBuf buf;
struct script_data* data;
-
+
if( script_lastdata(st) % 2 == 0 )
{// argument count is not even (1st argument is at index 2)
ShowError("script:menu: illegal number of arguments (%d).\n", (script_lastdata(st) - 1));
st->state = END;
- return 1;
+ return false;
}
-
+
StringBuf_Init(&buf);
sd->npc_menu = 0;
for( i = 2; i < script_lastdata(st); i += 2 )
{
// menu options
text = script_getstr(st, i);
-
+
// target label
data = script_getdata(st, i+1);
if( !data_islabel(data) )
@@ -4506,9 +4242,9 @@ BUILDIN_FUNC(menu)
ShowError("script:menu: argument #%d (from 1) is not a label or label not found.\n", i);
script_reportdata(data);
st->state = END;
- return 1;
+ return false;
}
-
+
// append option(s)
if( text[0] == '\0' )
continue;// empty string, ignore
@@ -4519,7 +4255,7 @@ BUILDIN_FUNC(menu)
}
st->state = RERUNLINE;
sd->state.menu_or_input = 1;
-
+
/**
* menus beyond this length crash the client (see bugreport:6402)
**/
@@ -4533,9 +4269,9 @@ BUILDIN_FUNC(menu)
aFree(menu);
} else
clif->scriptmenu(sd, st->oid, StringBuf_Value(&buf));
-
+
StringBuf_Destroy(&buf);
-
+
if( sd->npc_menu >= 0xff )
{// client supports only up to 254 entries; 0 is not used and 255 is reserved for cancel; excess entries are displayed but cause 'uint8' overflow
ShowWarning("buildin_menu: Too many options specified (current=%d, max=254).\n", sd->npc_menu);
@@ -4550,15 +4286,15 @@ BUILDIN_FUNC(menu)
else
{// goto target label
int menu = 0;
-
+
sd->state.menu_or_input = 0;
if( sd->npc_menu <= 0 )
{
ShowDebug("script:menu: unexpected selection (%d)\n", sd->npc_menu);
st->state = END;
- return 1;
+ return false;
}
-
+
// get target label
for( i = 2; i < script_lastdata(st); i += 2 )
{
@@ -4571,20 +4307,20 @@ BUILDIN_FUNC(menu)
{// Invalid selection
ShowDebug("script:menu: selection is out of range (%d pairs are missing?) - please report this\n", sd->npc_menu);
st->state = END;
- return 1;
+ return false;
}
if( !data_islabel(script_getdata(st, i + 1)) )
{// TODO remove this temporary crash-prevention code (fallback for multiple scripts requesting user input)
ShowError("script:menu: unexpected data in label argument\n");
script_reportdata(script_getdata(st, i + 1));
st->state = END;
- return 1;
+ return false;
}
pc_setreg(sd, add_str("@menu"), menu);
st->pos = script_getnum(st, i + 1);
st->state = GOTO;
}
- return 0;
+ return true;
}
/// Displays a menu with options and returns the selected option.
@@ -4593,34 +4329,38 @@ BUILDIN_FUNC(menu)
/// select(<option_text>{,<option_text>,...}) -> <selected_option>
///
/// @see menu
-BUILDIN_FUNC(select)
+BUILDIN(select)
{
int i;
const char* text;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
+#ifdef SECURE_NPCTIMEOUT
+ sd->npc_idle_type = NPCT_MENU;
+#endif
+
if( sd->state.menu_or_input == 0 ) {
struct StringBuf buf;
-
+
StringBuf_Init(&buf);
sd->npc_menu = 0;
for( i = 2; i <= script_lastdata(st); ++i ) {
text = script_getstr(st, i);
-
+
if( sd->npc_menu > 0 )
StringBuf_AppendStr(&buf, ":");
-
+
StringBuf_AppendStr(&buf, text);
sd->npc_menu += menu_countoptions(text, 0, NULL);
}
-
+
st->state = RERUNLINE;
sd->state.menu_or_input = 1;
-
+
/**
* menus beyond this length crash the client (see bugreport:6402)
**/
@@ -4635,7 +4375,7 @@ BUILDIN_FUNC(select)
} else
clif->scriptmenu(sd, st->oid, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
-
+
if( sd->npc_menu >= 0xff ) {
ShowWarning("buildin_select: Too many options specified (current=%d, max=254).\n", sd->npc_menu);
script_reportsrc(st);
@@ -4645,7 +4385,7 @@ BUILDIN_FUNC(select)
st->state = END;
} else {// return selected option
int menu = 0;
-
+
sd->state.menu_or_input = 0;
for( i = 2; i <= script_lastdata(st); ++i ) {
text = script_getstr(st, i);
@@ -4657,7 +4397,7 @@ BUILDIN_FUNC(select)
script_pushint(st, menu);
st->state = RUN;
}
- return 0;
+ return true;
}
/// Displays a menu with options and returns the selected option.
@@ -4668,20 +4408,24 @@ BUILDIN_FUNC(select)
/// prompt(<option_text>{,<option_text>,...}) -> <selected_option>
///
/// @see menu
-BUILDIN_FUNC(prompt)
+BUILDIN(prompt)
{
int i;
const char *text;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
+#ifdef SECURE_NPCTIMEOUT
+ sd->npc_idle_type = NPCT_MENU;
+#endif
+
if( sd->state.menu_or_input == 0 )
{
struct StringBuf buf;
-
+
StringBuf_Init(&buf);
sd->npc_menu = 0;
for( i = 2; i <= script_lastdata(st); ++i )
@@ -4692,10 +4436,10 @@ BUILDIN_FUNC(prompt)
StringBuf_AppendStr(&buf, text);
sd->npc_menu += menu_countoptions(text, 0, NULL);
}
-
+
st->state = RERUNLINE;
sd->state.menu_or_input = 1;
-
+
/**
* menus beyond this length crash the client (see bugreport:6402)
**/
@@ -4710,7 +4454,7 @@ BUILDIN_FUNC(prompt)
} else
clif->scriptmenu(sd, st->oid, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
-
+
if( sd->npc_menu >= 0xff )
{
ShowWarning("buildin_prompt: Too many options specified (current=%d, max=254).\n", sd->npc_menu);
@@ -4727,7 +4471,7 @@ BUILDIN_FUNC(prompt)
else
{// return selected option
int menu = 0;
-
+
sd->state.menu_or_input = 0;
for( i = 2; i <= script_lastdata(st); ++i )
{
@@ -4740,7 +4484,7 @@ BUILDIN_FUNC(prompt)
script_pushint(st, menu);
st->state = RUN;
}
- return 0;
+ return true;
}
/////////////////////////////////////////////////////////////////////
@@ -4750,40 +4494,40 @@ BUILDIN_FUNC(prompt)
/// Jumps to the target script label.
///
/// goto <label>;
-BUILDIN_FUNC(goto)
+BUILDIN(goto)
{
if( !data_islabel(script_getdata(st,2)) )
{
ShowError("script:goto: not a label\n");
script_reportdata(script_getdata(st,2));
st->state = END;
- return 1;
+ return false;
}
-
+
st->pos = script_getnum(st,2);
st->state = GOTO;
- return 0;
+ return true;
}
/*==========================================
* user-defined function call
*------------------------------------------*/
-BUILDIN_FUNC(callfunc)
+BUILDIN(callfunc)
{
int i, j;
struct script_retinfo* ri;
struct script_code* scr;
const char* str = script_getstr(st,2);
DBMap **ref = NULL;
-
+
scr = (struct script_code*)strdb_get(userfunc_db, str);
if( !scr )
{
ShowError("script:callfunc: function not found! [%s]\n", str);
st->state = END;
- return 1;
+ return false;
}
-
+
for( i = st->start+3, j = 0; i < st->end; i++, j++ )
{
struct script_data* data = push_copy(st->stack,i);
@@ -4791,15 +4535,13 @@ BUILDIN_FUNC(callfunc)
{
const char* name = reference_getname(data);
if( name[0] == '.' ) {
- if ( !ref ) {
- ref = (struct DBMap**)aCalloc(sizeof(struct DBMap*), 1);
- ref[0] = (name[1] == '@' ? st->stack->var_function : st->script->script_vars);
- }
+ ref = (struct DBMap**)aCalloc(sizeof(struct DBMap*), 1);
+ ref[0] = (name[1] == '@' ? st->stack->var_function : st->script->script_vars);
data->ref = ref;
}
}
}
-
+
CREATE(ri, struct script_retinfo, 1);
ri->script = st->script;// script code
ri->var_function = st->stack->var_function;// scope variables
@@ -4807,33 +4549,33 @@ BUILDIN_FUNC(callfunc)
ri->nargs = j;// argument count
ri->defsp = st->stack->defsp;// default stack pointer
push_retinfo(st->stack, ri, ref);
-
+
st->pos = 0;
st->script = scr;
st->stack->defsp = st->stack->sp;
st->state = GOTO;
st->stack->var_function = idb_alloc(DB_OPT_RELEASE_DATA);
-
- return 0;
+
+ return true;
}
/*==========================================
* subroutine call
*------------------------------------------*/
-BUILDIN_FUNC(callsub)
+BUILDIN(callsub)
{
int i,j;
struct script_retinfo* ri;
int pos = script_getnum(st,2);
DBMap **ref = NULL;
-
+
if( !data_islabel(script_getdata(st,2)) && !data_isfunclabel(script_getdata(st,2)) )
{
ShowError("script:callsub: argument is not a label\n");
script_reportdata(script_getdata(st,2));
st->state = END;
- return 1;
+ return false;
}
-
+
for( i = st->start+3, j = 0; i < st->end; i++, j++ )
{
struct script_data* data = push_copy(st->stack,i);
@@ -4849,7 +4591,7 @@ BUILDIN_FUNC(callsub)
}
}
}
-
+
CREATE(ri, struct script_retinfo, 1);
ri->script = st->script;// script code
ri->var_function = st->stack->var_function;// scope variables
@@ -4857,34 +4599,34 @@ BUILDIN_FUNC(callsub)
ri->nargs = j;// argument count
ri->defsp = st->stack->defsp;// default stack pointer
push_retinfo(st->stack, ri, ref);
-
+
st->pos = pos;
st->stack->defsp = st->stack->sp;
st->state = GOTO;
st->stack->var_function = idb_alloc(DB_OPT_RELEASE_DATA);
-
- return 0;
+
+ return true;
}
/// Retrieves an argument provided to callfunc/callsub.
/// If the argument doesn't exist
///
/// getarg(<index>{,<default_value>}) -> <value>
-BUILDIN_FUNC(getarg)
+BUILDIN(getarg)
{
struct script_retinfo* ri;
int idx;
-
+
if( st->stack->defsp < 1 || st->stack->stack_data[st->stack->defsp - 1].type != C_RETINFO )
{
ShowError("script:getarg: no callfunc or callsub!\n");
st->state = END;
- return 1;
+ return false;
}
ri = st->stack->stack_data[st->stack->defsp - 1].u.ri;
-
+
idx = script_getnum(st,2);
-
+
if( idx >= 0 && idx < ri->nargs )
push_copy(st->stack, st->stack->defsp - 1 - ri->nargs + idx);
else if( script_hasdata(st,3) )
@@ -4893,10 +4635,10 @@ BUILDIN_FUNC(getarg)
{
ShowError("script:getarg: index (idx=%d) out of range (nargs=%d) and no default value found\n", idx, ri->nargs);
st->state = END;
- return 1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/// Returns from the current function, optionaly returning a value from the functions.
@@ -4904,7 +4646,7 @@ BUILDIN_FUNC(getarg)
///
/// return;
/// return <value>;
-BUILDIN_FUNC(return)
+BUILDIN(return)
{
if( script_hasdata(st,2) )
{// return value
@@ -4930,7 +4672,7 @@ BUILDIN_FUNC(return)
script_pushnil(st);
}
st->state = RETFUNC;
- return 0;
+ return true;
}
/// Returns a random number from 0 to <range>-1.
@@ -4938,12 +4680,12 @@ BUILDIN_FUNC(return)
/// If <min> is greater than <max>, their numbers are switched.
/// rand(<range>) -> <int>
/// rand(<min>,<max>) -> <int>
-BUILDIN_FUNC(rand)
+BUILDIN(rand)
{
int range;
int min;
int max;
-
+
if( script_hasdata(st,3) )
{// min,max
min = script_getnum(st,2);
@@ -4961,41 +4703,41 @@ BUILDIN_FUNC(rand)
script_pushint(st, min);
else
script_pushint(st, rnd()%range + min);
-
- return 0;
+
+ return true;
}
/*==========================================
* Warp sd to str,x,y or Random or SavePoint/Save
*------------------------------------------*/
-BUILDIN_FUNC(warp)
+BUILDIN(warp)
{
int ret;
int x,y;
const char* str;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
str = script_getstr(st,2);
x = script_getnum(st,3);
y = script_getnum(st,4);
-
+
if(strcmp(str,"Random")==0)
ret = pc_randomwarp(sd,CLR_TELEPORT);
else if(strcmp(str,"SavePoint")==0 || strcmp(str,"Save")==0)
ret = pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
else
ret = pc_setpos(sd,mapindex_name2id(str),x,y,CLR_OUTSIGHT);
-
+
if( ret ) {
ShowError("buildin_warp: moving player '%s' to \"%s\",%d,%d failed.\n", sd->status.name, str, x, y);
script_reportsrc(st);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Warp a specified area
@@ -5004,42 +4746,42 @@ static int buildin_areawarp_sub(struct block_list *bl,va_list ap)
{
int x2,y2,x3,y3;
unsigned int index;
-
+
index = va_arg(ap,unsigned int);
x2 = va_arg(ap,int);
y2 = va_arg(ap,int);
x3 = va_arg(ap,int);
y3 = va_arg(ap,int);
-
+
if(index == 0)
pc_randomwarp((TBL_PC *)bl,CLR_TELEPORT);
else if(x3 && y3) {
int max, tx, ty, j = 0;
-
+
// choose a suitable max number of attempts
if( (max = (y3-y2+1)*(x3-x2+1)*3) > 1000 )
max = 1000;
-
+
// find a suitable map cell
do {
tx = rnd()%(x3-x2+1)+x2;
ty = rnd()%(y3-y2+1)+y2;
j++;
} while( map_getcell(index,tx,ty,CELL_CHKNOPASS) && j < max );
-
+
pc_setpos((TBL_PC *)bl,index,tx,ty,CLR_OUTSIGHT);
}
else
pc_setpos((TBL_PC *)bl,index,x2,y2,CLR_OUTSIGHT);
return 0;
}
-BUILDIN_FUNC(areawarp)
+BUILDIN(areawarp)
{
int16 m, x0,y0,x1,y1, x2,y2,x3=0,y3=0;
unsigned int index;
const char *str;
const char *mapname;
-
+
mapname = script_getstr(st,2);
x0 = script_getnum(st,3);
y0 = script_getnum(st,4);
@@ -5048,7 +4790,7 @@ BUILDIN_FUNC(areawarp)
str = script_getstr(st,7);
x2 = script_getnum(st,8);
y2 = script_getnum(st,9);
-
+
if( script_hasdata(st,10) && script_hasdata(st,11) ) { // Warp area to area
if( (x3 = script_getnum(st,10)) < 0 || (y3 = script_getnum(st,11)) < 0 ){
x3 = 0;
@@ -5059,17 +4801,17 @@ BUILDIN_FUNC(areawarp)
if( y3 < y2 ) swap(y3,y2);
}
}
-
+
if( (m = map_mapname2mapid(mapname)) < 0 )
- return 0;
-
+ return true;
+
if( strcmp(str,"Random") == 0 )
index = 0;
else if( !(index=mapindex_name2id(str)) )
- return 0;
-
+ return true;
+
map_foreachinarea(buildin_areawarp_sub, m,x0,y0,x1,y1, BL_PC, index,x2,y2,x3,y3);
- return 0;
+ return true;
}
/*==========================================
@@ -5083,12 +4825,12 @@ static int buildin_areapercentheal_sub(struct block_list *bl,va_list ap)
pc_percentheal((TBL_PC *)bl,hp,sp);
return 0;
}
-BUILDIN_FUNC(areapercentheal)
+BUILDIN(areapercentheal)
{
int hp,sp,m;
const char *mapname;
int x0,y0,x1,y1;
-
+
mapname=script_getstr(st,2);
x0=script_getnum(st,3);
y0=script_getnum(st,4);
@@ -5096,12 +4838,12 @@ BUILDIN_FUNC(areapercentheal)
y1=script_getnum(st,6);
hp=script_getnum(st,7);
sp=script_getnum(st,8);
-
+
if( (m=map_mapname2mapid(mapname))< 0)
- return 0;
-
+ return true;
+
map_foreachinarea(buildin_areapercentheal_sub,m,x0,y0,x1,y1,BL_PC,hp,sp);
- return 0;
+ return true;
}
/*==========================================
@@ -5110,37 +4852,37 @@ BUILDIN_FUNC(areapercentheal)
* another player npc-session.
* Using: warpchar "mapname",x,y,Char_ID;
*------------------------------------------*/
-BUILDIN_FUNC(warpchar)
+BUILDIN(warpchar)
{
int x,y,a;
const char *str;
TBL_PC *sd;
-
+
str=script_getstr(st,2);
x=script_getnum(st,3);
y=script_getnum(st,4);
a=script_getnum(st,5);
-
+
sd = map_charid2sd(a);
if( sd == NULL )
- return 0;
-
+ return true;
+
if(strcmp(str, "Random") == 0)
pc_randomwarp(sd, CLR_TELEPORT);
else
- if(strcmp(str, "SavePoint") == 0)
- pc_setpos(sd, sd->status.save_point.map,sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
- else
- pc_setpos(sd, mapindex_name2id(str), x, y, CLR_TELEPORT);
-
- return 0;
+ if(strcmp(str, "SavePoint") == 0)
+ pc_setpos(sd, sd->status.save_point.map,sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
+ else
+ pc_setpos(sd, mapindex_name2id(str), x, y, CLR_TELEPORT);
+
+ return true;
}
/*==========================================
* Warpparty - [Fredzilla] [Paradox924X]
* Syntax: warpparty "to_mapname",x,y,Party_ID,{"from_mapname"};
* If 'from_mapname' is specified, only the party members on that map will be warped
*------------------------------------------*/
-BUILDIN_FUNC(warpparty)
+BUILDIN(warpparty)
{
TBL_PC *sd = NULL;
TBL_PC *pl_sd;
@@ -5148,7 +4890,7 @@ BUILDIN_FUNC(warpparty)
int type;
int mapindex;
int i;
-
+
const char* str = script_getstr(st,2);
int x = script_getnum(st,3);
int y = script_getnum(st,4);
@@ -5156,235 +4898,235 @@ BUILDIN_FUNC(warpparty)
const char* str2 = NULL;
if ( script_hasdata(st,6) )
str2 = script_getstr(st,6);
-
+
p = party_search(p_id);
if(!p)
- return 0;
-
+ return true;
+
type = ( strcmp(str,"Random")==0 ) ? 0
- : ( strcmp(str,"SavePointAll")==0 ) ? 1
- : ( strcmp(str,"SavePoint")==0 ) ? 2
- : ( strcmp(str,"Leader")==0 ) ? 3
- : 4;
-
+ : ( strcmp(str,"SavePointAll")==0 ) ? 1
+ : ( strcmp(str,"SavePoint")==0 ) ? 2
+ : ( strcmp(str,"Leader")==0 ) ? 3
+ : 4;
+
switch (type)
{
- case 3:
- for(i = 0; i < MAX_PARTY && !p->party.member[i].leader; i++);
- if (i == MAX_PARTY || !p->data[i].sd) //Leader not found / not online
- return 0;
- pl_sd = p->data[i].sd;
- mapindex = pl_sd->mapindex;
- x = pl_sd->bl.x;
- y = pl_sd->bl.y;
- break;
- case 4:
- mapindex = mapindex_name2id(str);
- break;
- case 2:
- //"SavePoint" uses save point of the currently attached player
- if (( sd = script_rid2sd(st) ) == NULL )
- return 0;
- default:
- mapindex = 0;
- break;
+ case 3:
+ for(i = 0; i < MAX_PARTY && !p->party.member[i].leader; i++);
+ if (i == MAX_PARTY || !p->data[i].sd) //Leader not found / not online
+ return true;
+ pl_sd = p->data[i].sd;
+ mapindex = pl_sd->mapindex;
+ x = pl_sd->bl.x;
+ y = pl_sd->bl.y;
+ break;
+ case 4:
+ mapindex = mapindex_name2id(str);
+ break;
+ case 2:
+ //"SavePoint" uses save point of the currently attached player
+ if (( sd = script_rid2sd(st) ) == NULL )
+ return true;
+ default:
+ mapindex = 0;
+ break;
}
-
+
for (i = 0; i < MAX_PARTY; i++)
{
if( !(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id )
continue;
-
+
if( str2 && strcmp(str2, map[pl_sd->bl.m].name) != 0 )
continue;
-
+
if( pc_isdead(pl_sd) )
continue;
-
+
switch( type )
{
- case 0: // Random
- if(!map[pl_sd->bl.m].flag.nowarp)
- pc_randomwarp(pl_sd,CLR_TELEPORT);
- break;
- case 1: // SavePointAll
- if(!map[pl_sd->bl.m].flag.noreturn)
- pc_setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
- break;
- case 2: // SavePoint
- if(!map[pl_sd->bl.m].flag.noreturn)
- pc_setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
- break;
- case 3: // Leader
- case 4: // m,x,y
- if(!map[pl_sd->bl.m].flag.noreturn && !map[pl_sd->bl.m].flag.nowarp)
- pc_setpos(pl_sd,mapindex,x,y,CLR_TELEPORT);
- break;
+ case 0: // Random
+ if(!map[pl_sd->bl.m].flag.nowarp)
+ pc_randomwarp(pl_sd,CLR_TELEPORT);
+ break;
+ case 1: // SavePointAll
+ if(!map[pl_sd->bl.m].flag.noreturn)
+ pc_setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
+ break;
+ case 2: // SavePoint
+ if(!map[pl_sd->bl.m].flag.noreturn)
+ pc_setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ break;
+ case 3: // Leader
+ case 4: // m,x,y
+ if(!map[pl_sd->bl.m].flag.noreturn && !map[pl_sd->bl.m].flag.nowarp)
+ pc_setpos(pl_sd,mapindex,x,y,CLR_TELEPORT);
+ break;
}
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Warpguild - [Fredzilla]
* Syntax: warpguild "mapname",x,y,Guild_ID;
*------------------------------------------*/
-BUILDIN_FUNC(warpguild)
+BUILDIN(warpguild)
{
TBL_PC *sd = NULL;
TBL_PC *pl_sd;
struct guild* g;
struct s_mapiterator* iter;
int type;
-
+
const char* str = script_getstr(st,2);
int x = script_getnum(st,3);
int y = script_getnum(st,4);
int gid = script_getnum(st,5);
-
+
g = guild_search(gid);
if( g == NULL )
- return 0;
-
+ return true;
+
type = ( strcmp(str,"Random")==0 ) ? 0
- : ( strcmp(str,"SavePointAll")==0 ) ? 1
- : ( strcmp(str,"SavePoint")==0 ) ? 2
- : 3;
-
+ : ( strcmp(str,"SavePointAll")==0 ) ? 1
+ : ( strcmp(str,"SavePoint")==0 ) ? 2
+ : 3;
+
if( type == 2 && ( sd = script_rid2sd(st) ) == NULL )
{// "SavePoint" uses save point of the currently attached player
- return 0;
+ return true;
}
-
+
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
if( pl_sd->status.guild_id != gid )
continue;
-
+
switch( type )
{
- case 0: // Random
- if(!map[pl_sd->bl.m].flag.nowarp)
- pc_randomwarp(pl_sd,CLR_TELEPORT);
- break;
- case 1: // SavePointAll
- if(!map[pl_sd->bl.m].flag.noreturn)
- pc_setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
- break;
- case 2: // SavePoint
- if(!map[pl_sd->bl.m].flag.noreturn)
- pc_setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
- break;
- case 3: // m,x,y
- if(!map[pl_sd->bl.m].flag.noreturn && !map[pl_sd->bl.m].flag.nowarp)
- pc_setpos(pl_sd,mapindex_name2id(str),x,y,CLR_TELEPORT);
- break;
+ case 0: // Random
+ if(!map[pl_sd->bl.m].flag.nowarp)
+ pc_randomwarp(pl_sd,CLR_TELEPORT);
+ break;
+ case 1: // SavePointAll
+ if(!map[pl_sd->bl.m].flag.noreturn)
+ pc_setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
+ break;
+ case 2: // SavePoint
+ if(!map[pl_sd->bl.m].flag.noreturn)
+ pc_setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ break;
+ case 3: // m,x,y
+ if(!map[pl_sd->bl.m].flag.noreturn && !map[pl_sd->bl.m].flag.nowarp)
+ pc_setpos(pl_sd,mapindex_name2id(str),x,y,CLR_TELEPORT);
+ break;
}
}
mapit_free(iter);
-
- return 0;
+
+ return true;
}
/*==========================================
* Force Heal a player (hp and sp)
*------------------------------------------*/
-BUILDIN_FUNC(heal)
+BUILDIN(heal)
{
TBL_PC *sd;
int hp,sp;
-
+
sd = script_rid2sd(st);
- if (!sd) return 0;
-
+ if (!sd) return true;
+
hp=script_getnum(st,2);
sp=script_getnum(st,3);
status_heal(&sd->bl, hp, sp, 1);
- return 0;
+ return true;
}
/*==========================================
* Heal a player by item (get vit bonus etc)
*------------------------------------------*/
-BUILDIN_FUNC(itemheal)
+BUILDIN(itemheal)
{
TBL_PC *sd;
int hp,sp;
-
+
hp=script_getnum(st,2);
sp=script_getnum(st,3);
-
+
if(potion_flag==1) {
potion_hp = hp;
potion_sp = sp;
- return 0;
+ return true;
}
-
+
sd = script_rid2sd(st);
- if (!sd) return 0;
+ if (!sd) return true;
pc_itemheal(sd,sd->itemid,hp,sp);
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(percentheal)
+BUILDIN(percentheal)
{
int hp,sp;
TBL_PC* sd;
-
+
hp=script_getnum(st,2);
sp=script_getnum(st,3);
-
+
if(potion_flag==1) {
potion_per_hp = hp;
potion_per_sp = sp;
- return 0;
+ return true;
}
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
+ return true;
#ifdef RENEWAL
if( sd->sc.data[SC_EXTREMITYFIST2] )
sp = 0;
#endif
pc_percentheal(sd,hp,sp);
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(jobchange)
+BUILDIN(jobchange)
{
int job, upper=-1;
-
+
job=script_getnum(st,2);
if( script_hasdata(st,3) )
upper=script_getnum(st,3);
-
+
if (pcdb_checkid(job))
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
pc_jobchange(sd, job, upper);
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(jobname)
+BUILDIN(jobname)
{
int class_=script_getnum(st,2);
script_pushconststr(st, (char*)job_name(class_));
- return 0;
+ return true;
}
/// Get input from the player.
@@ -5394,7 +5136,7 @@ BUILDIN_FUNC(jobname)
/// shorter than 'min' and 0 otherwise.
///
/// input(<var>{,<min>{,<max>}}) -> <int>
-BUILDIN_FUNC(input)
+BUILDIN(input)
{
TBL_PC* sd;
struct script_data* data;
@@ -5402,23 +5144,27 @@ BUILDIN_FUNC(input)
const char* name;
int min;
int max;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
data = script_getdata(st,2);
if( !data_isreference(data) ){
ShowError("script:input: not a variable\n");
script_reportdata(data);
st->state = END;
- return 1;
+ return false;
}
uid = reference_getuid(data);
name = reference_getname(data);
min = (script_hasdata(st,3) ? script_getnum(st,3) : script_config.input_min_value);
max = (script_hasdata(st,4) ? script_getnum(st,4) : script_config.input_max_value);
-
+
+#ifdef SECURE_NPCTIMEOUT
+ sd->npc_idle_type = NPCT_WAIT;
+#endif
+
if( !sd->state.menu_or_input )
{ // first invocation, display npc input box
sd->state.menu_or_input = 1;
@@ -5440,22 +5186,22 @@ BUILDIN_FUNC(input)
else
{
int amount = sd->npc_amount;
- set_reg(st, sd, uid, name, (void*)__64BPRTSIZE(cap_value(amount,min,max)), script_getref(st,2));
+ set_reg(st, sd, uid, name, (void*)__64BPTRSIZE(cap_value(amount,min,max)), script_getref(st,2));
script_pushint(st, (amount > max ? 1 : amount < min ? -1 : 0));
}
st->state = RUN;
}
- return 0;
+ return true;
}
// declare the copyarray method here for future reference
-BUILDIN_FUNC(copyarray);
+BUILDIN(copyarray);
/// Sets the value of a variable.
/// The value is converted to the type of the variable.
///
/// set(<variable>,<value>) -> <variable>
-BUILDIN_FUNC(set)
+BUILDIN(set)
{
TBL_PC* sd = NULL;
struct script_data* data;
@@ -5463,7 +5209,7 @@ BUILDIN_FUNC(set)
int num;
const char* name;
char prefix;
-
+
data = script_getdata(st,2);
//datavalue = script_getdata(st,3);
if( !data_isreference(data) )
@@ -5471,60 +5217,60 @@ BUILDIN_FUNC(set)
ShowError("script:set: not a variable\n");
script_reportdata(script_getdata(st,2));
st->state = END;
- return 1;
+ return false;
}
-
+
num = reference_getuid(data);
name = reference_getname(data);
prefix = *name;
-
+
if( not_server_variable(prefix) )
{
sd = script_rid2sd(st);
if( sd == NULL )
{
ShowError("script:set: no player attached for player variable '%s'\n", name);
- return 0;
+ return true;
}
}
-
+
#if 0
if( data_isreference(datavalue) )
{// the value being referenced is a variable
const char* namevalue = reference_getname(datavalue);
-
+
if( !not_array_variable(*namevalue) )
{// array variable being copied into another array variable
if( sd == NULL && not_server_variable(*namevalue) && !(sd = script_rid2sd(st)) )
{// player must be attached in order to copy a player variable
ShowError("script:set: no player attached for player variable '%s'\n", namevalue);
- return 0;
+ return true;
}
-
+
if( is_string_variable(namevalue) != is_string_variable(name) )
{// non-matching array value types
ShowWarning("script:set: two array variables do not match in type.\n");
- return 0;
+ return true;
}
-
+
// push the maximum number of array values to the stack
push_val(st->stack, C_INT, SCRIPT_MAX_ARRAYSIZE);
-
+
// call the copy array method directly
return buildin_copyarray(st);
}
}
#endif
-
+
if( is_string_variable(name) )
set_reg(st,sd,num,name,(void*)script_getstr(st,3),script_getref(st,2));
else
- set_reg(st,sd,num,name,(void*)__64BPRTSIZE(script_getnum(st,3)),script_getref(st,2));
-
+ set_reg(st,sd,num,name,(void*)__64BPTRSIZE(script_getnum(st,3)),script_getref(st,2));
+
// return a copy of the variable reference
script_pushcopy(st,2);
-
- return 0;
+
+ return true;
}
/////////////////////////////////////////////////////////////////////
@@ -5535,7 +5281,7 @@ BUILDIN_FUNC(set)
static int32 getarraysize(struct script_state* st, int32 id, int32 idx, int isstring, struct DBMap** ref)
{
int32 ret = idx;
-
+
if( isstring )
{
for( ; idx < SCRIPT_MAX_ARRAYSIZE; ++idx )
@@ -5550,7 +5296,7 @@ static int32 getarraysize(struct script_state* st, int32 id, int32 idx, int isst
{
for( ; idx < SCRIPT_MAX_ARRAYSIZE; ++idx )
{
- int32 num = (int32)__64BPRTSIZE(get_val2(st, reference_uid(id, idx), ref));
+ int32 num = (int32)__64BPTRSIZE(get_val2(st, reference_uid(id, idx), ref));
if( num )
ret = idx + 1;
script_removetop(st, -1, 0);
@@ -5563,7 +5309,7 @@ static int32 getarraysize(struct script_state* st, int32 id, int32 idx, int isst
/// ex: setarray arr[1],1,2,3;
///
/// setarray <array variable>,<value1>{,<value2>...};
-BUILDIN_FUNC(setarray)
+BUILDIN(setarray)
{
struct script_data* data;
const char* name;
@@ -5572,16 +5318,16 @@ BUILDIN_FUNC(setarray)
int32 id;
int32 i;
TBL_PC* sd = NULL;
-
+
data = script_getdata(st, 2);
if( !data_isreference(data) )
{
ShowError("script:setarray: not a variable\n");
script_reportdata(data);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
id = reference_getid(data);
start = reference_getindex(data);
name = reference_getname(data);
@@ -5590,20 +5336,20 @@ BUILDIN_FUNC(setarray)
ShowError("script:setarray: illegal scope\n");
script_reportdata(data);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
if( not_server_variable(*name) )
{
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached
+ return true;// no player attached
}
-
+
end = start + script_lastdata(st) - 2;
if( end > SCRIPT_MAX_ARRAYSIZE )
end = SCRIPT_MAX_ARRAYSIZE;
-
+
if( is_string_variable(name) )
{// string array
for( i = 3; start < end; ++start, ++i )
@@ -5612,16 +5358,16 @@ BUILDIN_FUNC(setarray)
else
{// int array
for( i = 3; start < end; ++start, ++i )
- set_reg(st, sd, reference_uid(id, start), name, (void*)__64BPRTSIZE(script_getnum(st,i)), reference_getref(data));
+ set_reg(st, sd, reference_uid(id, start), name, (void*)__64BPTRSIZE(script_getnum(st,i)), reference_getref(data));
}
- return 0;
+ return true;
}
/// Sets count values of an array, from the starting index.
/// ex: cleararray arr[0],0,1;
///
/// cleararray <array variable>,<value>,<count>;
-BUILDIN_FUNC(cleararray)
+BUILDIN(cleararray)
{
struct script_data* data;
const char* name;
@@ -5630,16 +5376,16 @@ BUILDIN_FUNC(cleararray)
int32 id;
void* v;
TBL_PC* sd = NULL;
-
+
data = script_getdata(st, 2);
if( !data_isreference(data) )
{
ShowError("script:cleararray: not a variable\n");
script_reportdata(data);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
id = reference_getid(data);
start = reference_getindex(data);
name = reference_getname(data);
@@ -5648,35 +5394,35 @@ BUILDIN_FUNC(cleararray)
ShowError("script:cleararray: illegal scope\n");
script_reportdata(data);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
if( not_server_variable(*name) )
{
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached
+ return true;// no player attached
}
-
+
if( is_string_variable(name) )
v = (void*)script_getstr(st, 3);
else
- v = (void*)__64BPRTSIZE(script_getnum(st, 3));
-
+ v = (void*)__64BPTRSIZE(script_getnum(st, 3));
+
end = start + script_getnum(st, 4);
if( end > SCRIPT_MAX_ARRAYSIZE )
end = SCRIPT_MAX_ARRAYSIZE;
-
+
for( ; start < end; ++start )
set_reg(st, sd, reference_uid(id, start), name, v, script_getref(st,2));
- return 0;
+ return true;
}
/// Copies data from one array to another.
/// ex: copyarray arr[0],arr[2],2;
///
/// copyarray <destination array variable>,<source array variable>,<count>;
-BUILDIN_FUNC(copyarray)
+BUILDIN(copyarray)
{
struct script_data* data1;
struct script_data* data2;
@@ -5690,7 +5436,7 @@ BUILDIN_FUNC(copyarray)
int32 i;
int32 count;
TBL_PC* sd = NULL;
-
+
data1 = script_getdata(st, 2);
data2 = script_getdata(st, 3);
if( !data_isreference(data1) || !data_isreference(data2) )
@@ -5699,9 +5445,9 @@ BUILDIN_FUNC(copyarray)
script_reportdata(data1);
script_reportdata(data2);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
id1 = reference_getid(data1);
id2 = reference_getid(data2);
idx1 = reference_getindex(data1);
@@ -5714,31 +5460,31 @@ BUILDIN_FUNC(copyarray)
script_reportdata(data1);
script_reportdata(data2);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
if( is_string_variable(name1) != is_string_variable(name2) )
{
ShowError("script:copyarray: type mismatch\n");
script_reportdata(data1);
script_reportdata(data2);
st->state = END;
- return 1;// data type mismatch
+ return false;// data type mismatch
}
-
+
if( not_server_variable(*name1) || not_server_variable(*name2) )
{
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached
+ return true;// no player attached
}
-
+
count = script_getnum(st, 4);
if( count > SCRIPT_MAX_ARRAYSIZE - idx1 )
count = SCRIPT_MAX_ARRAYSIZE - idx1;
if( count <= 0 || (id1 == id2 && idx1 == idx2) )
- return 0;// nothing to copy
-
+ return true;// nothing to copy
+
if( id1 == id2 && idx1 > idx2 )
{// destination might be overlapping the source - copy in reverse order
for( i = count - 1; i >= 0; --i )
@@ -5762,7 +5508,7 @@ BUILDIN_FUNC(copyarray)
set_reg(st, sd, reference_uid(id1, idx1 + i), name1, (is_string_variable(name1)?(void*)"":(void*)0), reference_getref(data1));
}
}
- return 0;
+ return true;
}
/// Returns the size of the array.
@@ -5770,11 +5516,11 @@ BUILDIN_FUNC(copyarray)
/// ex: getarraysize(arr[3])
///
/// getarraysize(<array variable>) -> <int>
-BUILDIN_FUNC(getarraysize)
+BUILDIN(getarraysize)
{
struct script_data* data;
const char* name;
-
+
data = script_getdata(st, 2);
if( !data_isreference(data) )
{
@@ -5782,9 +5528,9 @@ BUILDIN_FUNC(getarraysize)
script_reportdata(data);
script_pushnil(st);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
name = reference_getname(data);
if( not_array_variable(*name) )
{
@@ -5792,11 +5538,11 @@ BUILDIN_FUNC(getarraysize)
script_reportdata(data);
script_pushnil(st);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
script_pushint(st, getarraysize(st, reference_getid(data), reference_getindex(data), is_string_variable(name), reference_getref(data)));
- return 0;
+ return true;
}
/// Deletes count or all the elements in an array, from the starting index.
@@ -5804,7 +5550,7 @@ BUILDIN_FUNC(getarraysize)
///
/// deletearray <array variable>;
/// deletearray <array variable>,<count>;
-BUILDIN_FUNC(deletearray)
+BUILDIN(deletearray)
{
struct script_data* data;
const char* name;
@@ -5812,16 +5558,16 @@ BUILDIN_FUNC(deletearray)
int end;
int id;
TBL_PC *sd = NULL;
-
+
data = script_getdata(st, 2);
if( !data_isreference(data) )
{
ShowError("script:deletearray: not a variable\n");
script_reportdata(data);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
id = reference_getid(data);
start = reference_getindex(data);
name = reference_getname(data);
@@ -5830,29 +5576,29 @@ BUILDIN_FUNC(deletearray)
ShowError("script:deletearray: illegal scope\n");
script_reportdata(data);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
if( not_server_variable(*name) )
{
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached
+ return true;// no player attached
}
-
+
end = SCRIPT_MAX_ARRAYSIZE;
-
+
if( start >= end )
- return 0;// nothing to free
-
+ return true;// nothing to free
+
if( script_hasdata(st,3) )
{
int count = script_getnum(st, 3);
if( count > end - start )
count = end - start;
if( count <= 0 )
- return 0;// nothing to free
-
+ return true;// nothing to free
+
// move rest of the elements backward
for( ; start + count < end; ++start )
{
@@ -5861,7 +5607,7 @@ BUILDIN_FUNC(deletearray)
script_removetop(st, -1, 0);
}
}
-
+
// clear the rest of the array
if( is_string_variable(name) )
{
@@ -5873,20 +5619,20 @@ BUILDIN_FUNC(deletearray)
for( ; start < end; ++start )
set_reg(st, sd, reference_uid(id, start), name, (void*)0, reference_getref(data));
}
- return 0;
+ return true;
}
/// Returns a reference to the target index of the array variable.
/// Equivalent to var[index].
///
/// getelementofarray(<array variable>,<index>) -> <variable reference>
-BUILDIN_FUNC(getelementofarray)
+BUILDIN(getelementofarray)
{
struct script_data* data;
const char* name;
int32 id;
int i;
-
+
data = script_getdata(st, 2);
if( !data_isreference(data) )
{
@@ -5894,9 +5640,9 @@ BUILDIN_FUNC(getelementofarray)
script_reportdata(data);
script_pushnil(st);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
id = reference_getid(data);
name = reference_getname(data);
if( not_array_variable(*name) )
@@ -5905,9 +5651,9 @@ BUILDIN_FUNC(getelementofarray)
script_reportdata(data);
script_pushnil(st);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
i = script_getnum(st, 3);
if( i < 0 || i >= SCRIPT_MAX_ARRAYSIZE )
{
@@ -5915,11 +5661,11 @@ BUILDIN_FUNC(getelementofarray)
script_reportdata(data);
script_pushnil(st);
st->state = END;
- return 1;// out of range
+ return false;// out of range
}
-
+
push_val2(st->stack, C_NAME, reference_uid(id, i), reference_getref(data));
- return 0;
+ return true;
}
/////////////////////////////////////////////////////////////////////
@@ -5929,97 +5675,97 @@ BUILDIN_FUNC(getelementofarray)
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(setlook)
+BUILDIN(setlook)
{
int type,val;
TBL_PC* sd;
-
+
type=script_getnum(st,2);
val=script_getnum(st,3);
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
pc_changelook(sd,type,val);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(changelook)
+BUILDIN(changelook)
{ // As setlook but only client side
int type,val;
TBL_PC* sd;
-
+
type=script_getnum(st,2);
val=script_getnum(st,3);
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
clif->changelook(&sd->bl,type,val);
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(cutin)
+BUILDIN(cutin)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
clif->cutin(sd,script_getstr(st,2),script_getnum(st,3));
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(viewpoint)
+BUILDIN(viewpoint)
{
int type,x,y,id,color;
TBL_PC* sd;
-
+
type=script_getnum(st,2);
x=script_getnum(st,3);
y=script_getnum(st,4);
id=script_getnum(st,5);
color=script_getnum(st,6);
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
clif->viewpoint(sd,st->oid,type,x,y,id,color);
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(countitem)
+BUILDIN(countitem)
{
int nameid, i;
int count = 0;
struct item_data* id = NULL;
struct script_data* data;
-
+
TBL_PC* sd = script_rid2sd(st);
if (!sd) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
data = script_getdata(st,2);
get_val(st, data); // convert into value in case of a variable
-
+
if( data_isstring(data) )
{// item name
id = itemdb_searchname(conv_str(st, data));
@@ -6028,45 +5774,45 @@ BUILDIN_FUNC(countitem)
{// item id
id = itemdb_exists(conv_num(st, data));
}
-
+
if( id == NULL )
{
ShowError("buildin_countitem: Invalid item '%s'.\n", script_getstr(st,2)); // returns string, regardless of what it was
script_pushint(st,0);
- return 1;
+ return false;
}
-
+
nameid = id->nameid;
-
+
for(i = 0; i < MAX_INVENTORY; i++)
if(sd->status.inventory[i].nameid == nameid)
count += sd->status.inventory[i].amount;
-
+
script_pushint(st,count);
- return 0;
+ return true;
}
/*==========================================
* countitem2(nameID,Identified,Refine,Attribute,Card0,Card1,Card2,Card3) [Lupus]
* returns number of items that meet the conditions
*------------------------------------------*/
-BUILDIN_FUNC(countitem2)
+BUILDIN(countitem2)
{
int nameid, iden, ref, attr, c1, c2, c3, c4;
int count = 0;
int i;
struct item_data* id = NULL;
struct script_data* data;
-
+
TBL_PC* sd = script_rid2sd(st);
if (!sd) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
data = script_getdata(st,2);
get_val(st, data); // convert into value in case of a variable
-
+
if( data_isstring(data) )
{// item name
id = itemdb_searchname(conv_str(st, data));
@@ -6075,14 +5821,14 @@ BUILDIN_FUNC(countitem2)
{// item id
id = itemdb_exists(conv_num(st, data));
}
-
+
if( id == NULL )
{
ShowError("buildin_countitem2: Invalid item '%s'.\n", script_getstr(st,2)); // returns string, regardless of what it was
script_pushint(st,0);
- return 1;
+ return false;
}
-
+
nameid = id->nameid;
iden = script_getnum(st,3);
ref = script_getnum(st,4);
@@ -6091,7 +5837,7 @@ BUILDIN_FUNC(countitem2)
c2 = (short)script_getnum(st,7);
c3 = (short)script_getnum(st,8);
c4 = (short)script_getnum(st,9);
-
+
for(i = 0; i < MAX_INVENTORY; i++)
if (sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] != NULL &&
sd->status.inventory[i].amount > 0 && sd->status.inventory[i].nameid == nameid &&
@@ -6099,11 +5845,11 @@ BUILDIN_FUNC(countitem2)
sd->status.inventory[i].attribute == attr && sd->status.inventory[i].card[0] == c1 &&
sd->status.inventory[i].card[1] == c2 && sd->status.inventory[i].card[2] == c3 &&
sd->status.inventory[i].card[3] == c4
- )
+ )
count += sd->status.inventory[i].amount;
-
+
script_pushint(st,count);
- return 0;
+ return true;
}
/*==========================================
@@ -6113,25 +5859,25 @@ BUILDIN_FUNC(countitem2)
* 0 : fail
* 1 : success (npc side only)
*------------------------------------------*/
-BUILDIN_FUNC(checkweight)
+BUILDIN(checkweight)
{
int nameid, amount, slots, amount2=0;
unsigned int weight=0, i, nbargs;
struct item_data* id = NULL;
struct map_session_data* sd;
struct script_data* data;
-
+
if( ( sd = script_rid2sd(st) ) == NULL ){
- return 0;
+ return true;
}
nbargs = script_lastdata(st)+1;
if(nbargs%2){
ShowError("buildin_checkweight: Invalid nb of args should be a multiple of 2.\n");
script_pushint(st,0);
- return 1;
+ return false;
}
slots = pc_inventoryblank(sd); //nb of empty slot
-
+
for(i=2; i<nbargs; i=i+2){
data = script_getdata(st,i);
get_val(st, data); // convert into value in case of a variable
@@ -6143,24 +5889,24 @@ BUILDIN_FUNC(checkweight)
if( id == NULL ) {
ShowError("buildin_checkweight: Invalid item '%s'.\n", script_getstr(st,i)); // returns string, regardless of what it was
script_pushint(st,0);
- return 1;
+ return false;
}
nameid = id->nameid;
-
+
amount = script_getnum(st,i+1);
if( amount < 1 ) {
ShowError("buildin_checkweight: Invalid amount '%d'.\n", amount);
script_pushint(st,0);
- return 1;
+ return false;
}
-
+
weight += itemdb_weight(nameid)*amount; //total weight for all chk
if( weight + sd->weight > sd->max_weight )
{// too heavy
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
switch( pc_checkadditem(sd, nameid, amount) )
{
case ADDITEM_EXIST:
@@ -6171,105 +5917,105 @@ BUILDIN_FUNC(checkweight)
amount2++;
if( slots < amount2 ) {
script_pushint(st,0);
- return 0;
+ return true;
}
}
else {// non-stackable
amount2 += amount;
if( slots < amount2){
script_pushint(st,0);
- return 0;
+ return true;
}
}
break;
case ADDITEM_OVERAMOUNT:
script_pushint(st,0);
- return 0;
+ return true;
}
}
script_pushint(st,1);
- return 0;
+ return true;
}
-BUILDIN_FUNC(checkweight2)
+BUILDIN(checkweight2)
{
- //variable sub checkweight
- int32 nameid=-1, amount=-1;
- int i=0, amount2=0, slots=0, weight=0;
+ //variable sub checkweight
+ int32 nameid=-1, amount=-1;
+ int i=0, amount2=0, slots=0, weight=0;
short fail=0;
-
- //variable for array parsing
- struct script_data* data_it;
- struct script_data* data_nb;
- const char* name_it;
- const char* name_nb;
- int32 id_it, id_nb;
- int32 idx_it, idx_nb;
- int nb_it, nb_nb; //array size
-
- TBL_PC *sd = script_rid2sd(st);
- nullpo_retr(1,sd);
-
- data_it = script_getdata(st, 2);
- data_nb = script_getdata(st, 3);
-
- if( !data_isreference(data_it) || !data_isreference(data_nb))
- {
- ShowError("script:checkweight2: parameter not a variable\n");
- script_pushint(st,0);
- return 1;// not a variable
- }
- id_it = reference_getid(data_it);
- id_nb = reference_getid(data_nb);
- idx_it = reference_getindex(data_it);
- idx_nb = reference_getindex(data_nb);
- name_it = reference_getname(data_it);
- name_nb = reference_getname(data_nb);
-
- if( not_array_variable(*name_it) || not_array_variable(*name_nb))
- {
- ShowError("script:checkweight2: illegal scope\n");
- script_pushint(st,0);
- return 1;// not supported
- }
- if(is_string_variable(name_it) || is_string_variable(name_nb)){
- ShowError("script:checkweight2: illegal type, need int\n");
- script_pushint(st,0);
- return 1;// not supported
- }
- nb_it = getarraysize(st, id_it, idx_it, 0, reference_getref(data_it));
- nb_nb = getarraysize(st, id_nb, idx_nb, 0, reference_getref(data_nb));
- if(nb_it != nb_nb){
- ShowError("Size mistmatch: nb_it=%d, nb_nb=%d\n",nb_it,nb_nb);
+
+ //variable for array parsing
+ struct script_data* data_it;
+ struct script_data* data_nb;
+ const char* name_it;
+ const char* name_nb;
+ int32 id_it, id_nb;
+ int32 idx_it, idx_nb;
+ int nb_it, nb_nb; //array size
+
+ TBL_PC *sd = script_rid2sd(st);
+ nullpo_retr(1,sd);
+
+ data_it = script_getdata(st, 2);
+ data_nb = script_getdata(st, 3);
+
+ if( !data_isreference(data_it) || !data_isreference(data_nb))
+ {
+ ShowError("script:checkweight2: parameter not a variable\n");
+ script_pushint(st,0);
+ return false;// not a variable
+ }
+ id_it = reference_getid(data_it);
+ id_nb = reference_getid(data_nb);
+ idx_it = reference_getindex(data_it);
+ idx_nb = reference_getindex(data_nb);
+ name_it = reference_getname(data_it);
+ name_nb = reference_getname(data_nb);
+
+ if( not_array_variable(*name_it) || not_array_variable(*name_nb))
+ {
+ ShowError("script:checkweight2: illegal scope\n");
+ script_pushint(st,0);
+ return false;// not supported
+ }
+ if(is_string_variable(name_it) || is_string_variable(name_nb)){
+ ShowError("script:checkweight2: illegal type, need int\n");
+ script_pushint(st,0);
+ return false;// not supported
+ }
+ nb_it = getarraysize(st, id_it, idx_it, 0, reference_getref(data_it));
+ nb_nb = getarraysize(st, id_nb, idx_nb, 0, reference_getref(data_nb));
+ if(nb_it != nb_nb){
+ ShowError("Size mistmatch: nb_it=%d, nb_nb=%d\n",nb_it,nb_nb);
fail = 1;
- }
-
- slots = pc_inventoryblank(sd);
- for(i=0; i<nb_it; i++){
- nameid = (int32)__64BPRTSIZE(get_val2(st,reference_uid(id_it,idx_it+i),reference_getref(data_it)));
+ }
+
+ slots = pc_inventoryblank(sd);
+ for(i=0; i<nb_it; i++){
+ nameid = (int32)__64BPTRSIZE(get_val2(st,reference_uid(id_it,idx_it+i),reference_getref(data_it)));
script_removetop(st, -1, 0);
- amount = (int32)__64BPRTSIZE(get_val2(st,reference_uid(id_nb,idx_nb+i),reference_getref(data_nb)));
+ amount = (int32)__64BPTRSIZE(get_val2(st,reference_uid(id_nb,idx_nb+i),reference_getref(data_nb)));
script_removetop(st, -1, 0);
if(fail) continue; //cpntonie to depop rest
-
- if(itemdb_exists(nameid) == NULL ){
- ShowError("buildin_checkweight2: Invalid item '%d'.\n", nameid);
- fail=1;
- continue;
- }
- if(amount < 0 ){
- ShowError("buildin_checkweight2: Invalid amount '%d'.\n", amount);
- fail = 1;
- continue;
- }
+
+ if(itemdb_exists(nameid) == NULL ){
+ ShowError("buildin_checkweight2: Invalid item '%d'.\n", nameid);
+ fail=1;
+ continue;
+ }
+ if(amount < 0 ){
+ ShowError("buildin_checkweight2: Invalid amount '%d'.\n", amount);
+ fail = 1;
+ continue;
+ }
weight += itemdb_weight(nameid)*amount;
if( weight + sd->weight > sd->max_weight ){
- fail = 1;
- continue;
+ fail = 1;
+ continue;
}
switch( pc_checkadditem(sd, nameid, amount) ) {
case ADDITEM_EXIST:
- // item is already in inventory, but there is still space for the requested amount
+ // item is already in inventory, but there is still space for the requested amount
break;
case ADDITEM_NEW:
if( itemdb_isstackable(nameid) ){// stackable
@@ -6288,75 +6034,74 @@ BUILDIN_FUNC(checkweight2)
fail = 1;
} //end switch
} //end loop DO NOT break it prematurly we need to depop all stack
-
- fail?script_pushint(st,0):script_pushint(st,1);
- return 0;
+
+ fail?script_pushint(st,0):script_pushint(st,1);
+ return true;
}
/*==========================================
* getitem <item id>,<amount>{,<account ID>};
* getitem "<item name>",<amount>{,<account ID>};
*------------------------------------------*/
-BUILDIN_FUNC(getitem)
+BUILDIN(getitem)
{
int nameid,amount,get_count,i,flag = 0;
struct item it;
TBL_PC *sd;
struct script_data *data;
-
+ struct item_data *item_data;
+
data=script_getdata(st,2);
get_val(st,data);
if( data_isstring(data) )
{// "<item name>"
const char *name=conv_str(st,data);
- struct item_data *item_data = itemdb_searchname(name);
- if( item_data == NULL ){
+ if( (item_data = itemdb_searchname(name)) == NULL ){
ShowError("buildin_getitem: Nonexistant item %s requested.\n", name);
- return 1; //No item created.
+ return false; //No item created.
}
nameid=item_data->nameid;
- } else if( data_isint(data) )
- {// <item id>
+ } else if( data_isint(data) ) {// <item id>
nameid=conv_num(st,data);
//Violet Box, Blue Box, etc - random item pick
if( nameid < 0 ) {
nameid = -nameid;
flag = 1;
}
- if( nameid <= 0 || !itemdb_exists(nameid) ){
+ if( nameid <= 0 || !(item_data = itemdb_exists(nameid)) ){
ShowError("buildin_getitem: Nonexistant item %d requested.\n", nameid);
- return 1; //No item created.
+ return false; //No item created.
}
} else {
ShowError("buildin_getitem: invalid data type for argument #1 (%d).", data->type);
- return 1;
+ return false;
}
-
+
// <amount>
if( (amount=script_getnum(st,3)) <= 0)
- return 0; //return if amount <=0, skip the useles iteration
-
+ return true; //return if amount <=0, skip the useles iteration
+
memset(&it,0,sizeof(it));
it.nameid=nameid;
if(!flag)
it.identify=1;
else
- it.identify=itemdb_isidentified(nameid);
-
+ it.identify=itemdb_isidentified2(item_data);
+
if( script_hasdata(st,4) )
sd=map_id2sd(script_getnum(st,4)); // <Account ID>
else
sd=script_rid2sd(st); // Attached player
-
+
if( sd == NULL ) // no target
- return 0;
-
+ return true;
+
//Check if it's stackable.
if (!itemdb_isstackable(nameid))
get_count = 1;
else
get_count = amount;
-
+
for (i = 0; i < amount; i += get_count)
{
// if not pet egg
@@ -6370,14 +6115,14 @@ BUILDIN_FUNC(getitem)
}
}
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(getitem2)
+BUILDIN(getitem2)
{
int nameid,amount,get_count,i,flag = 0;
int iden,ref,attr,c1,c2,c3,c4;
@@ -6385,15 +6130,15 @@ BUILDIN_FUNC(getitem2)
struct item item_tmp;
TBL_PC *sd;
struct script_data *data;
-
+
if( script_hasdata(st,11) )
sd=map_id2sd(script_getnum(st,11)); // <Account ID>
else
sd=script_rid2sd(st); // Attached player
-
+
if( sd == NULL ) // no target
- return 0;
-
+ return true;
+
data=script_getdata(st,2);
get_val(st,data);
if( data_isstring(data) ){
@@ -6405,7 +6150,7 @@ BUILDIN_FUNC(getitem2)
nameid=UNKNOWN_ITEM_ID;
}else
nameid=conv_num(st,data);
-
+
amount=script_getnum(st,3);
iden=script_getnum(st,4);
ref=script_getnum(st,5);
@@ -6414,12 +6159,12 @@ BUILDIN_FUNC(getitem2)
c2=(short)script_getnum(st,8);
c3=(short)script_getnum(st,9);
c4=(short)script_getnum(st,10);
-
+
if(nameid<0) { // Invalide nameid
nameid = -nameid;
flag = 1;
}
-
+
if(nameid > 0) {
memset(&item_tmp,0,sizeof(item_tmp));
item_data=itemdb_exists(nameid);
@@ -6436,7 +6181,7 @@ BUILDIN_FUNC(getitem2)
iden = 1;
ref = attr = 0;
}
-
+
item_tmp.nameid=nameid;
if(!flag)
item_tmp.identify=iden;
@@ -6448,13 +6193,13 @@ BUILDIN_FUNC(getitem2)
item_tmp.card[1]=(short)c2;
item_tmp.card[2]=(short)c3;
item_tmp.card[3]=(short)c4;
-
+
//Check if it's stackable.
if (!itemdb_isstackable(nameid))
get_count = 1;
else
get_count = amount;
-
+
for (i = 0; i < amount; i += get_count)
{
// if not pet egg
@@ -6469,28 +6214,28 @@ BUILDIN_FUNC(getitem2)
}
}
}
-
- return 0;
+
+ return true;
}
/*==========================================
* rentitem <item id>,<seconds>
* rentitem "<item name>",<seconds>
*------------------------------------------*/
-BUILDIN_FUNC(rentitem)
+BUILDIN(rentitem)
{
struct map_session_data *sd;
struct script_data *data;
struct item it;
int seconds;
int nameid = 0, flag;
-
+
data = script_getdata(st,2);
get_val(st,data);
-
+
if( (sd = script_rid2sd(st)) == NULL )
- return 0;
-
+ return true;
+
if( data_isstring(data) )
{
const char *name = conv_str(st,data);
@@ -6498,7 +6243,7 @@ BUILDIN_FUNC(rentitem)
if( itd == NULL )
{
ShowError("buildin_rentitem: Nonexistant item %s requested.\n", name);
- return 1;
+ return false;
}
nameid = itd->nameid;
}
@@ -6508,28 +6253,28 @@ BUILDIN_FUNC(rentitem)
if( nameid <= 0 || !itemdb_exists(nameid) )
{
ShowError("buildin_rentitem: Nonexistant item %d requested.\n", nameid);
- return 1;
+ return false;
}
}
else
{
ShowError("buildin_rentitem: invalid data type for argument #1 (%d).\n", data->type);
- return 1;
+ return false;
}
-
+
seconds = script_getnum(st,3);
memset(&it, 0, sizeof(it));
it.nameid = nameid;
it.identify = 1;
it.expire_time = (unsigned int)(time(NULL) + seconds);
-
+
if( (flag = pc_additem(sd, &it, 1, LOG_TYPE_SCRIPT)) )
{
clif->additem(sd, 0, 0, flag);
- return 1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -6538,20 +6283,20 @@ BUILDIN_FUNC(rentitem)
* Returned Qty is always 1, only works on equip-able
* equipment
*------------------------------------------*/
-BUILDIN_FUNC(getnameditem)
+BUILDIN(getnameditem)
{
int nameid;
struct item item_tmp;
TBL_PC *sd, *tsd;
struct script_data *data;
-
+
sd = script_rid2sd(st);
if (sd == NULL)
{ //Player not attached!
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
data=script_getdata(st,2);
get_val(st,data);
if( data_isstring(data) ){
@@ -6560,31 +6305,31 @@ BUILDIN_FUNC(getnameditem)
if( item_data == NULL)
{ //Failed
script_pushint(st,0);
- return 0;
+ return true;
}
nameid = item_data->nameid;
}else
nameid = conv_num(st,data);
-
+
if(!itemdb_exists(nameid)/* || itemdb_isstackable(nameid)*/)
{ //Even though named stackable items "could" be risky, they are required for certain quests.
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
data=script_getdata(st,3);
get_val(st,data);
if( data_isstring(data) ) //Char Name
tsd=map_nick2sd(conv_str(st,data));
else //Char Id was given
tsd=map_charid2sd(conv_num(st,data));
-
+
if( tsd == NULL )
{ //Failed
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid=nameid;
item_tmp.amount=1;
@@ -6594,80 +6339,77 @@ BUILDIN_FUNC(getnameditem)
item_tmp.card[3]=tsd->status.char_id >> 16;
if(pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT)) {
script_pushint(st,0);
- return 0; //Failed to add item, we will not drop if they don't fit
+ return true; //Failed to add item, we will not drop if they don't fit
}
-
+
script_pushint(st,1);
- return 0;
+ return true;
}
/*==========================================
* gets a random item ID from an item group [Skotlex]
* groupranditem group_num
*------------------------------------------*/
-BUILDIN_FUNC(grouprandomitem)
+BUILDIN(grouprandomitem)
{
int group;
-
+
group = script_getnum(st,2);
script_pushint(st,itemdb_searchrandomid(group));
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(makeitem)
+BUILDIN(makeitem)
{
int nameid,amount,flag = 0;
int x,y,m;
const char *mapname;
struct item item_tmp;
struct script_data *data;
+ struct item_data *item_data;
data=script_getdata(st,2);
get_val(st,data);
if( data_isstring(data) ){
const char *name=conv_str(st,data);
- struct item_data *item_data = itemdb_searchname(name);
- if( item_data )
+ if( (item_data = itemdb_searchname(name)) )
nameid=item_data->nameid;
else
nameid=UNKNOWN_ITEM_ID;
- }else
+ } else {
nameid=conv_num(st,data);
-
+ if( nameid <= 0 || !(item_data = itemdb_exists(nameid)) ){
+ ShowError("makeitem: Nonexistant item %d requested.\n", nameid);
+ return false; //No item created.
+ }
+ }
amount=script_getnum(st,3);
mapname =script_getstr(st,4);
x =script_getnum(st,5);
y =script_getnum(st,6);
-
+
if(strcmp(mapname,"this")==0)
{
TBL_PC *sd;
sd = script_rid2sd(st);
- if (!sd) return 0; //Failed...
+ if (!sd) return true; //Failed...
m=sd->bl.m;
} else
m=map_mapname2mapid(mapname);
-
- if(nameid<0) {
- nameid = -nameid;
- flag = 1;
- }
-
- if(nameid > 0) {
- memset(&item_tmp,0,sizeof(item_tmp));
- item_tmp.nameid=nameid;
- if(!flag)
- item_tmp.identify=1;
- else
- item_tmp.identify=itemdb_isidentified(nameid);
-
- map_addflooritem(&item_tmp,amount,m,x,y,0,0,0,0);
- }
-
- return 0;
+
+ memset(&item_tmp,0,sizeof(item_tmp));
+ item_tmp.nameid=nameid;
+ if(!flag)
+ item_tmp.identify=1;
+ else
+ item_tmp.identify=itemdb_isidentified2(item_data);
+
+ map_addflooritem(&item_tmp,amount,m,x,y,0,0,0,0);
+
+ return true;
}
@@ -6678,9 +6420,9 @@ static void buildin_delitem_delete(struct map_session_data* sd, int idx, int* am
{
int delamount;
struct item* inv = &sd->status.inventory[idx];
-
+
delamount = ( amount[0] < inv->amount ) ? amount[0] : inv->amount;
-
+
if( delete_items )
{
if( sd->inventory_data[idx]->type == IT_PETEGG && inv->card[0] == CARD0_PET )
@@ -6689,7 +6431,7 @@ static void buildin_delitem_delete(struct map_session_data* sd, int idx, int* am
}
pc_delitem(sd, idx, delamount, 0, 0, LOG_TYPE_SCRIPT);
}
-
+
amount[0]-= delamount;
}
@@ -6704,10 +6446,10 @@ static bool buildin_delitem_search(struct map_session_data* sd, struct item* it,
bool delete_items = false;
int i, amount, important;
struct item* inv;
-
+
// prefer always non-equipped items
it->equip = 0;
-
+
// when searching for nameid only, prefer additionally
if( !exact_match )
{
@@ -6716,28 +6458,28 @@ static bool buildin_delitem_search(struct map_session_data* sd, struct item* it,
// card-less items
memset(it->card, 0, sizeof(it->card));
}
-
+
for(;;)
{
amount = it->amount;
important = 0;
-
+
// 1st pass -- less important items / exact match
for( i = 0; amount && i < ARRAYLENGTH(sd->status.inventory); i++ )
{
inv = &sd->status.inventory[i];
-
+
if( !inv->nameid || !sd->inventory_data[i] || inv->nameid != it->nameid )
{// wrong/invalid item
continue;
}
-
+
if( inv->equip != it->equip || inv->refine != it->refine )
{// not matching attributes
important++;
continue;
}
-
+
if( exact_match )
{
if( inv->identify != it->identify || inv->attribute != it->attribute || memcmp(inv->card, it->card, sizeof(inv->card)) )
@@ -6760,11 +6502,11 @@ static bool buildin_delitem_search(struct map_session_data* sd, struct item* it,
continue;
}
}
-
+
// count / delete item
buildin_delitem_delete(sd, i, &amount, delete_items);
}
-
+
// 2nd pass -- any matching item
if( amount == 0 || important == 0 )
{// either everything was already consumed or no items were skipped
@@ -6773,17 +6515,17 @@ static bool buildin_delitem_search(struct map_session_data* sd, struct item* it,
else for( i = 0; amount && i < ARRAYLENGTH(sd->status.inventory); i++ )
{
inv = &sd->status.inventory[i];
-
+
if( !inv->nameid || !sd->inventory_data[i] || inv->nameid != it->nameid )
{// wrong/invalid item
continue;
}
-
+
if( sd->inventory_data[i]->type == IT_PETEGG && inv->card[0] == CARD0_PET && CheckForCharServer() )
{// pet which cannot be deleted
continue;
}
-
+
if( exact_match )
{
if( inv->refine != it->refine || inv->identify != it->identify || inv->attribute != it->attribute || memcmp(inv->card, it->card, sizeof(inv->card)) )
@@ -6791,18 +6533,18 @@ static bool buildin_delitem_search(struct map_session_data* sd, struct item* it,
continue;
}
}
-
+
// count / delete item
buildin_delitem_delete(sd, i, &amount, delete_items);
}
-
+
if( amount )
{// not enough items
- return false;
+ return true;
}
else if( delete_items )
{// we are done with the work
- return true;
+ return false;
}
else
{// get rid of the items now
@@ -6817,12 +6559,12 @@ static bool buildin_delitem_search(struct map_session_data* sd, struct item* it,
///
/// delitem <item id>,<amount>{,<account id>}
/// delitem "<item name>",<amount>{,<account id>}
-BUILDIN_FUNC(delitem)
+BUILDIN(delitem)
{
TBL_PC *sd;
struct item it;
struct script_data *data;
-
+
if( script_hasdata(st,4) )
{
int account_id = script_getnum(st,4);
@@ -6831,16 +6573,16 @@ BUILDIN_FUNC(delitem)
{
ShowError("script:delitem: player not found (AID=%d).\n", account_id);
st->state = END;
- return 1;
+ return false;
}
}
else
{
sd = script_rid2sd(st);// attached player
if( sd == NULL )
- return 0;
+ return true;
}
-
+
data = script_getdata(st,2);
get_val(st,data);
if( data_isstring(data) )
@@ -6851,7 +6593,7 @@ BUILDIN_FUNC(delitem)
{
ShowError("script:delitem: unknown item \"%s\".\n", item_name);
st->state = END;
- return 1;
+ return false;
}
it.nameid = id->nameid;// "<item name>"
}
@@ -6862,36 +6604,36 @@ BUILDIN_FUNC(delitem)
{
ShowError("script:delitem: unknown item \"%d\".\n", it.nameid);
st->state = END;
- return 1;
+ return false;
}
}
-
+
it.amount=script_getnum(st,3);
-
+
if( it.amount <= 0 )
- return 0;// nothing to do
-
+ return true;// nothing to do
+
if( buildin_delitem_search(sd, &it, false) )
{// success
- return 0;
+ return true;
}
-
+
ShowError("script:delitem: failed to delete %d items (AID=%d item_id=%d).\n", it.amount, sd->status.account_id, it.nameid);
st->state = END;
clif->scriptclose(sd, st->oid);
- return 1;
+ return false;
}
/// Deletes items from the target/attached player.
///
/// delitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>}
/// delitem2 "<Item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>}
-BUILDIN_FUNC(delitem2)
+BUILDIN(delitem2)
{
TBL_PC *sd;
struct item it;
struct script_data *data;
-
+
if( script_hasdata(st,11) )
{
int account_id = script_getnum(st,11);
@@ -6900,16 +6642,16 @@ BUILDIN_FUNC(delitem2)
{
ShowError("script:delitem2: player not found (AID=%d).\n", account_id);
st->state = END;
- return 1;
+ return false;
}
}
else
{
sd = script_rid2sd(st);// attached player
if( sd == NULL )
- return 0;
+ return true;
}
-
+
data = script_getdata(st,2);
get_val(st,data);
if( data_isstring(data) )
@@ -6920,7 +6662,7 @@ BUILDIN_FUNC(delitem2)
{
ShowError("script:delitem2: unknown item \"%s\".\n", item_name);
st->state = END;
- return 1;
+ return false;
}
it.nameid = id->nameid;// "<item name>"
}
@@ -6931,10 +6673,10 @@ BUILDIN_FUNC(delitem2)
{
ShowError("script:delitem: unknown item \"%d\".\n", it.nameid);
st->state = END;
- return 1;
+ return false;
}
}
-
+
it.amount=script_getnum(st,3);
it.identify=script_getnum(st,4);
it.refine=script_getnum(st,5);
@@ -6943,65 +6685,65 @@ BUILDIN_FUNC(delitem2)
it.card[1]=(short)script_getnum(st,8);
it.card[2]=(short)script_getnum(st,9);
it.card[3]=(short)script_getnum(st,10);
-
+
if( it.amount <= 0 )
- return 0;// nothing to do
-
+ return true;// nothing to do
+
if( buildin_delitem_search(sd, &it, true) )
{// success
- return 0;
+ return true;
}
-
+
ShowError("script:delitem2: failed to delete %d items (AID=%d item_id=%d).\n", it.amount, sd->status.account_id, it.nameid);
st->state = END;
clif->scriptclose(sd, st->oid);
- return 1;
+ return false;
}
/*==========================================
* Enables/Disables use of items while in an NPC [Skotlex]
*------------------------------------------*/
-BUILDIN_FUNC(enableitemuse)
+BUILDIN(enableitemuse)
{
TBL_PC *sd;
sd=script_rid2sd(st);
if (sd)
st->npc_item_flag = sd->npc_item_flag = 1;
- return 0;
+ return true;
}
-BUILDIN_FUNC(disableitemuse)
+BUILDIN(disableitemuse)
{
TBL_PC *sd;
sd=script_rid2sd(st);
if (sd)
st->npc_item_flag = sd->npc_item_flag = 0;
- return 0;
+ return true;
}
/*==========================================
* return the basic stats of sd
* chk pc_readparam for available type
*------------------------------------------*/
-BUILDIN_FUNC(readparam)
+BUILDIN(readparam)
{
int type;
TBL_PC *sd;
-
+
type=script_getnum(st,2);
if( script_hasdata(st,3) )
sd=map_nick2sd(script_getstr(st,3));
else
sd=script_rid2sd(st);
-
+
if(sd==NULL){
script_pushint(st,-1);
- return 0;
+ return true;
}
-
+
script_pushint(st,pc_readparam(sd,type));
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -7013,54 +6755,54 @@ BUILDIN_FUNC(readparam)
* 3 : account_id
* 4 : bg_id
*------------------------------------------*/
-BUILDIN_FUNC(getcharid)
+BUILDIN(getcharid)
{
int num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
if( script_hasdata(st,3) )
sd=map_nick2sd(script_getstr(st,3));
else
sd=script_rid2sd(st);
-
+
if(sd==NULL){
script_pushint(st,0); //return 0, according docs
- return 0;
+ return true;
}
-
+
switch( num ) {
- case 0: script_pushint(st,sd->status.char_id); break;
- case 1: script_pushint(st,sd->status.party_id); break;
- case 2: script_pushint(st,sd->status.guild_id); break;
- case 3: script_pushint(st,sd->status.account_id); break;
- case 4: script_pushint(st,sd->bg_id); break;
- default:
- ShowError("buildin_getcharid: invalid parameter (%d).\n", num);
- script_pushint(st,0);
- break;
+ case 0: script_pushint(st,sd->status.char_id); break;
+ case 1: script_pushint(st,sd->status.party_id); break;
+ case 2: script_pushint(st,sd->status.guild_id); break;
+ case 3: script_pushint(st,sd->status.account_id); break;
+ case 4: script_pushint(st,sd->bg_id); break;
+ default:
+ ShowError("buildin_getcharid: invalid parameter (%d).\n", num);
+ script_pushint(st,0);
+ break;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* returns the GID of an NPC
*------------------------------------------*/
-BUILDIN_FUNC(getnpcid)
+BUILDIN(getnpcid)
{
int num = script_getnum(st,2);
struct npc_data* nd = NULL;
-
+
if( script_hasdata(st,3) )
{// unique npc name
if( ( nd = npc_name2id(script_getstr(st,3)) ) == NULL )
{
ShowError("buildin_getnpcid: No such NPC '%s'.\n", script_getstr(st,3));
script_pushint(st,0);
- return 1;
+ return false;
}
}
-
+
switch (num) {
case 0:
script_pushint(st,nd ? nd->bl.id : st->oid);
@@ -7068,23 +6810,23 @@ BUILDIN_FUNC(getnpcid)
default:
ShowError("buildin_getnpcid: invalid parameter (%d).\n", num);
script_pushint(st,0);
- return 1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Return the name of the party_id
* null if not found
*------------------------------------------*/
-BUILDIN_FUNC(getpartyname)
+BUILDIN(getpartyname)
{
int party_id;
struct party_data* p;
-
+
party_id = script_getnum(st,2);
-
+
if( ( p = party_search(party_id) ) != NULL )
{
script_pushstrcopy(st,p->party.name);
@@ -7093,7 +6835,7 @@ BUILDIN_FUNC(getpartyname)
{
script_pushconststr(st,"null");
}
- return 0;
+ return true;
}
/*==========================================
@@ -7104,64 +6846,64 @@ BUILDIN_FUNC(getpartyname)
* 1 : char_id des membres
* 2 : account_id des membres
*------------------------------------------*/
-BUILDIN_FUNC(getpartymember)
+BUILDIN(getpartymember)
{
struct party_data *p;
int i,j=0,type=0;
-
+
p=party_search(script_getnum(st,2));
-
+
if( script_hasdata(st,3) )
type=script_getnum(st,3);
-
+
if(p!=NULL){
for(i=0;i<MAX_PARTY;i++){
if(p->party.member[i].account_id){
switch (type) {
- case 2:
- mapreg_setreg(reference_uid(add_str("$@partymemberaid"), j),p->party.member[i].account_id);
- break;
- case 1:
- mapreg_setreg(reference_uid(add_str("$@partymembercid"), j),p->party.member[i].char_id);
- break;
- default:
- mapreg_setregstr(reference_uid(add_str("$@partymembername$"), j),p->party.member[i].name);
+ case 2:
+ mapreg_setreg(reference_uid(add_str("$@partymemberaid"), j),p->party.member[i].account_id);
+ break;
+ case 1:
+ mapreg_setreg(reference_uid(add_str("$@partymembercid"), j),p->party.member[i].char_id);
+ break;
+ default:
+ mapreg_setregstr(reference_uid(add_str("$@partymembername$"), j),p->party.member[i].name);
}
j++;
}
}
}
mapreg_setreg(add_str("$@partymembercount"),j);
-
- return 0;
+
+ return true;
}
/*==========================================
* Retrieves party leader. if flag is specified,
* return some of the leader data. Otherwise, return name.
*------------------------------------------*/
-BUILDIN_FUNC(getpartyleader)
+BUILDIN(getpartyleader)
{
int party_id, type = 0, i=0;
struct party_data *p;
-
+
party_id=script_getnum(st,2);
if( script_hasdata(st,3) )
type=script_getnum(st,3);
-
+
p=party_search(party_id);
-
+
if (p) //Search leader
- for(i = 0; i < MAX_PARTY && !p->party.member[i].leader; i++);
-
+ for(i = 0; i < MAX_PARTY && !p->party.member[i].leader; i++);
+
if (!p || i == MAX_PARTY) { //leader not found
if (type)
script_pushint(st,-1);
else
script_pushconststr(st,"null");
- return 0;
+ return true;
}
-
+
switch (type) {
case 1: script_pushint(st,p->party.member[i].account_id); break;
case 2: script_pushint(st,p->party.member[i].char_id); break;
@@ -7170,20 +6912,20 @@ BUILDIN_FUNC(getpartyleader)
case 5: script_pushint(st,p->party.member[i].lv); break;
default: script_pushstrcopy(st,p->party.member[i].name); break;
}
- return 0;
+ return true;
}
/*==========================================
* Return the name of the @guild_id
* null if not found
*------------------------------------------*/
-BUILDIN_FUNC(getguildname)
+BUILDIN(getguildname)
{
int guild_id;
struct guild* g;
-
+
guild_id = script_getnum(st,2);
-
+
if( ( g = guild_search(guild_id) ) != NULL )
{
script_pushstrcopy(st,g->name);
@@ -7192,20 +6934,20 @@ BUILDIN_FUNC(getguildname)
{
script_pushconststr(st,"null");
}
- return 0;
+ return true;
}
/*==========================================
* Return the name of the guild master of @guild_id
* null if not found
*------------------------------------------*/
-BUILDIN_FUNC(getguildmaster)
+BUILDIN(getguildmaster)
{
int guild_id;
struct guild* g;
-
+
guild_id = script_getnum(st,2);
-
+
if( ( g = guild_search(guild_id) ) != NULL )
{
script_pushstrcopy(st,g->member[0].name);
@@ -7214,16 +6956,16 @@ BUILDIN_FUNC(getguildmaster)
{
script_pushconststr(st,"null");
}
- return 0;
+ return true;
}
-BUILDIN_FUNC(getguildmasterid)
+BUILDIN(getguildmasterid)
{
int guild_id;
struct guild* g;
-
+
guild_id = script_getnum(st,2);
-
+
if( ( g = guild_search(guild_id) ) != NULL )
{
script_pushint(st,g->member[0].char_id);
@@ -7232,7 +6974,7 @@ BUILDIN_FUNC(getguildmasterid)
{
script_pushint(st,0);
}
- return 0;
+ return true;
}
/*==========================================
@@ -7244,17 +6986,17 @@ BUILDIN_FUNC(getguildmasterid)
* 3 : map_name
* - : ""
*------------------------------------------*/
-BUILDIN_FUNC(strcharinfo)
+BUILDIN(strcharinfo)
{
TBL_PC *sd;
int num;
struct guild* g;
struct party_data* p;
-
+
sd=script_rid2sd(st);
if (!sd) { //Avoid crashing....
script_pushconststr(st,"");
- return 0;
+ return true;
}
num=script_getnum(st,2);
switch(num){
@@ -7283,8 +7025,8 @@ BUILDIN_FUNC(strcharinfo)
script_pushconststr(st,"");
break;
}
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -7296,18 +7038,18 @@ BUILDIN_FUNC(strcharinfo)
* 3 : ::str
* 4 : map name
*------------------------------------------*/
-BUILDIN_FUNC(strnpcinfo)
+BUILDIN(strnpcinfo)
{
TBL_NPC* nd;
int num;
char *buf,*name=NULL;
-
+
nd = map_id2nd(st->oid);
if (!nd) {
script_pushconststr(st, "");
- return 0;
+ return true;
}
-
+
num = script_getnum(st,2);
switch(num){
case 0: // display name
@@ -7332,13 +7074,13 @@ BUILDIN_FUNC(strnpcinfo)
name = aStrdup(map[nd->bl.m].name);
break;
}
-
+
if(name)
script_pushstr(st, name);
else
script_pushconststr(st, "");
-
- return 0;
+
+ return true;
}
@@ -7348,148 +7090,148 @@ static unsigned int equip[] = {EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_
/*==========================================
* GetEquipID(Pos); Pos: 1-10
*------------------------------------------*/
-BUILDIN_FUNC(getequipid)
+BUILDIN(getequipid)
{
int i, num;
TBL_PC* sd;
struct item_data* item;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
num = script_getnum(st,2) - 1;
if( num < 0 || num >= ARRAYLENGTH(equip) )
{
script_pushint(st,-1);
- return 0;
+ return true;
}
-
+
// get inventory position of item
i = pc_checkequip(sd,equip[num]);
if( i < 0 )
{
script_pushint(st,-1);
- return 0;
+ return true;
}
-
+
item = sd->inventory_data[i];
if( item != 0 )
script_pushint(st,item->nameid);
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
* Get the equipement name at pos
* return item jname or ""
*------------------------------------------*/
-BUILDIN_FUNC(getequipname)
+BUILDIN(getequipname)
{
int i, num;
TBL_PC* sd;
struct item_data* item;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
num = script_getnum(st,2) - 1;
if( num < 0 || num >= ARRAYLENGTH(equip) )
{
script_pushconststr(st,"");
- return 0;
+ return true;
}
-
+
// get inventory position of item
i = pc_checkequip(sd,equip[num]);
if( i < 0 )
{
script_pushconststr(st,"");
- return 0;
+ return true;
}
-
+
item = sd->inventory_data[i];
if( item != 0 )
script_pushstrcopy(st,item->jname);
else
script_pushconststr(st,"");
-
- return 0;
+
+ return true;
}
/*==========================================
* getbrokenid [Valaris]
*------------------------------------------*/
-BUILDIN_FUNC(getbrokenid)
+BUILDIN(getbrokenid)
{
int i,num,id=0,brokencounter=0;
TBL_PC *sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
num=script_getnum(st,2);
for(i=0; i<MAX_INVENTORY; i++) {
if(sd->status.inventory[i].attribute){
- brokencounter++;
- if(num==brokencounter){
- id=sd->status.inventory[i].nameid;
- break;
- }
+ brokencounter++;
+ if(num==brokencounter){
+ id=sd->status.inventory[i].nameid;
+ break;
+ }
}
}
-
+
script_pushint(st,id);
-
- return 0;
+
+ return true;
}
/*==========================================
* repair [Valaris]
*------------------------------------------*/
-BUILDIN_FUNC(repair)
+BUILDIN(repair)
{
int i,num;
int repaircounter=0;
TBL_PC *sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
num=script_getnum(st,2);
for(i=0; i<MAX_INVENTORY; i++) {
if(sd->status.inventory[i].attribute){
- repaircounter++;
- if(num==repaircounter){
- sd->status.inventory[i].attribute=0;
- clif->equiplist(sd);
- clif->produce_effect(sd, 0, sd->status.inventory[i].nameid);
- clif->misceffect(&sd->bl, 3);
- break;
- }
+ repaircounter++;
+ if(num==repaircounter){
+ sd->status.inventory[i].attribute=0;
+ clif->equiplist(sd);
+ clif->produce_effect(sd, 0, sd->status.inventory[i].nameid);
+ clif->misceffect(&sd->bl, 3);
+ break;
+ }
}
}
-
- return 0;
+
+ return true;
}
/*==========================================
* repairall
*------------------------------------------*/
-BUILDIN_FUNC(repairall)
+BUILDIN(repairall)
{
int i, repaircounter = 0;
TBL_PC *sd;
-
+
sd = script_rid2sd(st);
if(sd == NULL)
- return 0;
-
+ return true;
+
for(i = 0; i < MAX_INVENTORY; i++)
{
if(sd->status.inventory[i].nameid && sd->status.inventory[i].attribute)
@@ -7499,37 +7241,37 @@ BUILDIN_FUNC(repairall)
repaircounter++;
}
}
-
+
if(repaircounter)
{
clif->misceffect(&sd->bl, 3);
clif->equiplist(sd);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Chk if player have something equiped at pos
*------------------------------------------*/
-BUILDIN_FUNC(getequipisequiped)
+BUILDIN(getequipisequiped)
{
int i = -1,num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
-
+
if(i >= 0)
script_pushint(st,1);
else
- script_pushint(st,0);
- return 0;
+ script_pushint(st,0);
+ return true;
}
/*==========================================
@@ -7539,24 +7281,24 @@ BUILDIN_FUNC(getequipisequiped)
* 1 : true
* 0 : false
*------------------------------------------*/
-BUILDIN_FUNC(getequipisenableref)
+BUILDIN(getequipisenableref)
{
int i = -1,num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if( num > 0 && num <= ARRAYLENGTH(equip) )
i = pc_checkequip(sd,equip[num-1]);
if( i >= 0 && sd->inventory_data[i] && !sd->inventory_data[i]->flag.no_refine && !sd->status.inventory[i].expire_time )
script_pushint(st,1);
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -7565,24 +7307,24 @@ BUILDIN_FUNC(getequipisenableref)
* 1 : true
* 0 : false
*------------------------------------------*/
-BUILDIN_FUNC(getequipisidentify)
+BUILDIN(getequipisidentify)
{
int i = -1,num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0)
script_pushint(st,sd->status.inventory[i].identify);
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -7591,24 +7333,24 @@ BUILDIN_FUNC(getequipisidentify)
* x : refine amount
* 0 : false (not refined)
*------------------------------------------*/
-BUILDIN_FUNC(getequiprefinerycnt)
+BUILDIN(getequiprefinerycnt)
{
int i = -1,num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0)
script_pushint(st,sd->status.inventory[i].refine);
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -7618,24 +7360,24 @@ BUILDIN_FUNC(getequiprefinerycnt)
* x : weapon level
* 0 : false
*------------------------------------------*/
-BUILDIN_FUNC(getequipweaponlv)
+BUILDIN(getequipweaponlv)
{
int i = -1,num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0 && sd->inventory_data[i])
script_pushint(st,sd->inventory_data[i]->wlv);
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -7644,63 +7386,63 @@ BUILDIN_FUNC(getequipweaponlv)
* x : refine chance
* 0 : false (max refine level or unequip..)
*------------------------------------------*/
-BUILDIN_FUNC(getequippercentrefinery)
+BUILDIN(getequippercentrefinery)
{
int i = -1,num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0 && sd->status.inventory[i].nameid && sd->status.inventory[i].refine < MAX_REFINE)
script_pushint(st,status_get_refine_chance(itemdb_wlv(sd->status.inventory[i].nameid), (int)sd->status.inventory[i].refine));
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
* Refine +1 item at pos and log and display refine
*------------------------------------------*/
-BUILDIN_FUNC(successrefitem)
+BUILDIN(successrefitem)
{
int i=-1,num,ep;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0) {
ep=sd->status.inventory[i].equip;
-
+
//Logs items, got from (N)PC scripts [Lupus]
- log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);
-
+ logs->pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i],sd->inventory_data[i]);
+
sd->status.inventory[i].refine++;
pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below
-
+
clif->refine(sd->fd,0,i,sd->status.inventory[i].refine);
clif->delitem(sd,i,1,3);
-
+
//Logs items, got from (N)PC scripts [Lupus]
- log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);
-
+ logs->pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i],sd->inventory_data[i]);
+
clif->additem(sd,i,1,0);
pc_equipitem(sd,i,ep);
clif->misceffect(&sd->bl,3);
if(sd->status.inventory[i].refine == MAX_REFINE &&
- sd->status.inventory[i].card[0] == CARD0_FORGE &&
- sd->status.char_id == (int)MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3])
- ){ // Fame point system [DracoRPG]
+ sd->status.inventory[i].card[0] == CARD0_FORGE &&
+ sd->status.char_id == (int)MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3])
+ ){ // Fame point system [DracoRPG]
switch (sd->inventory_data[i]->wlv){
case 1:
pc_addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
@@ -7711,113 +7453,136 @@ BUILDIN_FUNC(successrefitem)
case 3:
pc_addfame(sd,1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
break;
- }
+ }
}
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Show a failed Refine +1 attempt
*------------------------------------------*/
-BUILDIN_FUNC(failedrefitem)
+BUILDIN(failedrefitem)
{
int i=-1,num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0) {
sd->status.inventory[i].refine = 0;
pc_unequipitem(sd,i,3); //recalculate bonus
clif->refine(sd->fd,1,i,sd->status.inventory[i].refine); //notify client of failure
-
+
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
-
+
clif->misceffect(&sd->bl,2); // display failure effect
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Downgrades an Equipment Part by -1 . [Masao]
*------------------------------------------*/
-BUILDIN_FUNC(downrefitem)
+BUILDIN(downrefitem)
{
int i = -1,num,ep;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i = pc_checkequip(sd,equip[num-1]);
if(i >= 0) {
ep = sd->status.inventory[i].equip;
-
+
//Logs items, got from (N)PC scripts [Lupus]
- log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);
-
+ logs->pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i],sd->inventory_data[i]);
+
sd->status.inventory[i].refine++;
pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below
-
+
clif->refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2);
clif->delitem(sd,i,1,3);
-
+
//Logs items, got from (N)PC scripts [Lupus]
- log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);
-
+ logs->pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i],sd->inventory_data[i]);
+
clif->additem(sd,i,1,0);
pc_equipitem(sd,i,ep);
clif->misceffect(&sd->bl,2);
}
+
+ return true;
+}
- return 0;
+/*==========================================
+ * Delete the item equipped at pos.
+ *------------------------------------------*/
+BUILDIN(delequip)
+{
+ int i=-1,num;
+ TBL_PC *sd;
+
+ num = script_getnum(st,2);
+ sd = script_rid2sd(st);
+ if( sd == NULL )
+ return true;
+
+ if (num > 0 && num <= ARRAYLENGTH(equip))
+ i=pc_checkequip(sd,equip[num-1]);
+ if(i >= 0) {
+ pc_unequipitem(sd,i,3); //recalculate bonus
+ pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
+ }
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(statusup)
+BUILDIN(statusup)
{
int type;
TBL_PC *sd;
-
+
type=script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
pc_statusup(sd,type);
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(statusup2)
+BUILDIN(statusup2)
{
int type,val;
TBL_PC *sd;
-
+
type=script_getnum(st,2);
val=script_getnum(st,3);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
pc_statusup2(sd,type,val);
-
- return 0;
+
+ return true;
}
/// See 'doc/item_bonus.txt'
@@ -7827,7 +7592,7 @@ BUILDIN_FUNC(statusup2)
/// bonus3 <bonus type>,<val1>,<val2>,<val3>;
/// bonus4 <bonus type>,<val1>,<val2>,<val3>,<val4>;
/// bonus5 <bonus type>,<val1>,<val2>,<val3>,<val4>,<val5>;
-BUILDIN_FUNC(bonus)
+BUILDIN(bonus)
{
int type;
int val1;
@@ -7836,11 +7601,11 @@ BUILDIN_FUNC(bonus)
int val4 = 0;
int val5 = 0;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0; // no player attached
-
+ return true; // no player attached
+
type = script_getnum(st,2);
switch( type ) {
case SP_AUTOSPELL:
@@ -7866,7 +7631,7 @@ BUILDIN_FUNC(bonus)
val1 = script_getnum(st,3);
break;
}
-
+
switch( script_lastdata(st)-2 ) {
case 1:
pc_bonus(sd, type, val1);
@@ -7885,7 +7650,7 @@ BUILDIN_FUNC(bonus)
val2 = skill->name2id(script_getstr(st,4)); // 2nd value can be skill name
else
val2 = script_getnum(st,4);
-
+
val3 = script_getnum(st,5);
val4 = script_getnum(st,6);
pc_bonus4(sd, type, val1, val2, val3, val4);
@@ -7895,7 +7660,7 @@ BUILDIN_FUNC(bonus)
val2 = skill->name2id(script_getstr(st,4)); // 2nd value can be skill name
else
val2 = script_getnum(st,4);
-
+
val3 = script_getnum(st,5);
val4 = script_getnum(st,6);
val5 = script_getnum(st,7);
@@ -7905,117 +7670,117 @@ BUILDIN_FUNC(bonus)
ShowDebug("buildin_bonus: unexpected number of arguments (%d)\n", (script_lastdata(st) - 1));
break;
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(autobonus)
+BUILDIN(autobonus)
{
unsigned int dur;
short rate;
short atk_type = 0;
TBL_PC* sd;
const char *bonus_script, *other_script = NULL;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0; // no player attached
-
+ return true; // no player attached
+
if( sd->state.autobonus&sd->status.inventory[current_equip_item_index].equip )
- return 0;
-
+ return true;
+
rate = script_getnum(st,3);
dur = script_getnum(st,4);
bonus_script = script_getstr(st,2);
if( !rate || !dur || !bonus_script )
- return 0;
-
+ return true;
+
if( script_hasdata(st,5) )
atk_type = script_getnum(st,5);
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
-
+
if( pc_addautobonus(sd->autobonus,ARRAYLENGTH(sd->autobonus),
- bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,false) )
+ bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,false) )
{
script_add_autobonus(bonus_script);
if( other_script )
script_add_autobonus(other_script);
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(autobonus2)
+BUILDIN(autobonus2)
{
unsigned int dur;
short rate;
short atk_type = 0;
TBL_PC* sd;
const char *bonus_script, *other_script = NULL;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0; // no player attached
-
+ return true; // no player attached
+
if( sd->state.autobonus&sd->status.inventory[current_equip_item_index].equip )
- return 0;
-
+ return true;
+
rate = script_getnum(st,3);
dur = script_getnum(st,4);
bonus_script = script_getstr(st,2);
if( !rate || !dur || !bonus_script )
- return 0;
-
+ return true;
+
if( script_hasdata(st,5) )
atk_type = script_getnum(st,5);
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
-
+
if( pc_addautobonus(sd->autobonus2,ARRAYLENGTH(sd->autobonus2),
- bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,false) )
+ bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,false) )
{
script_add_autobonus(bonus_script);
if( other_script )
script_add_autobonus(other_script);
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(autobonus3)
+BUILDIN(autobonus3)
{
unsigned int dur;
short rate,atk_type;
TBL_PC* sd;
const char *bonus_script, *other_script = NULL;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0; // no player attached
-
+ return true; // no player attached
+
if( sd->state.autobonus&sd->status.inventory[current_equip_item_index].equip )
- return 0;
-
+ return true;
+
rate = script_getnum(st,3);
dur = script_getnum(st,4);
atk_type = ( script_isstring(st,5) ? skill->name2id(script_getstr(st,5)) : script_getnum(st,5) );
bonus_script = script_getstr(st,2);
if( !rate || !dur || !atk_type || !bonus_script )
- return 0;
-
+ return true;
+
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
-
+
if( pc_addautobonus(sd->autobonus3,ARRAYLENGTH(sd->autobonus3),
- bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,true) )
+ bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,true) )
{
script_add_autobonus(bonus_script);
if( other_script )
script_add_autobonus(other_script);
}
-
- return 0;
+
+ return true;
}
/// Changes the level of a player skill.
@@ -8028,24 +7793,24 @@ BUILDIN_FUNC(autobonus3)
/// skill <skill id>,<level>
/// skill "<skill name>",<level>,<flag>
/// skill "<skill name>",<level>
-BUILDIN_FUNC(skill)
+BUILDIN(skill)
{
int id;
int level;
int flag = 1;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
id = ( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
level = script_getnum(st,3);
if( script_hasdata(st,4) )
flag = script_getnum(st,4);
pc_skill(sd, id, level, flag);
-
- return 0;
+
+ return true;
}
/// Changes the level of a player skill.
@@ -8057,78 +7822,78 @@ BUILDIN_FUNC(skill)
/// addtoskill "<skill name>",<amount>
///
/// @see skill
-BUILDIN_FUNC(addtoskill)
+BUILDIN(addtoskill)
{
int id;
int level;
int flag = 2;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
id = ( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
level = script_getnum(st,3);
if( script_hasdata(st,4) )
flag = script_getnum(st,4);
pc_skill(sd, id, level, flag);
-
- return 0;
+
+ return true;
}
/// Increases the level of a guild skill.
///
/// guildskill <skill id>,<amount>;
/// guildskill "<skill name>",<amount>;
-BUILDIN_FUNC(guildskill)
+BUILDIN(guildskill)
{
int id;
int level;
TBL_PC* sd;
int i;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
id = ( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
level = script_getnum(st,3);
for( i=0; i < level; i++ )
guild_skillup(sd, id);
-
- return 0;
+
+ return true;
}
/// Returns the level of the player skill.
///
/// getskilllv(<skill id>) -> <level>
/// getskilllv("<skill name>") -> <level>
-BUILDIN_FUNC(getskilllv)
+BUILDIN(getskilllv)
{
int id;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
id = ( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
script_pushint(st, pc_checkskill(sd,id));
-
- return 0;
+
+ return true;
}
/// Returns the level of the guild skill.
///
/// getgdskilllv(<guild id>,<skill id>) -> <level>
/// getgdskilllv(<guild id>,"<skill name>") -> <level>
-BUILDIN_FUNC(getgdskilllv)
+BUILDIN(getgdskilllv)
{
int guild_id;
uint16 skill_id;
struct guild* g;
-
+
guild_id = script_getnum(st,2);
skill_id = ( script_isstring(st,3) ? skill->name2id(script_getstr(st,3)) : script_getnum(st,3) );
g = guild_search(guild_id);
@@ -8136,8 +7901,8 @@ BUILDIN_FUNC(getgdskilllv)
script_pushint(st, -1);
else
script_pushint(st, guild_checkskill(g,skill_id));
-
- return 0;
+
+ return true;
}
/// Returns the 'basic_skill_check' setting.
@@ -8145,113 +7910,113 @@ BUILDIN_FUNC(getgdskilllv)
/// before allowing the basic actions.
///
/// basicskillcheck() -> <bool>
-BUILDIN_FUNC(basicskillcheck)
+BUILDIN(basicskillcheck)
{
script_pushint(st, battle_config.basic_skill_check);
- return 0;
+ return true;
}
/// Returns the GM level of the player.
///
/// getgmlevel() -> <level>
-BUILDIN_FUNC(getgmlevel)
+BUILDIN(getgmlevel)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
script_pushint(st, pc_get_group_level(sd));
-
- return 0;
+
+ return true;
}
/// Returns the group ID of the player.
///
/// getgroupid() -> <int>
-BUILDIN_FUNC(getgroupid)
+BUILDIN(getgroupid)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if (sd == NULL)
- return 1; // no player attached, report source
+ return false; // no player attached, report source
script_pushint(st, pc_get_group_id(sd));
-
- return 0;
+
+ return true;
}
/// Terminates the execution of this script instance.
///
/// end
-BUILDIN_FUNC(end)
+BUILDIN(end)
{
st->state = END;
- return 0;
+ return true;
}
/// Checks if the player has that effect state (option).
///
/// checkoption(<option>) -> <bool>
-BUILDIN_FUNC(checkoption)
+BUILDIN(checkoption)
{
int option;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
option = script_getnum(st,2);
if( sd->sc.option&option )
script_pushint(st, 1);
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Checks if the player is in that body state (opt1).
///
/// checkoption1(<opt1>) -> <bool>
-BUILDIN_FUNC(checkoption1)
+BUILDIN(checkoption1)
{
int opt1;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
opt1 = script_getnum(st,2);
if( sd->sc.opt1 == opt1 )
script_pushint(st, 1);
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Checks if the player has that health state (opt2).
///
/// checkoption2(<opt2>) -> <bool>
-BUILDIN_FUNC(checkoption2)
+BUILDIN(checkoption2)
{
int opt2;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
opt2 = script_getnum(st,2);
if( sd->sc.opt2&opt2 )
script_pushint(st, 1);
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Changes the effect state (option) of the player.
@@ -8261,16 +8026,16 @@ BUILDIN_FUNC(checkoption2)
///
/// setoption <option>,<flag>;
/// setoption <option>;
-BUILDIN_FUNC(setoption)
+BUILDIN(setoption)
{
int option;
int flag = 1;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
option = script_getnum(st,2);
if( script_hasdata(st,3) )
flag = script_getnum(st,3);
@@ -8287,8 +8052,8 @@ BUILDIN_FUNC(setoption)
pc_setoption(sd, sd->sc.option|option);
} else// Remove option
pc_setoption(sd, sd->sc.option&~option);
-
- return 0;
+
+ return true;
}
/// Returns if the player has a cart.
@@ -8296,20 +8061,20 @@ BUILDIN_FUNC(setoption)
/// checkcart() -> <bool>
///
/// @author Valaris
-BUILDIN_FUNC(checkcart)
+BUILDIN(checkcart)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( pc_iscarton(sd) )
script_pushint(st, 1);
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Sets the cart of the player.
@@ -8323,20 +8088,20 @@ BUILDIN_FUNC(checkcart)
///
/// setcart <type>;
/// setcart;
-BUILDIN_FUNC(setcart)
+BUILDIN(setcart)
{
int type = 1;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( script_hasdata(st,2) )
type = script_getnum(st,2);
pc_setcart(sd, type);
-
- return 0;
+
+ return true;
}
/// Returns if the player has a falcon.
@@ -8344,20 +8109,20 @@ BUILDIN_FUNC(setcart)
/// checkfalcon() -> <bool>
///
/// @author Valaris
-BUILDIN_FUNC(checkfalcon)
+BUILDIN(checkfalcon)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( pc_isfalcon(sd) )
script_pushint(st, 1);
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Sets if the player has a falcon or not.
@@ -8365,21 +8130,21 @@ BUILDIN_FUNC(checkfalcon)
///
/// setfalcon <flag>;
/// setfalcon;
-BUILDIN_FUNC(setfalcon)
+BUILDIN(setfalcon)
{
int flag = 1;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( script_hasdata(st,2) )
flag = script_getnum(st,2);
-
+
pc_setfalcon(sd, flag);
-
- return 0;
+
+ return true;
}
/// Returns if the player is riding.
@@ -8387,20 +8152,20 @@ BUILDIN_FUNC(setfalcon)
/// checkriding() -> <bool>
///
/// @author Valaris
-BUILDIN_FUNC(checkriding)
+BUILDIN(checkriding)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( pc_isriding(sd) || pc_isridingwug(sd) || pc_isridingdragon(sd) )
script_pushint(st, 1);
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Sets if the player is riding.
@@ -8408,60 +8173,60 @@ BUILDIN_FUNC(checkriding)
///
/// setriding <flag>;
/// setriding;
-BUILDIN_FUNC(setriding)
+BUILDIN(setriding)
{
int flag = 1;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( script_hasdata(st,2) )
flag = script_getnum(st,2);
pc_setriding(sd, flag);
-
- return 0;
+
+ return true;
}
/// Returns if the player has a warg.
///
/// checkwug() -> <bool>
///
-BUILDIN_FUNC(checkwug)
+BUILDIN(checkwug)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( pc_iswug(sd) || pc_isridingwug(sd) )
script_pushint(st, 1);
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Returns if the player is wearing MADO Gear.
///
/// checkmadogear() -> <bool>
///
-BUILDIN_FUNC(checkmadogear)
+BUILDIN(checkmadogear)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( pc_ismadogear(sd) )
script_pushint(st, 1);
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Sets if the player is riding MADO Gear.
@@ -8469,78 +8234,78 @@ BUILDIN_FUNC(checkmadogear)
///
/// setmadogear <flag>;
/// setmadogear;
-BUILDIN_FUNC(setmadogear)
+BUILDIN(setmadogear)
{
int flag = 1;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
if( script_hasdata(st,2) )
flag = script_getnum(st,2);
pc_setmadogear(sd, flag);
-
- return 0;
+
+ return true;
}
/// Sets the save point of the player.
///
/// save "<map name>",<x>,<y>
/// savepoint "<map name>",<x>,<y>
-BUILDIN_FUNC(savepoint)
+BUILDIN(savepoint)
{
int x;
int y;
short map;
const char* str;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
-
+ return true;// no player attached, report source
+
str = script_getstr(st, 2);
x = script_getnum(st,3);
y = script_getnum(st,4);
map = mapindex_name2id(str);
if( map )
pc_setsavepoint(sd, map, x, y);
-
- return 0;
+
+ return true;
}
/*==========================================
* GetTimeTick(0: System Tick, 1: Time Second Tick)
*------------------------------------------*/
-BUILDIN_FUNC(gettimetick) /* Asgard Version */
+BUILDIN(gettimetick) /* Asgard Version */
{
int type;
time_t timer;
struct tm *t;
-
+
type=script_getnum(st,2);
-
+
switch(type){
- case 2:
- //type 2:(Get the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC
- // from the system clock.)
- script_pushint(st,(int)time(NULL));
- break;
- case 1:
- //type 1:(Second Ticks: 0-86399, 00:00:00-23:59:59)
- time(&timer);
- t=localtime(&timer);
- script_pushint(st,((t->tm_hour)*3600+(t->tm_min)*60+t->tm_sec));
- break;
- case 0:
- default:
- //type 0:(System Ticks)
- script_pushint(st,gettick());
- break;
+ case 2:
+ //type 2:(Get the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC
+ // from the system clock.)
+ script_pushint(st,(int)time(NULL));
+ break;
+ case 1:
+ //type 1:(Second Ticks: 0-86399, 00:00:00-23:59:59)
+ time(&timer);
+ t=localtime(&timer);
+ script_pushint(st,((t->tm_hour)*3600+(t->tm_min)*60+t->tm_sec));
+ break;
+ case 0:
+ default:
+ //type 0:(System Ticks)
+ script_pushint(st,gettick());
+ break;
}
- return 0;
+ return true;
}
/*==========================================
@@ -8549,97 +8314,97 @@ BUILDIN_FUNC(gettimetick) /* Asgard Version */
* 4: WeekDay 5: MonthDay 6: Month
* 7: Year
*------------------------------------------*/
-BUILDIN_FUNC(gettime) /* Asgard Version */
+BUILDIN(gettime) /* Asgard Version */
{
int type;
time_t timer;
struct tm *t;
-
+
type=script_getnum(st,2);
-
+
time(&timer);
t=localtime(&timer);
-
+
switch(type){
- case 1://Sec(0~59)
- script_pushint(st,t->tm_sec);
- break;
- case 2://Min(0~59)
- script_pushint(st,t->tm_min);
- break;
- case 3://Hour(0~23)
- script_pushint(st,t->tm_hour);
- break;
- case 4://WeekDay(0~6)
- script_pushint(st,t->tm_wday);
- break;
- case 5://MonthDay(01~31)
- script_pushint(st,t->tm_mday);
- break;
- case 6://Month(01~12)
- script_pushint(st,t->tm_mon+1);
- break;
- case 7://Year(20xx)
- script_pushint(st,t->tm_year+1900);
- break;
- case 8://Year Day(01~366)
- script_pushint(st,t->tm_yday+1);
- break;
- default://(format error)
- script_pushint(st,-1);
- break;
+ case 1://Sec(0~59)
+ script_pushint(st,t->tm_sec);
+ break;
+ case 2://Min(0~59)
+ script_pushint(st,t->tm_min);
+ break;
+ case 3://Hour(0~23)
+ script_pushint(st,t->tm_hour);
+ break;
+ case 4://WeekDay(0~6)
+ script_pushint(st,t->tm_wday);
+ break;
+ case 5://MonthDay(01~31)
+ script_pushint(st,t->tm_mday);
+ break;
+ case 6://Month(01~12)
+ script_pushint(st,t->tm_mon+1);
+ break;
+ case 7://Year(20xx)
+ script_pushint(st,t->tm_year+1900);
+ break;
+ case 8://Year Day(01~366)
+ script_pushint(st,t->tm_yday+1);
+ break;
+ default://(format error)
+ script_pushint(st,-1);
+ break;
}
- return 0;
+ return true;
}
/*==========================================
* GetTimeStr("TimeFMT", Length);
*------------------------------------------*/
-BUILDIN_FUNC(gettimestr)
+BUILDIN(gettimestr)
{
char *tmpstr;
const char *fmtstr;
int maxlen;
time_t now = time(NULL);
-
+
fmtstr=script_getstr(st,2);
maxlen=script_getnum(st,3);
-
+
tmpstr=(char *)aMalloc((maxlen+1)*sizeof(char));
strftime(tmpstr,maxlen,fmtstr,localtime(&now));
tmpstr[maxlen]='\0';
-
+
script_pushstr(st,tmpstr);
- return 0;
+ return true;
}
/*==========================================
* Open player storage
*------------------------------------------*/
-BUILDIN_FUNC(openstorage)
+BUILDIN(openstorage)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
storage_storageopen(sd);
- return 0;
+ return true;
}
-BUILDIN_FUNC(guildopenstorage)
+BUILDIN(guildopenstorage)
{
TBL_PC* sd;
int ret;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
ret = storage_guild_storageopen(sd);
script_pushint(st,ret);
- return 0;
+ return true;
}
/*==========================================
@@ -8647,152 +8412,152 @@ BUILDIN_FUNC(guildopenstorage)
*------------------------------------------*/
/// itemskill <skill id>,<level>
/// itemskill "<skill name>",<level>
-BUILDIN_FUNC(itemskill)
+BUILDIN(itemskill)
{
int id;
int lv;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL || sd->ud.skilltimer != INVALID_TIMER )
- return 0;
-
+ return true;
+
id = ( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
lv = script_getnum(st,3);
-
+
sd->skillitem=id;
sd->skillitemlv=lv;
clif->item_skill(sd,id,lv);
- return 0;
+ return true;
}
/*==========================================
* Attempt to create an item
*------------------------------------------*/
-BUILDIN_FUNC(produce)
+BUILDIN(produce)
{
int trigger;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
trigger=script_getnum(st,2);
clif->skill_produce_mix_list(sd, -1, trigger);
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(cooking)
+BUILDIN(cooking)
{
int trigger;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
trigger=script_getnum(st,2);
clif->cooking_list(sd, trigger, AM_PHARMACY, 1, 1);
- return 0;
+ return true;
}
/*==========================================
* Create a pet
*------------------------------------------*/
-BUILDIN_FUNC(makepet)
+BUILDIN(makepet)
{
TBL_PC* sd;
int id,pet_id;
-
+
id=script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
pet_id = search_petDB_index(id, PET_CLASS);
-
+
if (pet_id < 0)
pet_id = search_petDB_index(id, PET_EGG);
if (pet_id >= 0 && sd) {
sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(
- sd->status.account_id, sd->status.char_id,
- (short)pet_db[pet_id].class_, (short)mob_db(pet_db[pet_id].class_)->lv,
- (short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate,
- 100, 0, 1, pet_db[pet_id].jname);
+ sd->status.account_id, sd->status.char_id,
+ (short)pet_db[pet_id].class_, (short)mob_db(pet_db[pet_id].class_)->lv,
+ (short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate,
+ 100, 0, 1, pet_db[pet_id].jname);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Give player exp base,job * quest_exp_rate/100
*------------------------------------------*/
-BUILDIN_FUNC(getexp)
+BUILDIN(getexp)
{
TBL_PC* sd;
int base=0,job=0;
double bonus;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
base=script_getnum(st,2);
job =script_getnum(st,3);
if(base<0 || job<0)
- return 0;
-
+ return true;
+
// bonus for npc-given exp
bonus = battle_config.quest_exp_rate / 100.;
base = (int) cap_value(base * bonus, 0, INT_MAX);
job = (int) cap_value(job * bonus, 0, INT_MAX);
-
+
pc_gainexp(sd, NULL, base, job, true);
-
- return 0;
+
+ return true;
}
/*==========================================
* Gain guild exp [Celest]
*------------------------------------------*/
-BUILDIN_FUNC(guildgetexp)
+BUILDIN(guildgetexp)
{
TBL_PC* sd;
int exp;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
exp = script_getnum(st,2);
if(exp < 0)
- return 0;
+ return true;
if(sd && sd->status.guild_id > 0)
guild_getexp (sd, exp);
-
- return 0;
+
+ return true;
}
/*==========================================
* Changes the guild master of a guild [Skotlex]
*------------------------------------------*/
-BUILDIN_FUNC(guildchangegm)
+BUILDIN(guildchangegm)
{
TBL_PC *sd;
int guild_id;
const char *name;
-
+
guild_id = script_getnum(st,2);
name = script_getstr(st,3);
sd=map_nick2sd(name);
-
+
if (!sd)
script_pushint(st,0);
else
script_pushint(st,guild_gm_change(guild_id, sd));
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -8803,7 +8568,7 @@ BUILDIN_FUNC(guildchangegm)
@amount : nb to spawn
@event : event to attach to mob
*------------------------------------------*/
-BUILDIN_FUNC(monster)
+BUILDIN(monster)
{
const char* mapn = script_getstr(st,2);
int x = script_getnum(st,3);
@@ -8814,44 +8579,44 @@ BUILDIN_FUNC(monster)
const char* event = "";
unsigned int size = SZ_SMALL;
unsigned int ai = AI_NONE;
-
+
struct map_session_data* sd;
int16 m;
-
+
if (script_hasdata(st, 8))
{
event = script_getstr(st, 8);
check_event(st, event);
}
-
+
if (script_hasdata(st, 9))
{
size = script_getnum(st, 9);
if (size > 3)
{
ShowWarning("buildin_monster: Attempted to spawn non-existing size %d for monster class %d\n", size, class_);
- return 1;
+ return false;
}
}
-
+
if (script_hasdata(st, 10))
{
ai = script_getnum(st, 10);
if (ai > 4)
{
ShowWarning("buildin_monster: Attempted to spawn non-existing ai %d for monster class %d\n", ai, class_);
- return 1;
+ return false;
}
}
-
+
if (class_ >= 0 && !mobdb_checkid(class_))
{
ShowWarning("buildin_monster: Attempted to spawn non-existing monster class %d\n", class_);
- return 1;
+ return false;
}
-
+
sd = map_id2sd(st->rid);
-
+
if (sd && strcmp(mapn, "this") == 0)
m = sd->bl.m;
else
@@ -8862,53 +8627,53 @@ BUILDIN_FUNC(monster)
if ((m = instance_mapid2imapid(m, st->instance_id)) < 0)
{
ShowError("buildin_monster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn);
- return 1;
+ return false;
}
}
}
-
+
mob_once_spawn(sd, m, x, y, str, class_, amount, event, size, ai);
- return 0;
+ return true;
}
/*==========================================
* Request List of Monster Drops
*------------------------------------------*/
-BUILDIN_FUNC(getmobdrops)
+BUILDIN(getmobdrops)
{
int class_ = script_getnum(st,2);
int i, j = 0;
struct mob_db *mob;
-
+
if( !mobdb_checkid(class_) )
{
script_pushint(st, 0);
- return 0;
+ return true;
}
-
+
mob = mob_db(class_);
-
+
for( i = 0; i < MAX_MOB_DROP; i++ )
{
if( mob->dropitem[i].nameid < 1 )
continue;
if( itemdb_exists(mob->dropitem[i].nameid) == NULL )
continue;
-
+
mapreg_setreg(reference_uid(add_str("$@MobDrop_item"), j), mob->dropitem[i].nameid);
mapreg_setreg(reference_uid(add_str("$@MobDrop_rate"), j), mob->dropitem[i].p);
-
+
j++;
}
-
+
mapreg_setreg(add_str("$@MobDrop_count"), j);
script_pushint(st, 1);
-
- return 0;
+
+ return true;
}
/*==========================================
* Same as monster but randomize location in x0,x1,y0,y1 area
*------------------------------------------*/
-BUILDIN_FUNC(areamonster)
+BUILDIN(areamonster)
{
const char* mapn = script_getstr(st,2);
int x0 = script_getnum(st,3);
@@ -8921,38 +8686,38 @@ BUILDIN_FUNC(areamonster)
const char* event = "";
unsigned int size = SZ_SMALL;
unsigned int ai = AI_NONE;
-
+
struct map_session_data* sd;
int16 m;
-
+
if (script_hasdata(st,10))
{
event = script_getstr(st, 10);
check_event(st, event);
}
-
+
if (script_hasdata(st, 11))
{
size = script_getnum(st, 11);
if (size > 3)
{
ShowWarning("buildin_monster: Attempted to spawn non-existing size %d for monster class %d\n", size, class_);
- return 1;
+ return false;
}
}
-
+
if (script_hasdata(st, 12))
{
ai = script_getnum(st, 12);
if (ai > 4)
{
ShowWarning("buildin_monster: Attempted to spawn non-existing ai %d for monster class %d\n", ai, class_);
- return 1;
+ return false;
}
}
-
+
sd = map_id2sd(st->rid);
-
+
if (sd && strcmp(mapn, "this") == 0)
m = sd->bl.m;
else
@@ -8963,25 +8728,25 @@ BUILDIN_FUNC(areamonster)
if ((m = instance_mapid2imapid(m, st->instance_id)) < 0)
{
ShowError("buildin_areamonster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn);
- return 1;
+ return false;
}
}
}
-
+
mob_once_spawn_area(sd, m, x0, y0, x1, y1, str, class_, amount, event, size, ai);
- return 0;
+ return true;
}
/*==========================================
* KillMonster subcheck, verify if mob to kill ain't got an even to handle, could be force kill by allflag
*------------------------------------------*/
- static int buildin_killmonster_sub_strip(struct block_list *bl,va_list ap)
+static int buildin_killmonster_sub_strip(struct block_list *bl,va_list ap)
{ //same fix but with killmonster instead - stripping events from mobs.
TBL_MOB* md = (TBL_MOB*)bl;
char *event=va_arg(ap,char *);
int allflag=va_arg(ap,int);
-
+
md->state.npc_killmonster = 1;
-
+
if(!allflag){
if(strcmp(event,md->npc_event)==0)
status_kill(bl);
@@ -8997,7 +8762,7 @@ static int buildin_killmonster_sub(struct block_list *bl,va_list ap)
TBL_MOB* md = (TBL_MOB*)bl;
char *event=va_arg(ap,char *);
int allflag=va_arg(ap,int);
-
+
if(!allflag){
if(strcmp(event,md->npc_event)==0)
status_kill(bl);
@@ -9007,7 +8772,7 @@ static int buildin_killmonster_sub(struct block_list *bl,va_list ap)
}
return 0;
}
-BUILDIN_FUNC(killmonster)
+BUILDIN(killmonster)
{
const char *mapname,*event;
int16 m,allflag=0;
@@ -9017,34 +8782,34 @@ BUILDIN_FUNC(killmonster)
allflag = 1;
else
check_event(st, event);
-
+
if( (m=map_mapname2mapid(mapname))<0 )
- return 0;
-
+ return true;
+
if( map[m].flag.src4instance && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
- return 0;
-
+ return true;
+
if( script_hasdata(st,4) ) {
if ( script_getnum(st,4) == 1 ) {
map_foreachinmap(buildin_killmonster_sub, m, BL_MOB, event ,allflag);
- return 0;
+ return true;
}
}
-
+
map_freeblock_lock();
map_foreachinmap(buildin_killmonster_sub_strip, m, BL_MOB, event ,allflag);
map_freeblock_unlock();
- return 0;
+ return true;
}
static int buildin_killmonsterall_sub_strip(struct block_list *bl,va_list ap)
{ //Strips the event from the mob if it's killed the old method.
struct mob_data *md;
-
+
md = BL_CAST(BL_MOB, bl);
if (md->npc_event[0])
md->npc_event[0] = 0;
-
+
status_kill(bl);
return 0;
}
@@ -9053,65 +8818,65 @@ static int buildin_killmonsterall_sub(struct block_list *bl,va_list ap)
status_kill(bl);
return 0;
}
-BUILDIN_FUNC(killmonsterall)
+BUILDIN(killmonsterall)
{
const char *mapname;
int16 m;
mapname=script_getstr(st,2);
-
+
if( (m = map_mapname2mapid(mapname))<0 )
- return 0;
-
+ return true;
+
if( map[m].flag.src4instance && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
- return 0;
-
+ return true;
+
if( script_hasdata(st,3) ) {
if ( script_getnum(st,3) == 1 ) {
map_foreachinmap(buildin_killmonsterall_sub,m,BL_MOB);
- return 0;
+ return true;
}
}
-
+
map_foreachinmap(buildin_killmonsterall_sub_strip,m,BL_MOB);
- return 0;
+ return true;
}
/*==========================================
* Creates a clone of a player.
* clone map, x, y, event, char_id, master_id, mode, flag, duration
*------------------------------------------*/
-BUILDIN_FUNC(clone)
+BUILDIN(clone)
{
TBL_PC *sd, *msd=NULL;
int char_id,master_id=0,x,y, mode = 0, flag = 0, m;
unsigned int duration = 0;
const char *map,*event="";
-
+
map=script_getstr(st,2);
x=script_getnum(st,3);
y=script_getnum(st,4);
event=script_getstr(st,5);
char_id=script_getnum(st,6);
-
+
if( script_hasdata(st,7) )
master_id=script_getnum(st,7);
-
+
if( script_hasdata(st,8) )
mode=script_getnum(st,8);
-
+
if( script_hasdata(st,9) )
flag=script_getnum(st,9);
-
+
if( script_hasdata(st,10) )
duration=script_getnum(st,10);
-
+
check_event(st, event);
-
+
m = map_mapname2mapid(map);
- if (m < 0) return 0;
-
+ if (m < 0) return true;
+
sd = map_charid2sd(char_id);
-
+
if (master_id) {
msd = map_charid2sd(master_id);
if (msd)
@@ -9123,28 +8888,28 @@ BUILDIN_FUNC(clone)
script_pushint(st,mob_clone_spawn(sd, m, x, y, event, master_id, mode, flag, 1000*duration));
else //Failed to create clone.
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(doevent)
+BUILDIN(doevent)
{
const char* event = script_getstr(st,2);
struct map_session_data* sd;
-
+
if( ( sd = script_rid2sd(st) ) == NULL )
{
- return 0;
+ return true;
}
-
+
check_event(st, event);
npc_event(sd, event, 0);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(donpcevent)
+BUILDIN(donpcevent)
{
const char* event = script_getstr(st,2);
check_event(st, event);
@@ -9154,12 +8919,12 @@ BUILDIN_FUNC(donpcevent)
script_pushint(st, 0);
} else
script_pushint(st, 1);
- return 0;
+ return true;
}
/// for Aegis compatibility
/// basically a specialized 'donpcevent', with the event specified as two arguments instead of one
-BUILDIN_FUNC(cmdothernpc) // Added by RoVeRT
+BUILDIN(cmdothernpc) // Added by RoVeRT
{
const char* npc = script_getstr(st,2);
const char* command = script_getstr(st,3);
@@ -9167,67 +8932,67 @@ BUILDIN_FUNC(cmdothernpc) // Added by RoVeRT
snprintf(event, sizeof(event), "%s::OnCommand%s", npc, command);
check_event(st, event);
npc_event_do(event);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(addtimer)
+BUILDIN(addtimer)
{
int tick = script_getnum(st,2);
const char* event = script_getstr(st, 3);
TBL_PC* sd;
-
+
check_event(st, event);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
pc_addeventtimer(sd,tick,event);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(deltimer)
+BUILDIN(deltimer)
{
const char *event;
TBL_PC* sd;
-
+
event=script_getstr(st, 2);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
check_event(st, event);
pc_deleventtimer(sd,event);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(addtimercount)
+BUILDIN(addtimercount)
{
const char *event;
int tick;
TBL_PC* sd;
-
+
event=script_getstr(st, 2);
tick=script_getnum(st,3);
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
check_event(st, event);
pc_addeventtimercount(sd,event,tick);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(initnpctimer)
+BUILDIN(initnpctimer)
{
struct npc_data *nd;
int flag = 0;
-
+
if( script_hasdata(st,3) )
{ //Two arguments: NPC name and attach flag.
nd = npc_name2id(script_getstr(st, 2));
@@ -9248,34 +9013,34 @@ BUILDIN_FUNC(initnpctimer)
else
{
ShowError("initnpctimer: invalid argument type #1 (needs be int or string)).\n");
- return 1;
+ return false;
}
}
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( !nd )
- return 0;
+ return true;
if( flag ) //Attach
{
TBL_PC* sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
+ return true;
nd->u.scr.rid = sd->bl.id;
}
-
+
nd->u.scr.timertick = 0;
npc_settimerevent_tick(nd,0);
npc_timerevent_start(nd, st->rid);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(startnpctimer)
+BUILDIN(startnpctimer)
{
struct npc_data *nd;
int flag = 0;
-
+
if( script_hasdata(st,3) )
{ //Two arguments: NPC name and attach flag.
nd = npc_name2id(script_getstr(st, 2));
@@ -9296,32 +9061,32 @@ BUILDIN_FUNC(startnpctimer)
else
{
ShowError("initnpctimer: invalid argument type #1 (needs be int or string)).\n");
- return 1;
+ return false;
}
}
else
nd=(struct npc_data *)map_id2bl(st->oid);
-
+
if( !nd )
- return 0;
+ return true;
if( flag ) //Attach
{
TBL_PC* sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
+ return true;
nd->u.scr.rid = sd->bl.id;
}
-
+
npc_timerevent_start(nd, st->rid);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(stopnpctimer)
+BUILDIN(stopnpctimer)
{
struct npc_data *nd;
int flag = 0;
-
+
if( script_hasdata(st,3) )
{ //Two arguments: NPC name and attach flag.
nd = npc_name2id(script_getstr(st, 2));
@@ -9342,143 +9107,143 @@ BUILDIN_FUNC(stopnpctimer)
else
{
ShowError("initnpctimer: invalid argument type #1 (needs be int or string)).\n");
- return 1;
+ return false;
}
}
else
nd=(struct npc_data *)map_id2bl(st->oid);
-
+
if( !nd )
- return 0;
+ return true;
if( flag ) //Detach
nd->u.scr.rid = 0;
-
+
npc_timerevent_stop(nd);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(getnpctimer)
+BUILDIN(getnpctimer)
{
struct npc_data *nd;
TBL_PC *sd;
int type = script_getnum(st,2);
int val = 0;
-
+
if( script_hasdata(st,3) )
nd = npc_name2id(script_getstr(st,3));
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( !nd || nd->bl.type != BL_NPC )
{
script_pushint(st,0);
ShowError("getnpctimer: Invalid NPC.\n");
- return 1;
+ return false;
}
-
+
switch( type )
{
- case 0: val = npc_gettimerevent_tick(nd); break;
- case 1:
- if( nd->u.scr.rid )
- {
- sd = map_id2sd(nd->u.scr.rid);
- if( !sd )
+ case 0: val = npc_gettimerevent_tick(nd); break;
+ case 1:
+ if( nd->u.scr.rid )
{
- ShowError("buildin_getnpctimer: Attached player not found!\n");
- break;
+ sd = map_id2sd(nd->u.scr.rid);
+ if( !sd )
+ {
+ ShowError("buildin_getnpctimer: Attached player not found!\n");
+ break;
+ }
+ val = (sd->npc_timer_id != INVALID_TIMER);
}
- val = (sd->npc_timer_id != INVALID_TIMER);
- }
- else
- val = (nd->u.scr.timerid != INVALID_TIMER);
- break;
- case 2: val = nd->u.scr.timeramount; break;
+ else
+ val = (nd->u.scr.timerid != INVALID_TIMER);
+ break;
+ case 2: val = nd->u.scr.timeramount; break;
}
-
+
script_pushint(st,val);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(setnpctimer)
+BUILDIN(setnpctimer)
{
int tick;
struct npc_data *nd;
-
+
tick = script_getnum(st,2);
if( script_hasdata(st,3) )
nd = npc_name2id(script_getstr(st,3));
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( !nd || nd->bl.type != BL_NPC )
{
script_pushint(st,1);
ShowError("setnpctimer: Invalid NPC.\n");
- return 1;
+ return false;
}
-
+
npc_settimerevent_tick(nd,tick);
script_pushint(st,0);
- return 0;
+ return true;
}
/*==========================================
* attaches the player rid to the timer [Celest]
*------------------------------------------*/
-BUILDIN_FUNC(attachnpctimer)
+BUILDIN(attachnpctimer)
{
TBL_PC *sd;
struct npc_data *nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( !nd || nd->bl.type != BL_NPC )
{
script_pushint(st,1);
ShowError("setnpctimer: Invalid NPC.\n");
- return 1;
+ return false;
}
-
+
if( script_hasdata(st,2) )
sd = map_nick2sd(script_getstr(st,2));
else
sd = script_rid2sd(st);
-
+
if( !sd )
{
script_pushint(st,1);
ShowWarning("attachnpctimer: Invalid player.\n");
- return 1;
+ return false;
}
-
+
nd->u.scr.rid = sd->bl.id;
script_pushint(st,0);
- return 0;
+ return true;
}
/*==========================================
* detaches a player rid from the timer [Celest]
*------------------------------------------*/
-BUILDIN_FUNC(detachnpctimer)
+BUILDIN(detachnpctimer)
{
struct npc_data *nd;
-
+
if( script_hasdata(st,2) )
nd = npc_name2id(script_getstr(st,2));
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( !nd || nd->bl.type != BL_NPC )
{
script_pushint(st,1);
ShowError("detachnpctimer: Invalid NPC.\n");
- return 1;
+ return false;
}
-
+
nd->u.scr.rid = 0;
script_pushint(st,0);
- return 0;
+ return true;
}
/*==========================================
@@ -9486,18 +9251,18 @@ BUILDIN_FUNC(detachnpctimer)
* it checks if there is a player attached to the current script. [Skotlex]
* If no, returns 0, if yes, returns the account_id of the attached player.
*------------------------------------------*/
-BUILDIN_FUNC(playerattached)
+BUILDIN(playerattached)
{
if(st->rid == 0 || map_id2sd(st->rid) == NULL)
script_pushint(st,0);
else
script_pushint(st,st->rid);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(announce)
+BUILDIN(announce)
{
const char *mes = script_getstr(st,2);
int flag = script_getnum(st,3);
@@ -9506,19 +9271,19 @@ BUILDIN_FUNC(announce)
int fontSize = script_hasdata(st,6) ? script_getnum(st,6) : 12; // default fontSize
int fontAlign = script_hasdata(st,7) ? script_getnum(st,7) : 0; // default fontAlign
int fontY = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontY
-
+
if (flag&0x0f) // Broadcast source or broadcast region defined
{
send_target target;
struct block_list *bl = (flag&0x08) ? map_id2bl(st->oid) : (struct block_list *)script_rid2sd(st); // If bc_npc flag is set, use NPC as broadcast source
if (bl == NULL)
- return 0;
-
+ return true;
+
flag &= 0x07;
target = (flag == 1) ? ALL_SAMEMAP :
- (flag == 2) ? AREA :
- (flag == 3) ? SELF :
- ALL_CLIENT;
+ (flag == 2) ? AREA :
+ (flag == 3) ? SELF :
+ ALL_CLIENT;
if (fontColor)
clif->broadcast2(bl, mes, (int)strlen(mes)+1, strtol(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target);
else
@@ -9531,7 +9296,7 @@ BUILDIN_FUNC(announce)
else
intif_broadcast(mes, (int)strlen(mes)+1, flag&0xf0);
}
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
@@ -9554,7 +9319,7 @@ static int buildin_announce_sub(struct block_list *bl, va_list ap)
/* Runs item effect on attached character.
* itemeffect <item id>;
* itemeffect "<item name>"; */
-BUILDIN_FUNC(itemeffect) {
+BUILDIN(itemeffect) {
TBL_NPC *nd;
TBL_PC *sd;
struct script_data *data;
@@ -9571,26 +9336,26 @@ BUILDIN_FUNC(itemeffect) {
if( ( item_data = itemdb_searchname( name ) ) == NULL ){
ShowError( "buildin_itemeffect: Nonexistant item %s requested.\n", name );
- return 1;
+ return false;
}
} else if( data_isint( data ) ){
int nameid = conv_num( st, data );
if( ( item_data = itemdb_exists( nameid ) ) == NULL ){
ShowError("buildin_itemeffect: Nonexistant item %d requested.\n", nameid );
- return 1;
+ return false;
}
} else {
ShowError("buildin_itemeffect: invalid data type for argument #1 (%d).", data->type );
- return 1;
+ return false;
}
run_script( item_data->script, 0, sd->bl.id, nd->bl.id );
- return 0;
+ return true;
}
-BUILDIN_FUNC(mapannounce)
+BUILDIN(mapannounce)
{
const char *mapname = script_getstr(st,2);
const char *mes = script_getstr(st,3);
@@ -9601,17 +9366,17 @@ BUILDIN_FUNC(mapannounce)
int fontAlign = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontAlign
int fontY = script_hasdata(st,9) ? script_getnum(st,9) : 0; // default fontY
int16 m;
-
+
if ((m = map_mapname2mapid(mapname)) < 0)
- return 0;
-
+ return true;
+
map_foreachinmap(buildin_announce_sub, m, BL_PC,
- mes, strlen(mes)+1, flag&0xf0, fontColor, fontType, fontSize, fontAlign, fontY);
- return 0;
+ mes, strlen(mes)+1, flag&0xf0, fontColor, fontType, fontSize, fontAlign, fontY);
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(areaannounce)
+BUILDIN(areaannounce)
{
const char *mapname = script_getstr(st,2);
int x0 = script_getnum(st,3);
@@ -9626,25 +9391,25 @@ BUILDIN_FUNC(areaannounce)
int fontAlign = script_hasdata(st,12) ? script_getnum(st,12) : 0; // default fontAlign
int fontY = script_hasdata(st,13) ? script_getnum(st,13) : 0; // default fontY
int16 m;
-
+
if ((m = map_mapname2mapid(mapname)) < 0)
- return 0;
-
+ return true;
+
map_foreachinarea(buildin_announce_sub, m, x0, y0, x1, y1, BL_PC,
- mes, strlen(mes)+1, flag&0xf0, fontColor, fontType, fontSize, fontAlign, fontY);
- return 0;
+ mes, strlen(mes)+1, flag&0xf0, fontColor, fontType, fontSize, fontAlign, fontY);
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(getusers)
+BUILDIN(getusers)
{
int flag, val = 0;
struct map_session_data* sd;
struct block_list* bl = NULL;
-
+
flag = script_getnum(st,2);
-
+
switch(flag&0x07)
{
case 0:
@@ -9656,7 +9421,7 @@ BUILDIN_FUNC(getusers)
{// pc
bl = &sd->bl;
}
-
+
if(bl)
{
val = map[bl->m].users;
@@ -9668,45 +9433,45 @@ BUILDIN_FUNC(getusers)
default:
ShowWarning("buildin_getusers: Unknown type %d.\n", flag);
script_pushint(st,0);
- return 1;
+ return false;
}
-
+
script_pushint(st,val);
- return 0;
+ return true;
}
/*==========================================
* Works like @WHO - displays all online users names in window
*------------------------------------------*/
-BUILDIN_FUNC(getusersname)
+BUILDIN(getusersname)
{
TBL_PC *sd, *pl_sd;
int /*disp_num=1,*/ group_level = 0;
struct s_mapiterator* iter;
-
+
sd = script_rid2sd(st);
- if (!sd) return 0;
-
+ if (!sd) return true;
+
group_level = pc_get_group_level(sd);
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
if (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > group_level)
continue; // skip hidden sessions
-
+
/* Temporary fix for bugreport:1023.
* Do not uncomment unless you want thousands of 'next' buttons.
- if((disp_num++)%10==0)
- clif->scriptnext(sd,st->oid);*/
+ if((disp_num++)%10==0)
+ clif->scriptnext(sd,st->oid);*/
clif->scriptmes(sd,st->oid,pl_sd->status.name);
}
mapit_free(iter);
-
- return 0;
+
+ return true;
}
/*==========================================
* getmapguildusers("mapname",guild ID) Returns the number guild members present on a map [Reddozen]
*------------------------------------------*/
-BUILDIN_FUNC(getmapguildusers)
+BUILDIN(getmapguildusers)
{
const char *str;
int16 m;
@@ -9717,10 +9482,10 @@ BUILDIN_FUNC(getmapguildusers)
gid=script_getnum(st,3);
if ((m = map_mapname2mapid(str)) < 0) { // map id on this server (m == -1 if not in actual map-server)
script_pushint(st,-1);
- return 0;
+ return true;
}
g = guild_search(gid);
-
+
if (g){
for(i = 0; i < g->max_member; i++)
{
@@ -9728,23 +9493,23 @@ BUILDIN_FUNC(getmapguildusers)
c++;
}
}
-
+
script_pushint(st,c);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(getmapusers)
+BUILDIN(getmapusers)
{
const char *str;
int16 m;
str=script_getstr(st,2);
if( (m=map_mapname2mapid(str))< 0){
script_pushint(st,-1);
- return 0;
+ return true;
}
script_pushint(st,map[m].users);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
@@ -9754,7 +9519,7 @@ static int buildin_getareausers_sub(struct block_list *bl,va_list ap)
(*users)++;
return 0;
}
-BUILDIN_FUNC(getareausers)
+BUILDIN(getareausers)
{
const char *str;
int16 m,x0,y0,x1,y1,users=0; //doubt we can have more then 32k users on
@@ -9765,12 +9530,12 @@ BUILDIN_FUNC(getareausers)
y1=script_getnum(st,6);
if( (m=map_mapname2mapid(str))< 0){
script_pushint(st,-1);
- return 0;
+ return true;
}
map_foreachinarea(buildin_getareausers_sub,
- m,x0,y0,x1,y1,BL_PC,&users);
+ m,x0,y0,x1,y1,BL_PC,&users);
script_pushint(st,users);
- return 0;
+ return true;
}
/*==========================================
@@ -9780,25 +9545,25 @@ static int buildin_getareadropitem_sub(struct block_list *bl,va_list ap)
int item=va_arg(ap,int);
int *amount=va_arg(ap,int *);
struct flooritem_data *drop=(struct flooritem_data *)bl;
-
+
if(drop->item_data.nameid==item)
(*amount)+=drop->item_data.amount;
-
+
return 0;
}
-BUILDIN_FUNC(getareadropitem)
+BUILDIN(getareadropitem)
{
const char *str;
int16 m,x0,y0,x1,y1;
int item,amount=0;
struct script_data *data;
-
+
str=script_getstr(st,2);
x0=script_getnum(st,3);
y0=script_getnum(st,4);
x1=script_getnum(st,5);
y1=script_getnum(st,6);
-
+
data=script_getdata(st,7);
get_val(st,data);
if( data_isstring(data) ){
@@ -9809,65 +9574,65 @@ BUILDIN_FUNC(getareadropitem)
item=item_data->nameid;
}else
item=conv_num(st,data);
-
+
if( (m=map_mapname2mapid(str))< 0){
script_pushint(st,-1);
- return 0;
+ return true;
}
map_foreachinarea(buildin_getareadropitem_sub,
- m,x0,y0,x1,y1,BL_ITEM,item,&amount);
+ m,x0,y0,x1,y1,BL_ITEM,item,&amount);
script_pushint(st,amount);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(enablenpc)
+BUILDIN(enablenpc)
{
const char *str;
str=script_getstr(st,2);
npc_enable(str,1);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(disablenpc)
+BUILDIN(disablenpc)
{
const char *str;
str=script_getstr(st,2);
npc_enable(str,0);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(hideoffnpc)
+BUILDIN(hideoffnpc)
{
const char *str;
str=script_getstr(st,2);
npc_enable(str,2);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(hideonnpc)
+BUILDIN(hideonnpc)
{
const char *str;
str=script_getstr(st,2);
npc_enable(str,4);
- return 0;
+ return true;
}
/// Starts a status effect on the target unit or on the attached player.
///
/// sc_start <effect_id>,<duration>,<val1>{,<unit_id>};
-BUILDIN_FUNC(sc_start)
+BUILDIN(sc_start)
{
struct block_list* bl;
enum sc_type type;
int tick;
int val1;
int val4 = 0;
-
+
type = (sc_type)script_getnum(st,2);
tick = script_getnum(st,3);
val1 = script_getnum(st,4);
@@ -9875,29 +9640,29 @@ BUILDIN_FUNC(sc_start)
bl = map_id2bl(script_getnum(st,5));
else
bl = map_id2bl(st->rid);
-
+
if( tick == 0 && val1 > 0 && type > SC_NONE && type < SC_MAX && status_sc2skill(type) != 0 )
{// When there isn't a duration specified, try to get it from the skill_db
tick = skill->get_time(status_sc2skill(type), val1);
}
-
+
if( potion_flag == 1 && potion_target )
{ //skill.c set the flags before running the script, this must be a potion-pitched effect.
bl = map_id2bl(potion_target);
tick /= 2;// Thrown potions only last half.
val4 = 1;// Mark that this was a thrown sc_effect
}
-
+
if( bl )
status_change_start(bl, type, 10000, val1, 0, 0, val4, tick, 2);
-
- return 0;
+
+ return true;
}
/// Starts a status effect on the target unit or on the attached player.
///
/// sc_start2 <effect_id>,<duration>,<val1>,<percent chance>{,<unit_id>};
-BUILDIN_FUNC(sc_start2)
+BUILDIN(sc_start2)
{
struct block_list* bl;
enum sc_type type;
@@ -9905,7 +9670,7 @@ BUILDIN_FUNC(sc_start2)
int val1;
int val4 = 0;
int rate;
-
+
type = (sc_type)script_getnum(st,2);
tick = script_getnum(st,3);
val1 = script_getnum(st,4);
@@ -9914,29 +9679,29 @@ BUILDIN_FUNC(sc_start2)
bl = map_id2bl(script_getnum(st,6));
else
bl = map_id2bl(st->rid);
-
+
if( tick == 0 && val1 > 0 && type > SC_NONE && type < SC_MAX && status_sc2skill(type) != 0 )
{// When there isn't a duration specified, try to get it from the skill_db
tick = skill->get_time(status_sc2skill(type), val1);
}
-
+
if( potion_flag == 1 && potion_target )
{ //skill.c set the flags before running the script, this must be a potion-pitched effect.
bl = map_id2bl(potion_target);
tick /= 2;// Thrown potions only last half.
val4 = 1;// Mark that this was a thrown sc_effect
}
-
+
if( bl )
status_change_start(bl, type, rate, val1, 0, 0, val4, tick, 2);
-
- return 0;
+
+ return true;
}
/// Starts a status effect on the target unit or on the attached player.
///
/// sc_start4 <effect_id>,<duration>,<val1>,<val2>,<val3>,<val4>{,<unit_id>};
-BUILDIN_FUNC(sc_start4)
+BUILDIN(sc_start4)
{
struct block_list* bl;
enum sc_type type;
@@ -9945,7 +9710,7 @@ BUILDIN_FUNC(sc_start4)
int val2;
int val3;
int val4;
-
+
type = (sc_type)script_getnum(st,2);
tick = script_getnum(st,3);
val1 = script_getnum(st,4);
@@ -9956,125 +9721,125 @@ BUILDIN_FUNC(sc_start4)
bl = map_id2bl(script_getnum(st,8));
else
bl = map_id2bl(st->rid);
-
+
if( tick == 0 && val1 > 0 && type > SC_NONE && type < SC_MAX && status_sc2skill(type) != 0 )
{// When there isn't a duration specified, try to get it from the skill_db
tick = skill->get_time(status_sc2skill(type), val1);
}
-
+
if( potion_flag == 1 && potion_target )
{ //skill.c set the flags before running the script, this must be a potion-pitched effect.
bl = map_id2bl(potion_target);
tick /= 2;// Thrown potions only last half.
}
-
+
if( bl )
status_change_start(bl, type, 10000, val1, val2, val3, val4, tick, 2);
-
- return 0;
+
+ return true;
}
/// Ends one or all status effects on the target unit or on the attached player.
///
/// sc_end <effect_id>{,<unit_id>};
-BUILDIN_FUNC(sc_end)
+BUILDIN(sc_end)
{
struct block_list* bl;
int type;
-
+
type = script_getnum(st, 2);
if (script_hasdata(st, 3))
bl = map_id2bl(script_getnum(st, 3));
else
bl = map_id2bl(st->rid);
-
+
if (potion_flag == 1 && potion_target) //##TODO how does this work [FlavioJS]
bl = map_id2bl(potion_target);
-
+
if (!bl)
- return 0;
-
+ return true;
+
if (type >= 0 && type < SC_MAX)
{
struct status_change *sc = status_get_sc(bl);
struct status_change_entry *sce = sc ? sc->data[type] : NULL;
-
+
if (!sce)
- return 0;
-
-
+ return true;
+
+
switch (type)
{
case SC_WEIGHT50:
case SC_WEIGHT90:
case SC_NOCHAT:
case SC_PUSH_CART:
- return 0;
-
+ return true;
+
default:
break;
}
-
+
//This should help status_change_end force disabling the SC in case it has no limit.
sce->val1 = sce->val2 = sce->val3 = sce->val4 = 0;
status_change_end(bl, (sc_type)type, INVALID_TIMER);
}
else
status_change_clear(bl, 3); // remove all effects
-
- return 0;
+
+ return true;
}
/*==========================================
* @FIXME atm will return reduced tick, 0 immune, 1 no tick
*------------------------------------------*/
-BUILDIN_FUNC(getscrate)
+BUILDIN(getscrate)
{
struct block_list *bl;
int type,rate;
-
+
type=script_getnum(st,2);
rate=script_getnum(st,3);
if( script_hasdata(st,4) ) //get for the bl assigned
bl = map_id2bl(script_getnum(st,4));
else
bl = map_id2bl(st->rid);
-
+
if (bl)
rate = status_get_sc_def(bl, (sc_type)type, 10000, 10000, 0);
-
+
script_pushint(st,rate);
- return 0;
+ return true;
}
/*==========================================
* getstatus <type>{, <info>};
*------------------------------------------*/
-BUILDIN_FUNC(getstatus)
+BUILDIN(getstatus)
{
int id, type;
struct map_session_data* sd = script_rid2sd(st);
-
+
if( sd == NULL )
{// no player attached
- return 0;
+ return true;
}
-
+
id = script_getnum(st, 2);
type = script_hasdata(st, 3) ? script_getnum(st, 3) : 0;
-
+
if( id <= SC_NONE || id >= SC_MAX )
{// invalid status type given
ShowWarning("script.c:getstatus: Invalid status type given (%d).\n", id);
- return 0;
+ return true;
}
-
+
if( sd->sc.count == 0 || !sd->sc.data[id] )
{// no status is active
script_pushint(st, 0);
- return 0;
+ return true;
}
-
+
switch( type )
{
case 1: script_pushint(st, sd->sc.data[id]->val1); break;
@@ -10082,59 +9847,59 @@ BUILDIN_FUNC(getstatus)
case 3: script_pushint(st, sd->sc.data[id]->val3); break;
case 4: script_pushint(st, sd->sc.data[id]->val4); break;
case 5:
- {
- struct TimerData* timer = (struct TimerData*)get_timer(sd->sc.data[id]->timer);
-
- if( timer )
- {// return the amount of time remaining
- script_pushint(st, timer->tick - gettick());
- }
+ {
+ struct TimerData* timer = (struct TimerData*)get_timer(sd->sc.data[id]->timer);
+
+ if( timer )
+ {// return the amount of time remaining
+ script_pushint(st, timer->tick - gettick());
}
+ }
break;
default: script_pushint(st, 1); break;
}
-
- return 0;
+
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(debugmes)
+BUILDIN(debugmes)
{
const char *str;
str=script_getstr(st,2);
ShowDebug("script debug : %d %d : %s\n",st->rid,st->oid,str);
- return 0;
+ return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN_FUNC(catchpet)
+BUILDIN(catchpet)
{
int pet_id;
TBL_PC *sd;
-
+
pet_id= script_getnum(st,2);
sd=script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
pet_catch_process1(sd,pet_id);
- return 0;
+ return true;
}
/*==========================================
* [orn]
*------------------------------------------*/
-BUILDIN_FUNC(homunculus_evolution)
+BUILDIN(homunculus_evolution)
{
TBL_PC *sd;
-
+
sd=script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if(merc_is_hom_active(sd->hd))
{
if (sd->hd->homunculus.intimacy > 91000)
@@ -10142,55 +9907,55 @@ BUILDIN_FUNC(homunculus_evolution)
else
clif->emotion(&sd->hd->bl, E_SWT);
}
- return 0;
+ return true;
}
/*==========================================
* [Xantara]
*------------------------------------------*/
-BUILDIN_FUNC(homunculus_mutate)
+BUILDIN(homunculus_mutate)
{
int homun_id, m_class, m_id;
TBL_PC *sd;
-
+
sd = script_rid2sd(st);
- if( sd == NULL )
- return 0;
-
+ if( sd == NULL || sd->hd == NULL )
+ return true;
+
if(script_hasdata(st,2))
homun_id = script_getnum(st,2);
else
homun_id = 6048 + (rnd() % 4);
-
+
if(merc_is_hom_active(sd->hd)) {
m_class = hom_class2mapid(sd->hd->homunculus.class_);
m_id = hom_class2mapid(homun_id);
-
+
if ( m_class != -1 && m_id != -1 && m_class&HOM_EVO && m_id&HOM_S && sd->hd->homunculus.level >= 99 )
hom_mutate(sd->hd, homun_id);
else
clif->emotion(&sd->hd->bl, E_SWT);
}
- return 0;
+ return true;
}
// [Zephyrus]
-BUILDIN_FUNC(homunculus_shuffle)
+BUILDIN(homunculus_shuffle)
{
TBL_PC *sd;
-
+
sd=script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if(merc_is_hom_active(sd->hd))
merc_hom_shuffle(sd->hd);
-
- return 0;
+
+ return true;
}
//These two functions bring the eA MAPID_* class functionality to scripts.
-BUILDIN_FUNC(eaclass)
+BUILDIN(eaclass)
{
int class_;
if( script_hasdata(st,2) )
@@ -10200,15 +9965,15 @@ BUILDIN_FUNC(eaclass)
sd=script_rid2sd(st);
if (!sd) {
script_pushint(st,-1);
- return 0;
+ return true;
}
class_ = sd->status.class_;
}
script_pushint(st,pc_jobid2mapid(class_));
- return 0;
+ return true;
}
-BUILDIN_FUNC(roclass)
+BUILDIN(roclass)
{
int class_ =script_getnum(st,2);
int sex;
@@ -10222,26 +9987,26 @@ BUILDIN_FUNC(roclass)
sex = 1; //Just use male when not found.
}
script_pushint(st,pc_mapid2jobid(class_, sex));
- return 0;
+ return true;
}
/*==========================================
* Tells client to open a hatching window, used for pet incubator
*------------------------------------------*/
-BUILDIN_FUNC(birthpet)
+BUILDIN(birthpet)
{
TBL_PC *sd;
sd=script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
if( sd->status.pet_id )
{// do not send egg list, when you already have a pet
- return 0;
+ return true;
}
-
+
clif->sendegg(sd);
- return 0;
+ return true;
}
/*==========================================
@@ -10252,77 +10017,77 @@ BUILDIN_FUNC(birthpet)
* 3 : don't reset skill, blvl=1
* 4 : jlvl=0
*------------------------------------------*/
-BUILDIN_FUNC(resetlvl)
+BUILDIN(resetlvl)
{
TBL_PC *sd;
-
+
int type=script_getnum(st,2);
-
+
sd=script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
pc_resetlvl(sd,type);
- return 0;
+ return true;
}
/*==========================================
* Reset a player status point
*------------------------------------------*/
-BUILDIN_FUNC(resetstatus)
+BUILDIN(resetstatus)
{
TBL_PC *sd;
sd=script_rid2sd(st);
pc_resetstate(sd);
- return 0;
+ return true;
}
/*==========================================
* script command resetskill
*------------------------------------------*/
-BUILDIN_FUNC(resetskill)
+BUILDIN(resetskill)
{
TBL_PC *sd;
sd=script_rid2sd(st);
pc_resetskill(sd,1);
- return 0;
+ return true;
}
/*==========================================
* Counts total amount of skill points.
*------------------------------------------*/
-BUILDIN_FUNC(skillpointcount)
+BUILDIN(skillpointcount)
{
TBL_PC *sd;
sd=script_rid2sd(st);
script_pushint(st,sd->status.skill_point + pc_resetskill(sd,2));
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(changebase)
+BUILDIN(changebase)
{
TBL_PC *sd=NULL;
int vclass;
-
+
if( script_hasdata(st,3) )
sd=map_id2sd(script_getnum(st,3));
else
- sd=script_rid2sd(st);
-
+ sd=script_rid2sd(st);
+
if(sd == NULL)
- return 0;
-
+ return true;
+
vclass = script_getnum(st,2);
if(vclass == JOB_WEDDING)
{
if (!battle_config.wedding_modifydisplay || //Do not show the wedding sprites
sd->class_&JOBL_BABY //Baby classes screw up when showing wedding sprites. [Skotlex] They don't seem to anymore.
)
- return 0;
+ return true;
}
-
+
if(!sd->disguise && vclass != sd->vd.class_) {
status_set_viewdata(&sd->bl, vclass);
//Updated client view. Base, Weapon and Cloth Colors.
@@ -10332,48 +10097,48 @@ BUILDIN_FUNC(changebase)
clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
clif->skillinfoblock(sd);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Unequip all item and request for a changesex to char-serv
*------------------------------------------*/
-BUILDIN_FUNC(changesex)
+BUILDIN(changesex)
{
int i;
TBL_PC *sd = NULL;
sd = script_rid2sd(st);
-
+
pc_resetskill(sd,4);
// to avoid any problem with equipment and invalid sex, equipment is unequiped.
for( i=0; i<EQI_MAX; i++ )
if( sd->equip_index[i] >= 0 ) pc_unequipitem(sd, sd->equip_index[i], 3);
chrif_changesex(sd);
- return 0;
+ return true;
}
/*==========================================
* Works like 'announce' but outputs in the common chat window
*------------------------------------------*/
-BUILDIN_FUNC(globalmes)
+BUILDIN(globalmes)
{
struct block_list *bl = map_id2bl(st->oid);
struct npc_data *nd = (struct npc_data *)bl;
const char *name=NULL,*mes;
-
+
mes=script_getstr(st,2);
- if(mes==NULL) return 0;
-
+ if(mes==NULL) return true;
+
if(script_hasdata(st,3)){ // npc name to display
name=script_getstr(st,3);
} else {
name=nd->name; //use current npc name
}
-
+
npc_globalmessage(name,mes); // broadcast to all players connected
-
- return 0;
+
+ return true;
}
/////////////////////////////////////////////////////////////////////
@@ -10383,7 +10148,7 @@ BUILDIN_FUNC(globalmes)
/// Creates a waiting room (chat room) for this npc.
///
/// waitingroom "<title>",<limit>{,"<event>"{,<trigger>{,<zeny>{,<minlvl>{,<maxlvl>}}}}};
-BUILDIN_FUNC(waitingroom)
+BUILDIN(waitingroom)
{
struct npc_data* nd;
int pub = 1;
@@ -10394,19 +10159,19 @@ BUILDIN_FUNC(waitingroom)
int zeny = script_hasdata(st,6) ? script_getnum(st,6) : 0;
int minLvl = script_hasdata(st,7) ? script_getnum(st,7) : 1;
int maxLvl = script_hasdata(st,8) ? script_getnum(st,8) : MAX_LEVEL;
-
+
nd = (struct npc_data *)map_id2bl(st->oid);
if( nd != NULL )
chat_createnpcchat(nd, title, limit, pub, trigger, ev, zeny, minLvl, maxLvl);
-
- return 0;
+
+ return true;
}
/// Removes the waiting room of the current or target npc.
///
/// delwaitingroom "<npc_name>";
/// delwaitingroom;
-BUILDIN_FUNC(delwaitingroom)
+BUILDIN(delwaitingroom)
{
struct npc_data* nd;
if( script_hasdata(st,2) )
@@ -10415,64 +10180,64 @@ BUILDIN_FUNC(delwaitingroom)
nd = (struct npc_data *)map_id2bl(st->oid);
if( nd != NULL )
chat_deletenpcchat(nd);
- return 0;
+ return true;
}
/// Kicks all the players from the waiting room of the current or target npc.
///
/// kickwaitingroomall "<npc_name>";
/// kickwaitingroomall;
-BUILDIN_FUNC(waitingroomkickall)
+BUILDIN(waitingroomkickall)
{
struct npc_data* nd;
struct chat_data* cd;
-
+
if( script_hasdata(st,2) )
nd = npc_name2id(script_getstr(st,2));
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( nd != NULL && (cd=(struct chat_data *)map_id2bl(nd->chat_id)) != NULL )
chat_npckickall(cd);
- return 0;
+ return true;
}
/// Enables the waiting room event of the current or target npc.
///
/// enablewaitingroomevent "<npc_name>";
/// enablewaitingroomevent;
-BUILDIN_FUNC(enablewaitingroomevent)
+BUILDIN(enablewaitingroomevent)
{
struct npc_data* nd;
struct chat_data* cd;
-
+
if( script_hasdata(st,2) )
nd = npc_name2id(script_getstr(st, 2));
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( nd != NULL && (cd=(struct chat_data *)map_id2bl(nd->chat_id)) != NULL )
chat_enableevent(cd);
- return 0;
+ return true;
}
/// Disables the waiting room event of the current or target npc.
///
/// disablewaitingroomevent "<npc_name>";
/// disablewaitingroomevent;
-BUILDIN_FUNC(disablewaitingroomevent)
+BUILDIN(disablewaitingroomevent)
{
struct npc_data *nd;
struct chat_data *cd;
-
+
if( script_hasdata(st,2) )
nd = npc_name2id(script_getstr(st, 2));
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( nd != NULL && (cd=(struct chat_data *)map_id2bl(nd->chat_id)) != NULL )
chat_disableevent(cd);
- return 0;
+ return true;
}
/// Returns info on the waiting room of the current or target npc.
@@ -10489,38 +10254,38 @@ BUILDIN_FUNC(disablewaitingroomevent)
///
/// getwaitingroomstate(<type>,"<npc_name>") -> <info>
/// getwaitingroomstate(<type>) -> <info>
-BUILDIN_FUNC(getwaitingroomstate)
+BUILDIN(getwaitingroomstate)
{
struct npc_data *nd;
struct chat_data *cd;
int type;
-
+
type = script_getnum(st,2);
if( script_hasdata(st,3) )
nd = npc_name2id(script_getstr(st, 3));
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( nd == NULL || (cd=(struct chat_data *)map_id2bl(nd->chat_id)) == NULL )
{
script_pushint(st, -1);
- return 0;
+ return true;
}
-
+
switch(type)
{
- case 0: script_pushint(st, cd->users); break;
- case 1: script_pushint(st, cd->limit); break;
- case 2: script_pushint(st, cd->trigger&0x7f); break;
- case 3: script_pushint(st, ((cd->trigger&0x80)!=0)); break;
- case 4: script_pushstrcopy(st, cd->title); break;
- case 5: script_pushstrcopy(st, cd->pass); break;
- case 16: script_pushstrcopy(st, cd->npc_event);break;
- case 32: script_pushint(st, (cd->users >= cd->limit)); break;
- case 33: script_pushint(st, (cd->users >= cd->trigger)); break;
- default: script_pushint(st, -1); break;
+ case 0: script_pushint(st, cd->users); break;
+ case 1: script_pushint(st, cd->limit); break;
+ case 2: script_pushint(st, cd->trigger&0x7f); break;
+ case 3: script_pushint(st, ((cd->trigger&0x80)!=0)); break;
+ case 4: script_pushstrcopy(st, cd->title); break;
+ case 5: script_pushstrcopy(st, cd->pass); break;
+ case 16: script_pushstrcopy(st, cd->npc_event);break;
+ case 32: script_pushint(st, (cd->users >= cd->limit)); break;
+ case 33: script_pushint(st, (cd->users >= cd->trigger)); break;
+ default: script_pushint(st, -1); break;
}
- return 0;
+ return true;
}
/// Warps the trigger or target amount of players to the target map and position.
@@ -10535,7 +10300,7 @@ BUILDIN_FUNC(getwaitingroomstate)
///
/// warpwaitingpc "<map name>",<x>,<y>,<number of players>;
/// warpwaitingpc "<map name>",<x>,<y>;
-BUILDIN_FUNC(warpwaitingpc)
+BUILDIN(warpwaitingpc)
{
int x;
int y;
@@ -10545,28 +10310,28 @@ BUILDIN_FUNC(warpwaitingpc)
struct npc_data* nd;
struct chat_data* cd;
TBL_PC* sd;
-
+
nd = (struct npc_data *)map_id2bl(st->oid);
if( nd == NULL || (cd=(struct chat_data *)map_id2bl(nd->chat_id)) == NULL )
- return 0;
-
+ return true;
+
map_name = script_getstr(st,2);
x = script_getnum(st,3);
y = script_getnum(st,4);
n = cd->trigger&0x7f;
-
+
if( script_hasdata(st,5) )
n = script_getnum(st,5);
-
+
for( i = 0; i < n && cd->users > 0; i++ )
{
sd = cd->usersd[0];
-
+
if( strcmp(map_name,"SavePoint") == 0 && map[sd->bl.m].flag.noteleport )
{// can't teleport on this map
break;
}
-
+
if( cd->zeny )
{// fee set
if( (uint32)sd->status.zeny < cd->zeny )
@@ -10575,9 +10340,9 @@ BUILDIN_FUNC(warpwaitingpc)
}
pc_payzeny(sd, cd->zeny, LOG_TYPE_NPC, NULL);
}
-
+
mapreg_setreg(reference_uid(add_str("$@warpwaitingpc"), i), sd->bl.id);
-
+
if( strcmp(map_name,"Random") == 0 )
pc_randomwarp(sd,CLR_TELEPORT);
else if( strcmp(map_name,"SavePoint") == 0 )
@@ -10586,7 +10351,7 @@ BUILDIN_FUNC(warpwaitingpc)
pc_setpos(sd, mapindex_name2id(map_name), x, y, CLR_OUTSIGHT);
}
mapreg_setreg(add_str("$@warpwaitingpcnum"), i);
- return 0;
+ return true;
}
/////////////////////////////////////////////////////////////////////
@@ -10608,76 +10373,76 @@ static void script_detach_rid(struct script_state* st)
/*==========================================
* Attach sd char id to script and detach current one if any
*------------------------------------------*/
-BUILDIN_FUNC(attachrid)
+BUILDIN(attachrid)
{
int rid = script_getnum(st,2);
-
+
if (map_id2sd(rid) != NULL) {
script_detach_rid(st);
-
+
st->rid = rid;
script_attach_state(st);
script_pushint(st,1);
} else
script_pushint(st,0);
- return 0;
+ return true;
}
/*==========================================
* Detach script to rid
*------------------------------------------*/
-BUILDIN_FUNC(detachrid)
+BUILDIN(detachrid)
{
script_detach_rid(st);
- return 0;
+ return true;
}
/*==========================================
* Chk if account connected, (and charid from account if specified)
*------------------------------------------*/
-BUILDIN_FUNC(isloggedin)
+BUILDIN(isloggedin)
{
TBL_PC* sd = map_id2sd(script_getnum(st,2));
if (script_hasdata(st,3) && sd &&
sd->status.char_id != script_getnum(st,3))
sd = NULL;
push_val(st->stack,C_INT,sd!=NULL);
- return 0;
+ return true;
}
/*==========================================
*
*------------------------------------------*/
-BUILDIN_FUNC(setmapflagnosave)
+BUILDIN(setmapflagnosave)
{
int16 m,x,y;
unsigned short mapindex;
const char *str,*str2;
-
+
str=script_getstr(st,2);
str2=script_getstr(st,3);
x=script_getnum(st,4);
y=script_getnum(st,5);
m = map_mapname2mapid(str);
mapindex = mapindex_name2id(str2);
-
+
if(m >= 0 && mapindex) {
map[m].flag.nosave=1;
map[m].save.map=mapindex;
map[m].save.x=x;
map[m].save.y=y;
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(getmapflag)
+BUILDIN(getmapflag)
{
int16 m,i;
const char *str;
-
+
str=script_getstr(st,2);
i=script_getnum(st,3);
-
+
m = map_mapname2mapid(str);
if(m >= 0) {
switch(i) {
@@ -10701,7 +10466,6 @@ BUILDIN_FUNC(getmapflag)
case MF_FOG: script_pushint(st,map[m].flag.fog); break;
case MF_SAKURA: script_pushint(st,map[m].flag.sakura); break;
case MF_LEAVES: script_pushint(st,map[m].flag.leaves); break;
- case MF_NOGO: script_pushint(st,map[m].flag.nogo); break;
case MF_CLOUDS: script_pushint(st,map[m].flag.clouds); break;
case MF_CLOUDS2: script_pushint(st,map[m].flag.clouds2); break;
case MF_FIREWORKS: script_pushint(st,map[m].flag.fireworks); break;
@@ -10733,8 +10497,8 @@ BUILDIN_FUNC(getmapflag)
case MF_RESET: script_pushint(st,map[m].flag.reset); break;
}
}
-
- return 0;
+
+ return true;
}
/* pvp timer handling */
static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) {
@@ -10748,15 +10512,16 @@ static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) {
sd->pvp_lost = 0;
}
clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ clif->maptypeproperty2(&sd->bl,SELF);
return 0;
}
-BUILDIN_FUNC(setmapflag)
+BUILDIN(setmapflag)
{
int16 m,i;
const char *str, *val2 = NULL;
struct script_data* data;
int val=0;
-
+
str=script_getstr(st,2);
i = script_getnum(st, 3);
@@ -10770,7 +10535,7 @@ BUILDIN_FUNC(setmapflag)
val2 = script_getstr(st, 4);
else
val = script_getnum(st, 4);
-
+
}
m = map_mapname2mapid(str);
@@ -10790,9 +10555,14 @@ BUILDIN_FUNC(setmapflag)
break;
case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 1; break;
case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 1; break;
- case MF_GVG:
+ case MF_GVG: {
+ struct block_list bl;
map[m].flag.gvg = 1;
clif->map_property_mapall(m, MAPPROPERTY_AGITZONE);
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif->maptypeproperty2(&bl,ALL_SAMEMAP);
+ }
break;
case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 1; break;
case MF_NOTRADE: map[m].flag.notrade = 1; break;
@@ -10804,11 +10574,6 @@ BUILDIN_FUNC(setmapflag)
case MF_FOG: map[m].flag.fog = 1; break;
case MF_SAKURA: map[m].flag.sakura = 1; break;
case MF_LEAVES: map[m].flag.leaves = 1; break;
- /**
- * No longer available, keeping here just in case it's back someday. [Ind]
- **/
- //case MF_RAIN: map[m].flag.rain = 1; break;
- case MF_NOGO: map[m].flag.nogo = 1; break;
case MF_CLOUDS: map[m].flag.clouds = 1; break;
case MF_CLOUDS2: map[m].flag.clouds2 = 1; break;
case MF_FIREWORKS: map[m].flag.fireworks = 1; break;
@@ -10828,7 +10593,7 @@ BUILDIN_FUNC(setmapflag)
char params[MAP_ZONE_MAPFLAG_LENGTH];
memcpy(params, val2, MAP_ZONE_MAPFLAG_LENGTH);
npc_parse_mapflag(map[m].name, empty, zone, params, empty, empty, empty);
- }
+ }
break;
case MF_NOCOMMAND: map[m].nocommand = (val <= 0) ? 100 : val; break;
case MF_NODROP: map[m].flag.nodrop = 1; break;
@@ -10848,16 +10613,16 @@ BUILDIN_FUNC(setmapflag)
case MF_RESET: map[m].flag.reset = 1; break;
}
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(removemapflag)
+BUILDIN(removemapflag)
{
int16 m,i;
const char *str;
int val=0;
-
+
str=script_getstr(st,2);
i=script_getnum(st,3);
if(script_hasdata(st,4)){
@@ -10872,15 +10637,25 @@ BUILDIN_FUNC(removemapflag)
case MF_NOBRANCH: map[m].flag.nobranch = 0; break;
case MF_NOPENALTY: map[m].flag.noexppenalty = 0; map[m].flag.nozenypenalty = 0; break;
case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 0; break;
- case MF_PVP:
+ case MF_PVP: {
+ struct block_list bl;
+ bl.type = BL_NUL;
+ bl.m = m;
map[m].flag.pvp = 0;
clif->map_property_mapall(m, MAPPROPERTY_NOTHING);
+ clif->maptypeproperty2(&bl,ALL_SAMEMAP);
+ }
break;
case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 0; break;
case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 0; break;
- case MF_GVG:
+ case MF_GVG: {
+ struct block_list bl;
+ bl.type = BL_NUL;
+ bl.m = m;
map[m].flag.gvg = 0;
clif->map_property_mapall(m, MAPPROPERTY_NOTHING);
+ clif->maptypeproperty2(&bl,ALL_SAMEMAP);
+ }
break;
case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 0; break;
case MF_NOTRADE: map[m].flag.notrade = 0; break;
@@ -10892,7 +10667,6 @@ BUILDIN_FUNC(removemapflag)
case MF_FOG: map[m].flag.fog = 0; break;
case MF_SAKURA: map[m].flag.sakura = 0; break;
case MF_LEAVES: map[m].flag.leaves = 0; break;
- case MF_NOGO: map[m].flag.nogo = 0; break;
case MF_CLOUDS: map[m].flag.clouds = 0; break;
case MF_CLOUDS2: map[m].flag.clouds2 = 0; break;
case MF_FIREWORKS: map[m].flag.fireworks = 0; break;
@@ -10927,35 +10701,40 @@ BUILDIN_FUNC(removemapflag)
case MF_RESET: map[m].flag.reset = 0; break;
}
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(pvpon)
+BUILDIN(pvpon)
{
int16 m;
const char *str;
TBL_PC* sd = NULL;
struct s_mapiterator* iter;
-
+ struct block_list bl;
+
str = script_getstr(st,2);
m = map_mapname2mapid(str);
if( m < 0 || map[m].flag.pvp )
- return 0; // nothing to do
-
+ return true; // nothing to do
+
map_zone_change2(m, strdb_get(zone_db, MAP_ZONE_PVP_NAME));
map[m].flag.pvp = 1;
clif->map_property_mapall(m, MAPPROPERTY_FREEPVPZONE);
-
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif->maptypeproperty2(&bl,ALL_SAMEMAP);
+
+
if(battle_config.pk_mode) // disable ranking functions if pk_mode is on [Valaris]
- return 0;
-
+ return true;
+
iter = mapit_getallusers();
for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
{
if( sd->bl.m != m || sd->pvp_timer != INVALID_TIMER )
continue; // not applicable
-
+
sd->pvp_timer = add_timer(gettick()+200,pc_calc_pvprank_timer,sd->bl.id,0);
sd->pvp_rank = 0;
sd->pvp_lastusers = 0;
@@ -10964,8 +10743,8 @@ BUILDIN_FUNC(pvpon)
sd->pvp_lost = 0;
}
mapit_free(iter);
-
- return 0;
+
+ return true;
}
static int buildin_pvpoff_sub(struct block_list *bl,va_list ap)
@@ -10979,74 +10758,86 @@ static int buildin_pvpoff_sub(struct block_list *bl,va_list ap)
return 0;
}
-BUILDIN_FUNC(pvpoff)
+BUILDIN(pvpoff)
{
int16 m;
const char *str;
-
+ struct block_list bl;
+
str=script_getstr(st,2);
m = map_mapname2mapid(str);
if(m < 0 || !map[m].flag.pvp)
- return 0; //fixed Lupus
+ return true; //fixed Lupus
map_zone_change2(m, map[m].prev_zone);
map[m].flag.pvp = 0;
clif->map_property_mapall(m, MAPPROPERTY_NOTHING);
-
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif->maptypeproperty2(&bl,ALL_SAMEMAP);
+
if(battle_config.pk_mode) // disable ranking options if pk_mode is on [Valaris]
- return 0;
-
+ return true;
+
map_foreachinmap(buildin_pvpoff_sub, m, BL_PC);
- return 0;
+ return true;
}
-BUILDIN_FUNC(gvgon)
+BUILDIN(gvgon)
{
int16 m;
const char *str;
-
+
str=script_getstr(st,2);
m = map_mapname2mapid(str);
if(m >= 0 && !map[m].flag.gvg) {
+ struct block_list bl;
map_zone_change2(m, strdb_get(zone_db, MAP_ZONE_GVG_NAME));
map[m].flag.gvg = 1;
clif->map_property_mapall(m, MAPPROPERTY_AGITZONE);
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif->maptypeproperty2(&bl,ALL_SAMEMAP);
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(gvgoff)
+BUILDIN(gvgoff)
{
int16 m;
const char *str;
-
+
str=script_getstr(st,2);
m = map_mapname2mapid(str);
if(m >= 0 && map[m].flag.gvg) {
+ struct block_list bl;
map_zone_change2(m, map[m].prev_zone);
map[m].flag.gvg = 0;
clif->map_property_mapall(m, MAPPROPERTY_NOTHING);
+ bl.type = BL_NUL;
+ bl.m = m;
+ clif->maptypeproperty2(&bl,ALL_SAMEMAP);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Shows an emoticon on top of the player/npc
* emotion emotion#, <target: 0 - NPC, 1 - PC>, <NPC/PC name>
*------------------------------------------*/
//Optional second parameter added by [Skotlex]
-BUILDIN_FUNC(emotion)
+BUILDIN(emotion)
{
int type;
int player=0;
-
+
type=script_getnum(st,2);
if(type < 0 || type > 100)
- return 0;
-
+ return true;
+
if( script_hasdata(st,3) )
player=script_getnum(st,3);
-
+
if (player) {
TBL_PC *sd = NULL;
if( script_hasdata(st,4) )
@@ -11064,7 +10855,7 @@ BUILDIN_FUNC(emotion)
}
else
clif->emotion(map_id2bl(st->oid),type);
- return 0;
+ return true;
}
static int buildin_maprespawnguildid_sub_pc(struct map_session_data* sd, va_list ap)
@@ -11072,14 +10863,14 @@ static int buildin_maprespawnguildid_sub_pc(struct map_session_data* sd, va_list
int16 m=va_arg(ap,int);
int g_id=va_arg(ap,int);
int flag=va_arg(ap,int);
-
+
if(!sd || sd->bl.m != m)
return 0;
if(
- (sd->status.guild_id == g_id && flag&1) || //Warp out owners
- (sd->status.guild_id != g_id && flag&2) || //Warp out outsiders
- (sd->status.guild_id == 0) // Warp out players not in guild [Valaris]
- )
+ (sd->status.guild_id == g_id && flag&1) || //Warp out owners
+ (sd->status.guild_id != g_id && flag&2) || //Warp out outsiders
+ (sd->status.guild_id == 0) // Warp out players not in guild [Valaris]
+ )
pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
return 1;
}
@@ -11087,91 +10878,91 @@ static int buildin_maprespawnguildid_sub_pc(struct map_session_data* sd, va_list
static int buildin_maprespawnguildid_sub_mob(struct block_list *bl,va_list ap)
{
struct mob_data *md=(struct mob_data *)bl;
-
+
if(!md->guardian_data && md->class_ != MOBID_EMPERIUM)
status_kill(bl);
-
+
return 0;
}
-BUILDIN_FUNC(maprespawnguildid)
+BUILDIN(maprespawnguildid)
{
const char *mapname=script_getstr(st,2);
int g_id=script_getnum(st,3);
int flag=script_getnum(st,4);
-
+
int16 m=map_mapname2mapid(mapname);
-
+
if(m == -1)
- return 0;
-
+ return true;
+
//Catch ALL players (in case some are 'between maps' on execution time)
map_foreachpc(buildin_maprespawnguildid_sub_pc,m,g_id,flag);
if (flag&4) //Remove script mobs.
map_foreachinmap(buildin_maprespawnguildid_sub_mob,m,BL_MOB);
- return 0;
+ return true;
}
-BUILDIN_FUNC(agitstart)
+BUILDIN(agitstart)
{
- if(agit_flag==1) return 0; // Agit already Start.
+ if(agit_flag==1) return true; // Agit already Start.
agit_flag=1;
guild_agit_start();
- return 0;
+ return true;
}
-BUILDIN_FUNC(agitend)
+BUILDIN(agitend)
{
- if(agit_flag==0) return 0; // Agit already End.
+ if(agit_flag==0) return true; // Agit already End.
agit_flag=0;
guild_agit_end();
- return 0;
+ return true;
}
-BUILDIN_FUNC(agitstart2)
+BUILDIN(agitstart2)
{
- if(agit2_flag==1) return 0; // Agit2 already Start.
+ if(agit2_flag==1) return true; // Agit2 already Start.
agit2_flag=1;
guild_agit2_start();
- return 0;
+ return true;
}
-BUILDIN_FUNC(agitend2)
+BUILDIN(agitend2)
{
- if(agit2_flag==0) return 0; // Agit2 already End.
+ if(agit2_flag==0) return true; // Agit2 already End.
agit2_flag=0;
guild_agit2_end();
- return 0;
+ return true;
}
/*==========================================
* Returns whether woe is on or off. // choice script
*------------------------------------------*/
-BUILDIN_FUNC(agitcheck)
+BUILDIN(agitcheck)
{
script_pushint(st,agit_flag);
- return 0;
+ return true;
}
/*==========================================
* Returns whether woese is on or off. // choice script
*------------------------------------------*/
-BUILDIN_FUNC(agitcheck2)
+BUILDIN(agitcheck2)
{
script_pushint(st,agit2_flag);
- return 0;
+ return true;
}
/// Sets the guild_id of this npc.
///
/// flagemblem <guild_id>;
-BUILDIN_FUNC(flagemblem)
+BUILDIN(flagemblem)
{
TBL_NPC* nd;
int g_id = script_getnum(st,2);
-
- if(g_id < 0) return 0;
-
+
+ if(g_id < 0) return true;
+
nd = (TBL_NPC*)map_id2nd(st->oid);
if( nd == NULL ) {
ShowError("script:flagemblem: npc %d not found\n", st->oid);
@@ -11187,30 +10978,30 @@ BUILDIN_FUNC(flagemblem)
else if( changed ) /* removing a flag */
guild_flag_remove(nd);
}
- return 0;
+ return true;
}
-BUILDIN_FUNC(getcastlename)
+BUILDIN(getcastlename)
{
const char* mapname = mapindex_getmapname(script_getstr(st,2),NULL);
struct guild_castle* gc = guild_mapname2gc(mapname);
const char* name = (gc) ? gc->castle_name : "";
script_pushstrcopy(st,name);
- return 0;
+ return true;
}
-BUILDIN_FUNC(getcastledata)
+BUILDIN(getcastledata)
{
const char *mapname = mapindex_getmapname(script_getstr(st,2),NULL);
int index = script_getnum(st,3);
struct guild_castle *gc = guild_mapname2gc(mapname);
-
+
if (gc == NULL) {
script_pushint(st,0);
ShowWarning("buildin_setcastledata: guild castle for map '%s' not found\n", mapname);
- return 1;
+ return false;
}
-
+
switch (index) {
case 1:
script_pushint(st,gc->guild_id); break;
@@ -11237,101 +11028,101 @@ BUILDIN_FUNC(getcastledata)
}
script_pushint(st,0);
ShowWarning("buildin_setcastledata: index = '%d' is out of allowed range\n", index);
- return 1;
+ return false;
}
- return 0;
+ return true;
}
-BUILDIN_FUNC(setcastledata)
+BUILDIN(setcastledata)
{
const char *mapname = mapindex_getmapname(script_getstr(st,2),NULL);
int index = script_getnum(st,3);
int value = script_getnum(st,4);
struct guild_castle *gc = guild_mapname2gc(mapname);
-
+
if (gc == NULL) {
ShowWarning("buildin_setcastledata: guild castle for map '%s' not found\n", mapname);
- return 1;
+ return false;
}
-
+
if (index <= 0 || index > 9+MAX_GUARDIANS) {
ShowWarning("buildin_setcastledata: index = '%d' is out of allowed range\n", index);
- return 1;
+ return false;
}
-
+
guild_castledatasave(gc->castle_id, index, value);
- return 0;
+ return true;
}
/* =====================================================================
* ---------------------------------------------------------------------*/
-BUILDIN_FUNC(requestguildinfo)
+BUILDIN(requestguildinfo)
{
int guild_id=script_getnum(st,2);
const char *event=NULL;
-
+
if( script_hasdata(st,3) ){
event=script_getstr(st,3);
check_event(st, event);
}
-
+
if(guild_id>0)
guild_npc_request_info(guild_id,event);
- return 0;
+ return true;
}
/// Returns the number of cards that have been compounded onto the specified equipped item.
/// getequipcardcnt(<equipment slot>);
-BUILDIN_FUNC(getequipcardcnt)
+BUILDIN(getequipcardcnt)
{
int i=-1,j,num;
TBL_PC *sd;
int count;
-
+
num=script_getnum(st,2);
sd=script_rid2sd(st);
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
-
+
if (i < 0 || !sd->inventory_data[i]) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
if(itemdb_isspecial(sd->status.inventory[i].card[0]))
{
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
count = 0;
for( j = 0; j < sd->inventory_data[i]->slot; j++ )
if( sd->status.inventory[i].card[j] && itemdb_type(sd->status.inventory[i].card[j]) == IT_CARD )
count++;
-
+
script_pushint(st,count);
- return 0;
+ return true;
}
/// Removes all cards from the item found in the specified equipment slot of the invoking character,
/// and give them to the character. If any cards were removed in this manner, it will also show a success effect.
/// successremovecards <slot>;
-BUILDIN_FUNC(successremovecards) {
+BUILDIN(successremovecards) {
int i=-1,j,c,cardflag=0;
-
+
TBL_PC* sd = script_rid2sd(st);
int num = script_getnum(st,2);
-
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
-
+
if (i < 0 || !sd->inventory_data[i]) {
- return 0;
+ return true;
}
-
+
if(itemdb_isspecial(sd->status.inventory[i].card[0]))
- return 0;
-
+ return true;
+
for( c = sd->inventory_data[i]->slot - 1; c >= 0; --c ) {
if( sd->status.inventory[i].card[c] && itemdb_type(sd->status.inventory[i].card[c]) == IT_CARD ) {// extract this card from the item
int flag;
@@ -11340,37 +11131,37 @@ BUILDIN_FUNC(successremovecards) {
cardflag = 1;
item_tmp.nameid = sd->status.inventory[i].card[c];
item_tmp.identify = 1;
-
+
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ // get back the cart in inventory
clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
}
-
+
if(cardflag == 1) {//if card was remove remplace item with no card
int flag;
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
-
+
item_tmp.nameid = sd->status.inventory[i].nameid;
item_tmp.identify = 1;
item_tmp.refine = sd->status.inventory[i].refine;
item_tmp.attribute = sd->status.inventory[i].attribute;
item_tmp.expire_time = sd->status.inventory[i].expire_time;
-
+
for (j = sd->inventory_data[i]->slot; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->status.inventory[i].card[j];
-
+
pc_delitem(sd,i,1,0,3,LOG_TYPE_SCRIPT);
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ //chk if can be spawn in inventory otherwise put on floor
clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
-
+
clif->misceffect(&sd->bl,3);
}
- return 0;
+ return true;
}
/// Removes all cards from the item found in the specified equipment slot of the invoking character.
@@ -11379,35 +11170,35 @@ BUILDIN_FUNC(successremovecards) {
/// <type>=1 : will keep the item, but destroy the cards.
/// <type>=2 : will keep the cards, but destroy the item.
/// <type>=? : will just display the failure effect.
-BUILDIN_FUNC(failedremovecards) {
+BUILDIN(failedremovecards) {
int i=-1,j,c,cardflag=0;
-
+
TBL_PC* sd = script_rid2sd(st);
int num = script_getnum(st,2);
int typefail = script_getnum(st,3);
-
+
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
-
+
if (i < 0 || !sd->inventory_data[i])
- return 0;
-
+ return true;
+
if(itemdb_isspecial(sd->status.inventory[i].card[0]))
- return 0;
-
+ return true;
+
for( c = sd->inventory_data[i]->slot - 1; c >= 0; --c ) {
if( sd->status.inventory[i].card[c] && itemdb_type(sd->status.inventory[i].card[c]) == IT_CARD ) {
cardflag = 1;
-
+
if(typefail == 2) {// add cards to inventory, clear
int flag;
struct item item_tmp;
-
+
memset(&item_tmp,0,sizeof(item_tmp));
-
+
item_tmp.nameid = sd->status.inventory[i].card[c];
item_tmp.identify = 1;
-
+
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
@@ -11415,7 +11206,7 @@ BUILDIN_FUNC(failedremovecards) {
}
}
}
-
+
if(cardflag == 1) {
if(typefail == 0 || typefail == 2){ // destroy the item
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
@@ -11423,20 +11214,20 @@ BUILDIN_FUNC(failedremovecards) {
if(typefail == 1){ // destroy the card
int flag;
struct item item_tmp;
-
+
memset(&item_tmp,0,sizeof(item_tmp));
-
+
item_tmp.nameid = sd->status.inventory[i].nameid;
item_tmp.identify = 1;
item_tmp.refine = sd->status.inventory[i].refine;
item_tmp.attribute = sd->status.inventory[i].attribute;
item_tmp.expire_time = sd->status.inventory[i].expire_time;
-
+
for (j = sd->inventory_data[i]->slot; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->status.inventory[i].card[j];
-
+
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
-
+
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
@@ -11444,8 +11235,8 @@ BUILDIN_FUNC(failedremovecards) {
}
clif->misceffect(&sd->bl,2);
}
-
- return 0;
+
+ return true;
}
/* ================================================================
@@ -11453,7 +11244,7 @@ BUILDIN_FUNC(failedremovecards) {
* type: 0=everyone, 1=guild, 2=party; [Reddozen]
* improved by [Lance]
* ================================================================*/
-BUILDIN_FUNC(mapwarp) // Added by RoVeRT
+BUILDIN(mapwarp) // Added by RoVeRT
{
int x,y,m,check_val=0,check_ID=0,i=0;
struct guild *g = NULL;
@@ -11469,13 +11260,13 @@ BUILDIN_FUNC(mapwarp) // Added by RoVeRT
check_val=script_getnum(st,6);
check_ID=script_getnum(st,7);
}
-
+
if((m=map_mapname2mapid(mapname))< 0)
- return 0;
-
+ return true;
+
if(!(index=mapindex_name2id(str)))
- return 0;
-
+ return true;
+
switch(check_val){
case 1:
g = guild_search(check_ID);
@@ -11502,8 +11293,8 @@ BUILDIN_FUNC(mapwarp) // Added by RoVeRT
map_foreachinmap(buildin_areawarp_sub,m,BL_PC,index,x,y,0,0);
break;
}
-
- return 0;
+
+ return true;
}
static int buildin_mobcount_sub(struct block_list *bl,va_list ap) // Added by RoVeRT
@@ -11515,218 +11306,218 @@ static int buildin_mobcount_sub(struct block_list *bl,va_list ap) // Added by Ro
return 0;
}
-BUILDIN_FUNC(mobcount) // Added by RoVeRT
+BUILDIN(mobcount) // Added by RoVeRT
{
const char *mapname,*event;
int16 m;
mapname=script_getstr(st,2);
event=script_getstr(st,3);
-
+
if( strcmp(event, "all") == 0 )
event = NULL;
else
check_event(st, event);
-
+
if( strcmp(mapname, "this") == 0 ) {
struct map_session_data *sd = script_rid2sd(st);
if( sd )
m = sd->bl.m;
else {
script_pushint(st,-1);
- return 0;
+ return true;
}
}
else if( (m = map_mapname2mapid(mapname)) < 0 ) {
script_pushint(st,-1);
- return 0;
+ return true;
}
-
+
if( map[m].flag.src4instance && map[m].instance_id == 0 && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
{
script_pushint(st,-1);
- return 0;
+ return true;
}
-
+
script_pushint(st,map_foreachinmap(buildin_mobcount_sub, m, BL_MOB, event));
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(marriage)
+BUILDIN(marriage)
{
const char *partner=script_getstr(st,2);
TBL_PC *sd=script_rid2sd(st);
TBL_PC *p_sd=map_nick2sd(partner);
-
+
if(sd==NULL || p_sd==NULL || pc_marriage(sd,p_sd) < 0){
script_pushint(st,0);
- return 0;
+ return true;
}
script_pushint(st,1);
- return 0;
+ return true;
}
-BUILDIN_FUNC(wedding_effect)
+BUILDIN(wedding_effect)
{
TBL_PC *sd=script_rid2sd(st);
struct block_list *bl;
-
+
if(sd==NULL) {
bl=map_id2bl(st->oid);
} else
bl=&sd->bl;
clif->wedding_effect(bl);
- return 0;
+ return true;
}
-BUILDIN_FUNC(divorce)
+BUILDIN(divorce)
{
TBL_PC *sd=script_rid2sd(st);
if(sd==NULL || pc_divorce(sd) < 0){
script_pushint(st,0);
- return 0;
+ return true;
}
script_pushint(st,1);
- return 0;
+ return true;
}
-BUILDIN_FUNC(ispartneron)
+BUILDIN(ispartneron)
{
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd==NULL || !pc_ismarried(sd) ||
- map_charid2sd(sd->status.partner_id) == NULL) {
+ map_charid2sd(sd->status.partner_id) == NULL) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
script_pushint(st,1);
- return 0;
+ return true;
}
-BUILDIN_FUNC(getpartnerid)
+BUILDIN(getpartnerid)
{
TBL_PC *sd=script_rid2sd(st);
if (sd == NULL) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
script_pushint(st,sd->status.partner_id);
- return 0;
+ return true;
}
-BUILDIN_FUNC(getchildid)
+BUILDIN(getchildid)
{
TBL_PC *sd=script_rid2sd(st);
if (sd == NULL) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
script_pushint(st,sd->status.child);
- return 0;
+ return true;
}
-BUILDIN_FUNC(getmotherid)
+BUILDIN(getmotherid)
{
TBL_PC *sd=script_rid2sd(st);
if (sd == NULL) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
script_pushint(st,sd->status.mother);
- return 0;
+ return true;
}
-BUILDIN_FUNC(getfatherid)
+BUILDIN(getfatherid)
{
TBL_PC *sd=script_rid2sd(st);
if (sd == NULL) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
script_pushint(st,sd->status.father);
- return 0;
+ return true;
}
-BUILDIN_FUNC(warppartner)
+BUILDIN(warppartner)
{
int x,y;
unsigned short mapindex;
const char *str;
TBL_PC *sd=script_rid2sd(st);
TBL_PC *p_sd=NULL;
-
+
if(sd==NULL || !pc_ismarried(sd) ||
- (p_sd=map_charid2sd(sd->status.partner_id)) == NULL) {
+ (p_sd=map_charid2sd(sd->status.partner_id)) == NULL) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
str=script_getstr(st,2);
x=script_getnum(st,3);
y=script_getnum(st,4);
-
+
mapindex = mapindex_name2id(str);
if (mapindex) {
pc_setpos(p_sd,mapindex,x,y,CLR_OUTSIGHT);
script_pushint(st,1);
} else
script_pushint(st,0);
- return 0;
+ return true;
}
/*================================================
* Script for Displaying MOB Information [Valaris]
*------------------------------------------------*/
-BUILDIN_FUNC(strmobinfo)
+BUILDIN(strmobinfo)
{
-
+
int num=script_getnum(st,2);
int class_=script_getnum(st,3);
-
+
if(!mobdb_checkid(class_))
{
if (num < 3) //requested a string
script_pushconststr(st,"");
else
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
switch (num) {
- case 1: script_pushstrcopy(st,mob_db(class_)->name); break;
- case 2: script_pushstrcopy(st,mob_db(class_)->jname); break;
- case 3: script_pushint(st,mob_db(class_)->lv); break;
- case 4: script_pushint(st,mob_db(class_)->status.max_hp); break;
- case 5: script_pushint(st,mob_db(class_)->status.max_sp); break;
- case 6: script_pushint(st,mob_db(class_)->base_exp); break;
- case 7: script_pushint(st,mob_db(class_)->job_exp); break;
- default:
- script_pushint(st,0);
- break;
+ case 1: script_pushstrcopy(st,mob_db(class_)->name); break;
+ case 2: script_pushstrcopy(st,mob_db(class_)->jname); break;
+ case 3: script_pushint(st,mob_db(class_)->lv); break;
+ case 4: script_pushint(st,mob_db(class_)->status.max_hp); break;
+ case 5: script_pushint(st,mob_db(class_)->status.max_sp); break;
+ case 6: script_pushint(st,mob_db(class_)->base_exp); break;
+ case 7: script_pushint(st,mob_db(class_)->job_exp); break;
+ default:
+ script_pushint(st,0);
+ break;
}
- return 0;
+ return true;
}
/*==========================================
* Summon guardians [Valaris]
* guardian("<map name>",<x>,<y>,"<name to show>",<mob id>{,"<event label>"}{,<guardian index>}) -> <id>
*------------------------------------------*/
-BUILDIN_FUNC(guardian)
+BUILDIN(guardian)
{
int class_=0,x=0,y=0,guardian=0;
const char *str,*map,*evt="";
struct script_data *data;
bool has_index = false;
-
+
map =script_getstr(st,2);
x =script_getnum(st,3);
y =script_getnum(st,4);
str =script_getstr(st,5);
class_=script_getnum(st,6);
-
+
if( script_hasdata(st,8) )
{// "<event label>",<guardian index>
evt=script_getstr(st,7);
@@ -11745,24 +11536,24 @@ BUILDIN_FUNC(guardian)
} else {
ShowError("script:guardian: invalid data type for argument #6 (from 1)\n");
script_reportdata(data);
- return 1;
+ return false;
}
}
-
+
check_event(st, evt);
script_pushint(st, mob_spawn_guardian(map,x,y,str,class_,evt,guardian,has_index));
-
- return 0;
+
+ return true;
}
/*==========================================
* Invisible Walls [Zephyrus]
*------------------------------------------*/
-BUILDIN_FUNC(setwall)
+BUILDIN(setwall)
{
const char *map, *name;
int x, y, m, size, dir;
bool shootable;
-
+
map = script_getstr(st,2);
x = script_getnum(st,3);
y = script_getnum(st,4);
@@ -11770,19 +11561,19 @@ BUILDIN_FUNC(setwall)
dir = script_getnum(st,6);
shootable = script_getnum(st,7);
name = script_getstr(st,8);
-
+
if( (m = map_mapname2mapid(map)) < 0 )
- return 0; // Invalid Map
-
+ return true; // Invalid Map
+
map_iwall_set(m, x, y, size, dir, shootable, name);
- return 0;
+ return true;
}
-BUILDIN_FUNC(delwall)
+BUILDIN(delwall)
{
const char *name = script_getstr(st,2);
map_iwall_remove(name);
-
- return 0;
+
+ return true;
}
/// Retrieves various information about the specified guardian.
@@ -11792,53 +11583,53 @@ BUILDIN_FUNC(delwall)
/// 1 - maximum hp
/// 2 - current hp
///
-BUILDIN_FUNC(guardianinfo)
+BUILDIN(guardianinfo)
{
const char* mapname = mapindex_getmapname(script_getstr(st,2),NULL);
int id = script_getnum(st,3);
int type = script_getnum(st,4);
-
+
struct guild_castle* gc = guild_mapname2gc(mapname);
struct mob_data* gd;
-
+
if( gc == NULL || id < 0 || id >= MAX_GUARDIANS )
{
script_pushint(st,-1);
- return 0;
+ return true;
}
-
+
if( type == 0 )
script_pushint(st, gc->guardian[id].visible);
else
- if( !gc->guardian[id].visible )
- script_pushint(st,-1);
- else
- if( (gd = map_id2md(gc->guardian[id].id)) == NULL )
- script_pushint(st,-1);
- else
- {
- if ( type == 1 ) script_pushint(st,gd->status.max_hp);
- else if( type == 2 ) script_pushint(st,gd->status.hp);
- else
+ if( !gc->guardian[id].visible )
script_pushint(st,-1);
- }
-
- return 0;
+ else
+ if( (gd = map_id2md(gc->guardian[id].id)) == NULL )
+ script_pushint(st,-1);
+ else
+ {
+ if ( type == 1 ) script_pushint(st,gd->status.max_hp);
+ else if( type == 2 ) script_pushint(st,gd->status.hp);
+ else
+ script_pushint(st,-1);
+ }
+
+ return true;
}
/*==========================================
* Get the item name by item_id or null
*------------------------------------------*/
-BUILDIN_FUNC(getitemname)
+BUILDIN(getitemname)
{
int item_id=0;
struct item_data *i_data;
char *item_name;
struct script_data *data;
-
+
data=script_getdata(st,2);
get_val(st,data);
-
+
if( data_isstring(data) ){
const char *name=conv_str(st,data);
struct item_data *item_data = itemdb_searchname(name);
@@ -11846,36 +11637,36 @@ BUILDIN_FUNC(getitemname)
item_id=item_data->nameid;
}else
item_id=conv_num(st,data);
-
+
i_data = itemdb_exists(item_id);
if (i_data == NULL)
{
script_pushconststr(st,"null");
- return 0;
+ return true;
}
item_name=(char *)aMalloc(ITEM_NAME_LENGTH*sizeof(char));
-
+
memcpy(item_name, i_data->jname, ITEM_NAME_LENGTH);
script_pushstr(st,item_name);
- return 0;
+ return true;
}
/*==========================================
* Returns number of slots an item has. [Skotlex]
*------------------------------------------*/
-BUILDIN_FUNC(getitemslots)
+BUILDIN(getitemslots)
{
int item_id;
struct item_data *i_data;
-
+
item_id=script_getnum(st,2);
-
+
i_data = itemdb_exists(item_id);
-
+
if (i_data)
script_pushint(st,i_data->slot);
else
script_pushint(st,-1);
- return 0;
+ return true;
}
// TODO: add matk here if needed/once we get rid of RENEWAL
@@ -11883,103 +11674,103 @@ BUILDIN_FUNC(getitemslots)
/*==========================================
* Returns some values of an item [Lupus]
* Price, Weight, etc...
- getiteminfo(itemID,n), where n
- 0 value_buy;
- 1 value_sell;
- 2 type;
- 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 = -1, then this item is sold in NPC shops only
- 4 sex;
- 5 equip;
- 6 weight;
- 7 atk;
- 8 def;
- 9 range;
- 10 slot;
- 11 look;
- 12 elv;
- 13 wlv;
- 14 view id
+ getiteminfo(itemID,n), where n
+ 0 value_buy;
+ 1 value_sell;
+ 2 type;
+ 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 = -1, then this item is sold in NPC shops only
+ 4 sex;
+ 5 equip;
+ 6 weight;
+ 7 atk;
+ 8 def;
+ 9 range;
+ 10 slot;
+ 11 look;
+ 12 elv;
+ 13 wlv;
+ 14 view id
*------------------------------------------*/
-BUILDIN_FUNC(getiteminfo)
+BUILDIN(getiteminfo)
{
int item_id,n;
int *item_arr;
struct item_data *i_data;
-
+
item_id = script_getnum(st,2);
n = script_getnum(st,3);
i_data = itemdb_exists(item_id);
-
+
if (i_data && n>=0 && n<=14) {
item_arr = (int*)&i_data->value_buy;
script_pushint(st,item_arr[n]);
} else
script_pushint(st,-1);
- return 0;
+ return true;
}
/*==========================================
* Set some values of an item [Lupus]
* Price, Weight, etc...
- setiteminfo(itemID,n,Value), where n
- 0 value_buy;
- 1 value_sell;
- 2 type;
- 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 = -1, then this item is sold in NPC shops only
- 4 sex;
- 5 equip;
- 6 weight;
- 7 atk;
- 8 def;
- 9 range;
- 10 slot;
- 11 look;
- 12 elv;
- 13 wlv;
- 14 view id
- * Returns Value or -1 if the wrong field's been set
+ setiteminfo(itemID,n,Value), where n
+ 0 value_buy;
+ 1 value_sell;
+ 2 type;
+ 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 = -1, then this item is sold in NPC shops only
+ 4 sex;
+ 5 equip;
+ 6 weight;
+ 7 atk;
+ 8 def;
+ 9 range;
+ 10 slot;
+ 11 look;
+ 12 elv;
+ 13 wlv;
+ 14 view id
+ * Returns Value or -1 if the wrong field's been set
*------------------------------------------*/
-BUILDIN_FUNC(setiteminfo)
+BUILDIN(setiteminfo)
{
int item_id,n,value;
int *item_arr;
struct item_data *i_data;
-
+
item_id = script_getnum(st,2);
n = script_getnum(st,3);
value = script_getnum(st,4);
i_data = itemdb_exists(item_id);
-
+
if (i_data && n>=0 && n<=14) {
item_arr = (int*)&i_data->value_buy;
item_arr[n] = value;
script_pushint(st,value);
} else
script_pushint(st,-1);
- return 0;
+ return true;
}
/*==========================================
* Returns value from equipped item slot n [Lupus]
- getequipcardid(num,slot)
- where
- num = eqip position slot
- slot = 0,1,2,3 (Card Slot N)
-
- This func returns CARD ID, 255,254,-255 (for card 0, if the item is produced)
- it's useful when you want to check item cards or if it's signed
- Useful for such quests as "Sign this refined item with players name" etc
- Hat[0] +4 -> Player's Hat[0] +4
+ getequipcardid(num,slot)
+ where
+ num = eqip position slot
+ slot = 0,1,2,3 (Card Slot N)
+
+ This func returns CARD ID, 255,254,-255 (for card 0, if the item is produced)
+ it's useful when you want to check item cards or if it's signed
+ Useful for such quests as "Sign this refined item with players name" etc
+ Hat[0] +4 -> Player's Hat[0] +4
*------------------------------------------*/
-BUILDIN_FUNC(getequipcardid)
+BUILDIN(getequipcardid)
{
int i=-1,num,slot;
TBL_PC *sd;
-
+
num=script_getnum(st,2);
slot=script_getnum(st,3);
sd=script_rid2sd(st);
@@ -11989,22 +11780,22 @@ BUILDIN_FUNC(getequipcardid)
script_pushint(st,sd->status.inventory[i].card[slot]);
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
* petskillbonus [Valaris] //Rewritten by [Skotlex]
*------------------------------------------*/
-BUILDIN_FUNC(petskillbonus)
+BUILDIN(petskillbonus)
{
struct pet_data *pd;
-
+
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd==NULL || sd->pd==NULL)
- return 0;
-
+ return true;
+
pd=sd->pd;
if (pd->bonus)
{ //Clear previous bonus
@@ -12012,43 +11803,43 @@ BUILDIN_FUNC(petskillbonus)
delete_timer(pd->bonus->timer, pet_skill_bonus_timer);
} else //init
pd->bonus = (struct pet_bonus *) aMalloc(sizeof(struct pet_bonus));
-
+
pd->bonus->type=script_getnum(st,2);
pd->bonus->val=script_getnum(st,3);
pd->bonus->duration=script_getnum(st,4);
pd->bonus->delay=script_getnum(st,5);
-
+
if (pd->state.skillbonus == 1)
pd->state.skillbonus=0; // waiting state
-
+
// wait for timer to start
if (battle_config.pet_equip_required && pd->pet.equip == 0)
pd->bonus->timer = INVALID_TIMER;
else
pd->bonus->timer = add_timer(gettick()+pd->bonus->delay*1000, pet_skill_bonus_timer, sd->bl.id, 0);
-
- return 0;
+
+ return true;
}
/*==========================================
* pet looting [Valaris] //Rewritten by [Skotlex]
*------------------------------------------*/
-BUILDIN_FUNC(petloot)
+BUILDIN(petloot)
{
int max;
struct pet_data *pd;
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd==NULL || sd->pd==NULL)
- return 0;
-
+ return true;
+
max=script_getnum(st,2);
-
+
if(max < 1)
max = 1; //Let'em loot at least 1 item.
else if (max > MAX_PETLOOT_SIZE)
max = MAX_PETLOOT_SIZE;
-
+
pd = sd->pd;
if (pd->loot != NULL)
{ //Release whatever was there already and reallocate memory
@@ -12057,14 +11848,14 @@ BUILDIN_FUNC(petloot)
}
else
pd->loot = (struct pet_loot *)aMalloc(sizeof(struct pet_loot));
-
+
pd->loot->item = (struct item *)aCalloc(max,sizeof(struct item));
-
+
pd->loot->max=max;
pd->loot->count = 0;
pd->loot->weight = 0;
-
- return 0;
+
+ return true;
}
/*==========================================
* Set arrays with info of all sd inventory :
@@ -12073,13 +11864,13 @@ BUILDIN_FUNC(petloot)
* @inventorylist_card(0..3), @inventorylist_expire
* @inventorylist_count = scalar
*------------------------------------------*/
-BUILDIN_FUNC(getinventorylist)
+BUILDIN(getinventorylist)
{
TBL_PC *sd=script_rid2sd(st);
char card_var[NAME_LENGTH];
-
+
int i,j=0,k;
- if(!sd) return 0;
+ if(!sd) return true;
for(i=0;i<MAX_INVENTORY;i++){
if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].amount > 0){
pc_setreg(sd,reference_uid(add_str("@inventorylist_id"), j),sd->status.inventory[i].nameid);
@@ -12098,14 +11889,14 @@ BUILDIN_FUNC(getinventorylist)
}
}
pc_setreg(sd,add_str("@inventorylist_count"),j);
- return 0;
+ return true;
}
-BUILDIN_FUNC(getskilllist)
+BUILDIN(getskilllist)
{
TBL_PC *sd=script_rid2sd(st);
int i,j=0;
- if(!sd) return 0;
+ if(!sd) return true;
for(i=0;i<MAX_SKILL;i++){
if(sd->status.skill[i].id > 0 && sd->status.skill[i].lv > 0){
pc_setreg(sd,reference_uid(add_str("@skilllist_id"), j),sd->status.skill[i].id);
@@ -12115,83 +11906,83 @@ BUILDIN_FUNC(getskilllist)
}
}
pc_setreg(sd,add_str("@skilllist_count"),j);
- return 0;
+ return true;
}
-BUILDIN_FUNC(clearitem)
+BUILDIN(clearitem)
{
TBL_PC *sd=script_rid2sd(st);
int i;
- if(sd==NULL) return 0;
+ if(sd==NULL) return true;
for (i=0; i<MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) {
pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_SCRIPT);
}
}
- return 0;
+ return true;
}
/*==========================================
* Disguise Player (returns Mob/NPC ID if success, 0 on fail)
*------------------------------------------*/
-BUILDIN_FUNC(disguise)
+BUILDIN(disguise)
{
int id;
TBL_PC* sd = script_rid2sd(st);
- if (sd == NULL) return 0;
-
+ if (sd == NULL) return true;
+
id = script_getnum(st,2);
-
+
if (mobdb_checkid(id) || npcdb_checkid(id)) {
pc_disguise(sd, id);
script_pushint(st,id);
} else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/*==========================================
* Undisguise Player (returns 1 if success, 0 on fail)
*------------------------------------------*/
-BUILDIN_FUNC(undisguise)
+BUILDIN(undisguise)
{
TBL_PC* sd = script_rid2sd(st);
- if (sd == NULL) return 0;
-
+ if (sd == NULL) return true;
+
if (sd->disguise) {
pc_disguise(sd, 0);
script_pushint(st,0);
} else {
script_pushint(st,1);
}
- return 0;
+ return true;
}
/*==========================================
* Transform a bl to another _class,
* @type unused
*------------------------------------------*/
-BUILDIN_FUNC(classchange)
+BUILDIN(classchange)
{
int _class,type;
struct block_list *bl=map_id2bl(st->oid);
-
- if(bl==NULL) return 0;
-
+
+ if(bl==NULL) return true;
+
_class=script_getnum(st,2);
type=script_getnum(st,3);
clif->class_change(bl,_class,type);
- return 0;
+ return true;
}
/*==========================================
* Display an effect
*------------------------------------------*/
-BUILDIN_FUNC(misceffect)
+BUILDIN(misceffect)
{
int type;
-
+
type=script_getnum(st,2);
if(st->oid && st->oid != fake_nd->bl.id) {
struct block_list *bl = map_id2bl(st->oid);
@@ -12202,39 +11993,39 @@ BUILDIN_FUNC(misceffect)
if(sd)
clif->specialeffect(&sd->bl,type,AREA);
}
- return 0;
+ return true;
}
/*==========================================
* Play a BGM on a single client [Rikter/Yommy]
*------------------------------------------*/
-BUILDIN_FUNC(playBGM)
+BUILDIN(playBGM)
{
const char* name;
struct map_session_data* sd;
-
+
if( ( sd = script_rid2sd(st) ) != NULL )
{
name = script_getstr(st,2);
-
+
clif->playBGM(sd, name);
}
-
- return 0;
+
+ return true;
}
static int playBGM_sub(struct block_list* bl,va_list ap)
{
const char* name = va_arg(ap,const char*);
-
+
clif->playBGM(BL_CAST(BL_PC, bl), name);
-
+
return 0;
}
static int playBGM_foreachpc_sub(struct map_session_data* sd, va_list args)
{
const char* name = va_arg(args, const char*);
-
+
clif->playBGM(sd, name);
return 0;
}
@@ -12242,12 +12033,12 @@ static int playBGM_foreachpc_sub(struct map_session_data* sd, va_list args)
/*==========================================
* Play a BGM on multiple client [Rikter/Yommy]
*------------------------------------------*/
-BUILDIN_FUNC(playBGMall)
+BUILDIN(playBGMall)
{
const char* name;
-
+
name = script_getstr(st,2);
-
+
if( script_hasdata(st,7) )
{// specified part of map
const char* map = script_getstr(st,3);
@@ -12255,133 +12046,133 @@ BUILDIN_FUNC(playBGMall)
int y0 = script_getnum(st,5);
int x1 = script_getnum(st,6);
int y1 = script_getnum(st,7);
-
+
map_foreachinarea(playBGM_sub, map_mapname2mapid(map), x0, y0, x1, y1, BL_PC, name);
}
else if( script_hasdata(st,3) )
{// entire map
const char* map = script_getstr(st,3);
-
+
map_foreachinmap(playBGM_sub, map_mapname2mapid(map), BL_PC, name);
}
else
{// entire server
map_foreachpc(&playBGM_foreachpc_sub, name);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Play a .wav sound for sd
*------------------------------------------*/
-BUILDIN_FUNC(soundeffect)
+BUILDIN(soundeffect)
{
TBL_PC* sd = script_rid2sd(st);
const char* name = script_getstr(st,2);
int type = script_getnum(st,3);
-
+
if(sd)
{
clif->soundeffect(sd,&sd->bl,name,type);
}
- return 0;
+ return true;
}
int soundeffect_sub(struct block_list* bl,va_list ap)
{
char* name = va_arg(ap,char*);
int type = va_arg(ap,int);
-
+
clif->soundeffect((TBL_PC *)bl, bl, name, type);
-
- return 0;
+
+ return true;
}
/*==========================================
* Play a sound effect (.wav) on multiple clients
* soundeffectall "<filepath>",<type>{,"<map name>"}{,<x0>,<y0>,<x1>,<y1>};
*------------------------------------------*/
-BUILDIN_FUNC(soundeffectall)
+BUILDIN(soundeffectall)
{
struct block_list* bl;
const char* name;
int type;
-
+
bl = (st->rid) ? &(script_rid2sd(st)->bl) : map_id2bl(st->oid);
if (!bl)
- return 0;
-
+ return true;
+
name = script_getstr(st,2);
type = script_getnum(st,3);
-
+
//FIXME: enumerating map squares (map_foreach) is slower than enumerating the list of online players (map_foreachpc?) [ultramage]
-
+
if(!script_hasdata(st,4))
{ // area around
clif->soundeffectall(bl, name, type, AREA);
}
else
- if(!script_hasdata(st,5))
- { // entire map
- const char* map = script_getstr(st,4);
- map_foreachinmap(soundeffect_sub, map_mapname2mapid(map), BL_PC, name, type);
- }
- else
- if(script_hasdata(st,8))
- { // specified part of map
- const char* map = script_getstr(st,4);
- int x0 = script_getnum(st,5);
- int y0 = script_getnum(st,6);
- int x1 = script_getnum(st,7);
- int y1 = script_getnum(st,8);
- map_foreachinarea(soundeffect_sub, map_mapname2mapid(map), x0, y0, x1, y1, BL_PC, name, type);
- }
- else
- {
- ShowError("buildin_soundeffectall: insufficient arguments for specific area broadcast.\n");
- }
-
- return 0;
+ if(!script_hasdata(st,5))
+ { // entire map
+ const char* map = script_getstr(st,4);
+ map_foreachinmap(soundeffect_sub, map_mapname2mapid(map), BL_PC, name, type);
+ }
+ else
+ if(script_hasdata(st,8))
+ { // specified part of map
+ const char* map = script_getstr(st,4);
+ int x0 = script_getnum(st,5);
+ int y0 = script_getnum(st,6);
+ int x1 = script_getnum(st,7);
+ int y1 = script_getnum(st,8);
+ map_foreachinarea(soundeffect_sub, map_mapname2mapid(map), x0, y0, x1, y1, BL_PC, name, type);
+ }
+ else
+ {
+ ShowError("buildin_soundeffectall: insufficient arguments for specific area broadcast.\n");
+ }
+
+ return true;
}
/*==========================================
* pet status recovery [Valaris] / Rewritten by [Skotlex]
*------------------------------------------*/
-BUILDIN_FUNC(petrecovery)
+BUILDIN(petrecovery)
{
struct pet_data *pd;
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd==NULL || sd->pd==NULL)
- return 0;
-
+ return true;
+
pd=sd->pd;
-
+
if (pd->recovery)
{ //Halt previous bonus
if (pd->recovery->timer != INVALID_TIMER)
delete_timer(pd->recovery->timer, pet_recovery_timer);
} else //Init
pd->recovery = (struct pet_recovery *)aMalloc(sizeof(struct pet_recovery));
-
+
pd->recovery->type = (sc_type)script_getnum(st,2);
pd->recovery->delay = script_getnum(st,3);
pd->recovery->timer = INVALID_TIMER;
-
- return 0;
+
+ return true;
}
/*==========================================
* pet healing [Valaris] //Rewritten by [Skotlex]
*------------------------------------------*/
-BUILDIN_FUNC(petheal)
+BUILDIN(petheal)
{
struct pet_data *pd;
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd==NULL || sd->pd==NULL)
- return 0;
-
+ return true;
+
pd=sd->pd;
if (pd->s_skill)
{ //Clear previous skill
@@ -12394,21 +12185,21 @@ BUILDIN_FUNC(petheal)
}
} else //init memory
pd->s_skill = (struct pet_skill_support *) aMalloc(sizeof(struct pet_skill_support));
-
+
pd->s_skill->id=0; //This id identifies that it IS petheal rather than pet_skillsupport
//Use the lv as the amount to heal
pd->s_skill->lv=script_getnum(st,2);
pd->s_skill->delay=script_getnum(st,3);
pd->s_skill->hp=script_getnum(st,4);
pd->s_skill->sp=script_getnum(st,5);
-
+
//Use delay as initial offset to avoid skill/heal exploits
if (battle_config.pet_equip_required && pd->pet.equip == 0)
pd->s_skill->timer = INVALID_TIMER;
else
pd->s_skill->timer = add_timer(gettick()+pd->s_skill->delay*1000,pet_heal_timer,sd->bl.id,0);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -12416,25 +12207,25 @@ BUILDIN_FUNC(petheal)
*------------------------------------------*/
/// petskillattack <skill id>,<level>,<rate>,<bonusrate>
/// petskillattack "<skill name>",<level>,<rate>,<bonusrate>
-BUILDIN_FUNC(petskillattack)
+BUILDIN(petskillattack)
{
struct pet_data *pd;
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd==NULL || sd->pd==NULL)
- return 0;
-
+ return true;
+
pd=sd->pd;
if (pd->a_skill == NULL)
pd->a_skill = (struct pet_skill_attack *)aMalloc(sizeof(struct pet_skill_attack));
-
+
pd->a_skill->id=( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
pd->a_skill->lv=script_getnum(st,3);
pd->a_skill->div_ = 0;
pd->a_skill->rate=script_getnum(st,4);
pd->a_skill->bonusrate=script_getnum(st,5);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -12442,25 +12233,25 @@ BUILDIN_FUNC(petskillattack)
*------------------------------------------*/
/// petskillattack2 <skill id>,<level>,<div>,<rate>,<bonusrate>
/// petskillattack2 "<skill name>",<level>,<div>,<rate>,<bonusrate>
-BUILDIN_FUNC(petskillattack2)
+BUILDIN(petskillattack2)
{
struct pet_data *pd;
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd==NULL || sd->pd==NULL)
- return 0;
-
+ return true;
+
pd=sd->pd;
if (pd->a_skill == NULL)
pd->a_skill = (struct pet_skill_attack *)aMalloc(sizeof(struct pet_skill_attack));
-
+
pd->a_skill->id=( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
pd->a_skill->lv=script_getnum(st,3);
pd->a_skill->div_ = script_getnum(st,4);
pd->a_skill->rate=script_getnum(st,5);
pd->a_skill->bonusrate=script_getnum(st,6);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -12468,14 +12259,14 @@ BUILDIN_FUNC(petskillattack2)
*------------------------------------------*/
/// petskillsupport <skill id>,<level>,<delay>,<hp>,<sp>
/// petskillsupport "<skill name>",<level>,<delay>,<hp>,<sp>
-BUILDIN_FUNC(petskillsupport)
+BUILDIN(petskillsupport)
{
struct pet_data *pd;
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd==NULL || sd->pd==NULL)
- return 0;
-
+ return true;
+
pd=sd->pd;
if (pd->s_skill)
{ //Clear previous skill
@@ -12488,20 +12279,20 @@ BUILDIN_FUNC(petskillsupport)
}
} else //init memory
pd->s_skill = (struct pet_skill_support *) aMalloc(sizeof(struct pet_skill_support));
-
+
pd->s_skill->id=( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
pd->s_skill->lv=script_getnum(st,3);
pd->s_skill->delay=script_getnum(st,4);
pd->s_skill->hp=script_getnum(st,5);
pd->s_skill->sp=script_getnum(st,6);
-
+
//Use delay as initial offset to avoid skill/heal exploits
if (battle_config.pet_equip_required && pd->pet.equip == 0)
pd->s_skill->timer = INVALID_TIMER;
else
pd->s_skill->timer = add_timer(gettick()+pd->s_skill->delay*1000,pet_skill_support_timer,sd->bl.id,0);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -12509,17 +12300,17 @@ BUILDIN_FUNC(petskillsupport)
*------------------------------------------*/
/// skilleffect <skill id>,<level>
/// skilleffect "<skill name>",<level>
-BUILDIN_FUNC(skilleffect)
+BUILDIN(skilleffect)
{
TBL_PC *sd;
-
+
uint16 skill_id=( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
uint16 skill_lv=script_getnum(st,3);
sd=script_rid2sd(st);
-
+
clif->skill_nodamage(&sd->bl,&sd->bl,skill_id,skill_lv,1);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -12527,33 +12318,33 @@ BUILDIN_FUNC(skilleffect)
*------------------------------------------*/
/// npcskilleffect <skill id>,<level>,<x>,<y>
/// npcskilleffect "<skill name>",<level>,<x>,<y>
-BUILDIN_FUNC(npcskilleffect)
+BUILDIN(npcskilleffect)
{
struct block_list *bl= map_id2bl(st->oid);
-
+
uint16 skill_id=( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
uint16 skill_lv=script_getnum(st,3);
int x=script_getnum(st,4);
int y=script_getnum(st,5);
-
+
if (bl)
clif->skill_poseffect(bl,skill_id,skill_lv,x,y,gettick());
-
- return 0;
+
+ return true;
}
/*==========================================
* Special effects [Valaris]
*------------------------------------------*/
-BUILDIN_FUNC(specialeffect)
+BUILDIN(specialeffect)
{
struct block_list *bl=map_id2bl(st->oid);
int type = script_getnum(st,2);
enum send_target target = script_hasdata(st,3) ? (send_target)script_getnum(st,3) : AREA;
-
+
if(bl==NULL)
- return 0;
-
+ return true;
+
if( script_hasdata(st,4) )
{
TBL_NPC *nd = npc_name2id(script_getstr(st,4));
@@ -12570,36 +12361,36 @@ BUILDIN_FUNC(specialeffect)
clif->specialeffect(bl, type, target);
}
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(specialeffect2)
+BUILDIN(specialeffect2)
{
TBL_PC *sd=script_rid2sd(st);
int type = script_getnum(st,2);
enum send_target target = script_hasdata(st,3) ? (send_target)script_getnum(st,3) : AREA;
-
+
if( script_hasdata(st,4) )
sd = map_nick2sd(script_getstr(st,4));
-
+
if (sd)
clif->specialeffect(&sd->bl, type, target);
-
- return 0;
+
+ return true;
}
/*==========================================
* Nude [Valaris]
*------------------------------------------*/
-BUILDIN_FUNC(nude)
+BUILDIN(nude)
{
TBL_PC *sd = script_rid2sd(st);
int i, calcflag = 0;
-
+
if( sd == NULL )
- return 0;
-
+ return true;
+
for( i = 0 ; i < EQI_MAX; i++ ) {
if( sd->equip_index[ i ] >= 0 ) {
if( !calcflag )
@@ -12607,32 +12398,32 @@ BUILDIN_FUNC(nude)
pc_unequipitem( sd , sd->equip_index[ i ] , 2);
}
}
-
+
if( calcflag )
status_calc_pc(sd,0);
-
- return 0;
+
+ return true;
}
/*==========================================
* gmcommand [MouseJstr]
*------------------------------------------*/
-BUILDIN_FUNC(atcommand)
+BUILDIN(atcommand)
{
TBL_PC dummy_sd;
TBL_PC* sd;
int fd;
const char* cmd;
-
+
cmd = script_getstr(st,2);
-
+
if (st->rid) {
sd = script_rid2sd(st);
fd = sd->fd;
} else { //Use a dummy character.
sd = &dummy_sd;
fd = 0;
-
+
memset(&dummy_sd, 0, sizeof(TBL_PC));
if (st->oid)
{
@@ -12642,38 +12433,38 @@ BUILDIN_FUNC(atcommand)
safestrncpy(dummy_sd.status.name, ((TBL_NPC*)bl)->name, NAME_LENGTH);
}
}
-
- if (!is_atcommand(fd, sd, cmd, 0)) {
+
+ if (!atcommand->parse(fd, sd, cmd, 0)) {
ShowWarning("script: buildin_atcommand: failed to execute command '%s'\n", cmd);
script_reportsrc(st);
- return 1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Displays a message for the player only (like system messages like "you got an apple" )
*------------------------------------------*/
-BUILDIN_FUNC(dispbottom)
+BUILDIN(dispbottom)
{
TBL_PC *sd=script_rid2sd(st);
const char *message;
message=script_getstr(st,2);
if(sd)
clif->disp_onlyself(sd,message,(int)strlen(message));
- return 0;
+ return true;
}
/*==========================================
* All The Players Full Recovery
* (HP/SP full restore and resurrect if need)
*------------------------------------------*/
-BUILDIN_FUNC(recovery)
+BUILDIN(recovery)
{
TBL_PC* sd;
struct s_mapiterator* iter;
-
+
iter = mapit_getallusers();
for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
{
@@ -12684,25 +12475,25 @@ BUILDIN_FUNC(recovery)
clif->message(sd->fd,msg_txt(680));
}
mapit_free(iter);
- return 0;
+ return true;
}
/*==========================================
* Get your pet info: getpetinfo(n)
* n -> 0:pet_id 1:pet_class 2:pet_name
* 3:friendly 4:hungry, 5: rename flag.
*------------------------------------------*/
-BUILDIN_FUNC(getpetinfo)
+BUILDIN(getpetinfo)
{
TBL_PC *sd=script_rid2sd(st);
TBL_PET *pd;
int type=script_getnum(st,2);
-
+
if(!sd || !sd->pd) {
if (type == 2)
script_pushconststr(st,"null");
else
script_pushint(st,0);
- return 0;
+ return true;
}
pd = sd->pd;
switch(type){
@@ -12716,7 +12507,7 @@ BUILDIN_FUNC(getpetinfo)
script_pushint(st,0);
break;
}
- return 0;
+ return true;
}
/*==========================================
@@ -12725,12 +12516,12 @@ BUILDIN_FUNC(getpetinfo)
* 3:friendly 4:hungry, 5: rename flag.
* 6: level
*------------------------------------------*/
-BUILDIN_FUNC(gethominfo)
+BUILDIN(gethominfo)
{
TBL_PC *sd=script_rid2sd(st);
TBL_HOM *hd;
int type=script_getnum(st,2);
-
+
hd = sd?sd->hd:NULL;
if(!merc_is_hom_active(hd))
{
@@ -12738,9 +12529,9 @@ BUILDIN_FUNC(gethominfo)
script_pushconststr(st,"null");
else
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
switch(type){
case 0: script_pushint(st,hd->homunculus.hom_id); break;
case 1: script_pushint(st,hd->homunculus.class_); break;
@@ -12753,28 +12544,28 @@ BUILDIN_FUNC(gethominfo)
script_pushint(st,0);
break;
}
- return 0;
+ return true;
}
/// Retrieves information about character's mercenary
/// getmercinfo <type>[,<char id>];
-BUILDIN_FUNC(getmercinfo)
+BUILDIN(getmercinfo)
{
int type, char_id;
struct map_session_data* sd;
struct mercenary_data* md;
-
+
type = script_getnum(st,2);
-
+
if( script_hasdata(st,3) )
{
char_id = script_getnum(st,3);
-
+
if( ( sd = map_charid2sd(char_id) ) == NULL )
{
ShowError("buildin_getmercinfo: No such character (char_id=%d).\n", char_id);
script_pushnil(st);
- return 1;
+ return false;
}
}
else
@@ -12782,12 +12573,12 @@ BUILDIN_FUNC(getmercinfo)
if( ( sd = script_rid2sd(st) ) == NULL )
{
script_pushnil(st);
- return 0;
+ return true;
}
}
-
+
md = ( sd->status.mer_id && sd->md ) ? sd->md : NULL;
-
+
switch( type )
{
case 0: script_pushint(st,md ? md->mercenary.mercenary_id : 0); break;
@@ -12806,25 +12597,25 @@ BUILDIN_FUNC(getmercinfo)
default:
ShowError("buildin_getmercinfo: Invalid type %d (char_id=%d).\n", type, sd->status.char_id);
script_pushnil(st);
- return 1;
+ return false;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Shows wether your inventory(and equips) contain
- selected card or not.
- checkequipedcard(4001);
+ selected card or not.
+ checkequipedcard(4001);
*------------------------------------------*/
-BUILDIN_FUNC(checkequipedcard)
+BUILDIN(checkequipedcard)
{
TBL_PC *sd=script_rid2sd(st);
-
+
if(sd){
int n,i,c=0;
c=script_getnum(st,2);
-
+
for(i=0;i<MAX_INVENTORY;i++){
if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].amount && sd->inventory_data[i]){
if (itemdb_isspecial(sd->status.inventory[i].card[0]))
@@ -12832,17 +12623,17 @@ BUILDIN_FUNC(checkequipedcard)
for(n=0;n<sd->inventory_data[i]->slot;n++){
if(sd->status.inventory[i].card[n]==c){
script_pushint(st,1);
- return 0;
+ return true;
}
}
}
}
}
script_pushint(st,0);
- return 0;
+ return true;
}
-BUILDIN_FUNC(jump_zero)
+BUILDIN(jump_zero)
{
int sel;
sel=script_getnum(st,2);
@@ -12851,67 +12642,67 @@ BUILDIN_FUNC(jump_zero)
if( !data_islabel(script_getdata(st,3)) ){
ShowError("script: jump_zero: not label !\n");
st->state=END;
- return 1;
+ return false;
}
-
+
pos=script_getnum(st,3);
st->pos=pos;
st->state=GOTO;
}
- return 0;
+ return true;
}
/*==========================================
* movenpc [MouseJstr]
*------------------------------------------*/
-BUILDIN_FUNC(movenpc)
+BUILDIN(movenpc)
{
TBL_NPC *nd = NULL;
const char *npc;
int x,y;
-
+
npc = script_getstr(st,2);
x = script_getnum(st,3);
y = script_getnum(st,4);
-
+
if ((nd = npc_name2id(npc)) == NULL)
return -1;
-
+
if (script_hasdata(st,5))
nd->ud.dir = script_getnum(st,5) % 8;
npc_movenpc(nd, x, y);
- return 0;
+ return true;
}
/*==========================================
* message [MouseJstr]
*------------------------------------------*/
-BUILDIN_FUNC(message)
+BUILDIN(message)
{
const char *msg,*player;
TBL_PC *pl_sd = NULL;
-
+
player = script_getstr(st,2);
msg = script_getstr(st,3);
-
+
if((pl_sd=map_nick2sd((char *) player)) == NULL)
- return 0;
+ return true;
clif->message(pl_sd->fd, msg);
-
- return 0;
+
+ return true;
}
/*==========================================
* npctalk (sends message to surrounding area)
*------------------------------------------*/
-BUILDIN_FUNC(npctalk)
+BUILDIN(npctalk)
{
const char* str;
char name[NAME_LENGTH], message[256];
-
+
struct npc_data* nd = (struct npc_data *)map_id2bl(st->oid);
str = script_getstr(st,2);
-
+
if(nd)
{
safestrncpy(name, nd->name, sizeof(name));
@@ -12919,36 +12710,36 @@ BUILDIN_FUNC(npctalk)
safesnprintf(message, sizeof(message), "%s : %s", name, str);
clif->disp_overhead(&nd->bl, message);
}
-
- return 0;
+
+ return true;
}
// change npc walkspeed [Valaris]
-BUILDIN_FUNC(npcspeed)
+BUILDIN(npcspeed)
{
struct npc_data* nd;
int speed;
-
+
speed = script_getnum(st,2);
nd =(struct npc_data *)map_id2bl(st->oid);
-
+
if( nd )
{
nd->speed = speed;
nd->ud.state.speed_changed = 1;
}
-
- return 0;
+
+ return true;
}
// make an npc walk to a position [Valaris]
-BUILDIN_FUNC(npcwalkto)
+BUILDIN(npcwalkto)
{
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
int x=0,y=0;
-
+
x=script_getnum(st,2);
y=script_getnum(st,3);
-
+
if(nd) {
if (!nd->status.hp) {
status_calc_npc(nd, true);
@@ -12957,66 +12748,66 @@ BUILDIN_FUNC(npcwalkto)
}
unit_walktoxy(&nd->bl,x,y,0);
}
-
- return 0;
+
+ return true;
}
// stop an npc's movement [Valaris]
-BUILDIN_FUNC(npcstop)
+BUILDIN(npcstop)
{
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
-
+
if(nd) {
unit_stop_walking(&nd->bl,1|4);
}
-
- return 0;
+
+ return true;
}
/*==========================================
* getlook char info. getlook(arg)
*------------------------------------------*/
-BUILDIN_FUNC(getlook)
-{
- int type,val;
- TBL_PC *sd;
- sd=script_rid2sd(st);
-
- type=script_getnum(st,2);
- val=-1;
- switch(type) {
- case LOOK_HAIR: val=sd->status.hair; break; //1
- case LOOK_WEAPON: val=sd->status.weapon; break; //2
- case LOOK_HEAD_BOTTOM: val=sd->status.head_bottom; break; //3
- case LOOK_HEAD_TOP: val=sd->status.head_top; break; //4
- case LOOK_HEAD_MID: val=sd->status.head_mid; break; //5
- case LOOK_HAIR_COLOR: val=sd->status.hair_color; break; //6
- case LOOK_CLOTHES_COLOR:val=sd->status.clothes_color; break; //7
- case LOOK_SHIELD: val=sd->status.shield; break; //8
- case LOOK_SHOES: break; //9
- case LOOK_ROBE: val=sd->status.robe; break; //12
- }
-
- script_pushint(st,val);
- return 0;
+BUILDIN(getlook)
+{
+ int type,val;
+ TBL_PC *sd;
+ sd=script_rid2sd(st);
+
+ type=script_getnum(st,2);
+ val=-1;
+ switch(type) {
+ case LOOK_HAIR: val=sd->status.hair; break; //1
+ case LOOK_WEAPON: val=sd->status.weapon; break; //2
+ case LOOK_HEAD_BOTTOM: val=sd->status.head_bottom; break; //3
+ case LOOK_HEAD_TOP: val=sd->status.head_top; break; //4
+ case LOOK_HEAD_MID: val=sd->status.head_mid; break; //5
+ case LOOK_HAIR_COLOR: val=sd->status.hair_color; break; //6
+ case LOOK_CLOTHES_COLOR:val=sd->status.clothes_color; break; //7
+ case LOOK_SHIELD: val=sd->status.shield; break; //8
+ case LOOK_SHOES: break; //9
+ case LOOK_ROBE: val=sd->status.robe; break; //12
+ }
+
+ script_pushint(st,val);
+ return true;
}
/*==========================================
* get char save point. argument: 0- map name, 1- x, 2- y
*------------------------------------------*/
-BUILDIN_FUNC(getsavepoint)
+BUILDIN(getsavepoint)
{
TBL_PC* sd;
int type;
-
+
sd = script_rid2sd(st);
if (sd == NULL) {
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
type = script_getnum(st,2);
-
+
switch(type) {
case 0: script_pushstrcopy(st,mapindex_id2name(sd->status.save_point.map)); break;
case 1: script_pushint(st,sd->status.save_point.x); break;
@@ -13025,69 +12816,69 @@ BUILDIN_FUNC(getsavepoint)
script_pushint(st,0);
break;
}
- return 0;
+ return true;
}
/*==========================================
- * Get position for char/npc/pet/mob objects. Added by Lorky
- *
- * int getMapXY(MapName$,MapX,MapY,type,[CharName$]);
- * where type:
- * MapName$ - String variable for output map name
- * MapX - Integer variable for output coord X
- * MapY - Integer variable for output coord Y
- * type - type of object
- * 0 - Character coord
- * 1 - NPC coord
- * 2 - Pet coord
- * 3 - Mob coord (not released)
- * 4 - Homun coord
- * 5 - Mercenary coord
- * 6 - Elemental coord
- * CharName$ - Name object. If miss or "this" the current object
- *
- * Return:
- * 0 - success
- * -1 - some error, MapName$,MapX,MapY contains unknown value.
- *------------------------------------------*/
-BUILDIN_FUNC(getmapxy)
+ * Get position for char/npc/pet/mob objects. Added by Lorky
+ *
+ * int getMapXY(MapName$,MapX,MapY,type,[CharName$]);
+ * where type:
+ * MapName$ - String variable for output map name
+ * MapX - Integer variable for output coord X
+ * MapY - Integer variable for output coord Y
+ * type - type of object
+ * 0 - Character coord
+ * 1 - NPC coord
+ * 2 - Pet coord
+ * 3 - Mob coord (not released)
+ * 4 - Homun coord
+ * 5 - Mercenary coord
+ * 6 - Elemental coord
+ * CharName$ - Name object. If miss or "this" the current object
+ *
+ * Return:
+ * 0 - success
+ * -1 - some error, MapName$,MapX,MapY contains unknown value.
+ *------------------------------------------*/
+BUILDIN(getmapxy)
{
struct block_list *bl = NULL;
TBL_PC *sd=NULL;
-
+
int num;
const char *name;
char prefix;
-
+
int x,y,type;
char mapname[MAP_NAME_LENGTH];
-
+
if( !data_isreference(script_getdata(st,2)) ){
ShowWarning("script: buildin_getmapxy: not mapname variable\n");
script_pushint(st,-1);
- return 1;
+ return false;
}
if( !data_isreference(script_getdata(st,3)) ){
ShowWarning("script: buildin_getmapxy: not mapx variable\n");
script_pushint(st,-1);
- return 1;
+ return false;
}
if( !data_isreference(script_getdata(st,4)) ){
ShowWarning("script: buildin_getmapxy: not mapy variable\n");
script_pushint(st,-1);
- return 1;
+ return false;
}
-
+
// Possible needly check function parameters on C_STR,C_INT,C_INT
type=script_getnum(st,5);
-
+
switch (type){
case 0: //Get Character Position
if( script_hasdata(st,6) )
sd=map_nick2sd(script_getstr(st,6));
else
sd=script_rid2sd(st);
-
+
if (sd)
bl = &sd->bl;
break;
@@ -13106,7 +12897,7 @@ BUILDIN_FUNC(getmapxy)
sd=map_nick2sd(script_getstr(st,6));
else
sd=script_rid2sd(st);
-
+
if (sd && sd->pd)
bl = &sd->pd->bl;
break;
@@ -13117,7 +12908,7 @@ BUILDIN_FUNC(getmapxy)
sd=map_nick2sd(script_getstr(st,6));
else
sd=script_rid2sd(st);
-
+
if (sd && sd->hd)
bl = &sd->hd->bl;
break;
@@ -13126,7 +12917,7 @@ BUILDIN_FUNC(getmapxy)
sd=map_nick2sd(script_getstr(st,6));
else
sd=script_rid2sd(st);
-
+
if (sd && sd->md)
bl = &sd->md->bl;
break;
@@ -13135,90 +12926,90 @@ BUILDIN_FUNC(getmapxy)
sd=map_nick2sd(script_getstr(st,6));
else
sd=script_rid2sd(st);
-
+
if (sd && sd->ed)
bl = &sd->ed->bl;
break;
default:
ShowWarning("script: buildin_getmapxy: Invalid type %d\n", type);
script_pushint(st,-1);
- return 1;
+ return false;
}
if (!bl) { //No object found.
script_pushint(st,-1);
- return 0;
+ return true;
}
-
+
x= bl->x;
y= bl->y;
safestrncpy(mapname, map[bl->m].name, MAP_NAME_LENGTH);
-
+
//Set MapName$
num=st->stack->stack_data[st->start+2].u.num;
name=get_str(num&0x00ffffff);
prefix=*name;
-
+
if(not_server_variable(prefix))
sd=script_rid2sd(st);
else
sd=NULL;
set_reg(st,sd,num,name,(void*)mapname,script_getref(st,2));
-
+
//Set MapX
num=st->stack->stack_data[st->start+3].u.num;
name=get_str(num&0x00ffffff);
prefix=*name;
-
+
if(not_server_variable(prefix))
sd=script_rid2sd(st);
else
sd=NULL;
- set_reg(st,sd,num,name,(void*)__64BPRTSIZE(x),script_getref(st,3));
-
+ set_reg(st,sd,num,name,(void*)__64BPTRSIZE(x),script_getref(st,3));
+
//Set MapY
num=st->stack->stack_data[st->start+4].u.num;
name=get_str(num&0x00ffffff);
prefix=*name;
-
+
if(not_server_variable(prefix))
sd=script_rid2sd(st);
else
sd=NULL;
- set_reg(st,sd,num,name,(void*)__64BPRTSIZE(y),script_getref(st,4));
-
+ set_reg(st,sd,num,name,(void*)__64BPTRSIZE(y),script_getref(st,4));
+
//Return Success value
script_pushint(st,0);
- return 0;
+ return true;
}
/*==========================================
* Allows player to write NPC logs (i.e. Bank NPC, etc) [Lupus]
*------------------------------------------*/
-BUILDIN_FUNC(logmes)
+BUILDIN(logmes)
{
const char *str;
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 1;
-
+ return false;
+
str = script_getstr(st,2);
- log_npc(sd,str);
- return 0;
+ logs->npc(sd,str);
+ return true;
}
-BUILDIN_FUNC(summon)
+BUILDIN(summon)
{
int _class, timeout=0;
const char *str,*event="";
TBL_PC *sd;
struct mob_data *md;
int tick = gettick();
-
+
sd=script_rid2sd(st);
- if (!sd) return 0;
-
+ if (!sd) return true;
+
str =script_getstr(st,2);
_class=script_getnum(st,3);
if( script_hasdata(st,4) )
@@ -13227,9 +13018,9 @@ BUILDIN_FUNC(summon)
event=script_getstr(st,5);
check_event(st, event);
}
-
+
clif->skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick);
-
+
md = mob_once_spawn_sub(&sd->bl, sd->bl.m, sd->bl.x, sd->bl.y, str, _class, event, SZ_SMALL, AI_NONE);
if (md) {
md->master_id=sd->bl.id;
@@ -13241,45 +13032,45 @@ BUILDIN_FUNC(summon)
clif->specialeffect(&md->bl,344,AREA);
sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
}
- return 0;
+ return true;
}
/*==========================================
* Checks whether it is daytime/nighttime
*------------------------------------------*/
-BUILDIN_FUNC(isnight)
+BUILDIN(isnight)
{
script_pushint(st,(night_flag == 1));
- return 0;
+ return true;
}
-BUILDIN_FUNC(isday)
+BUILDIN(isday)
{
script_pushint(st,(night_flag == 0));
- return 0;
+ return true;
}
/*================================================
* Check how many items/cards in the list are
* equipped - used for 2/15's cards patch [celest]
*------------------------------------------------*/
-BUILDIN_FUNC(isequippedcnt)
+BUILDIN(isequippedcnt)
{
TBL_PC *sd;
int i, j, k, id = 1;
int ret = 0;
-
+
sd = script_rid2sd(st);
if (!sd) { //If the player is not attached it is a script error anyway... but better prevent the map server from crashing...
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
for (i=0; id!=0; i++) {
FETCH (i+2, id) else id = 0;
if (id <= 0)
continue;
-
+
for (j=0; j<EQI_MAX; j++) {
int index;
index = sd->equip_index[j];
@@ -13287,10 +13078,10 @@ BUILDIN_FUNC(isequippedcnt)
if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue;
if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index) continue;
if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index)) continue;
-
+
if(!sd->inventory_data[index])
continue;
-
+
if (itemdb_type(id) != IT_CARD) { //No card. Count amount in inventory.
if (sd->inventory_data[index]->nameid == id)
ret+= sd->status.inventory[index].amount;
@@ -13304,9 +13095,9 @@ BUILDIN_FUNC(isequippedcnt)
}
}
}
-
+
script_pushint(st,ret);
- return 0;
+ return true;
}
/*================================================
@@ -13315,7 +13106,7 @@ BUILDIN_FUNC(isequippedcnt)
* -- Items checked cannot be reused in another
* card set to prevent exploits
*------------------------------------------------*/
-BUILDIN_FUNC(isequipped)
+BUILDIN(isequipped)
{
TBL_PC *sd;
int i, j, k, id = 1;
@@ -13323,14 +13114,14 @@ BUILDIN_FUNC(isequipped)
int ret = -1;
//Original hash to reverse it when full check fails.
unsigned int setitem_hash = 0, setitem_hash2 = 0;
-
+
sd = script_rid2sd(st);
-
+
if (!sd) { //If the player is not attached it is a script error anyway... but better prevent the map server from crashing...
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
setitem_hash = sd->bonus.setitem_hash;
setitem_hash2 = sd->bonus.setitem_hash2;
for (i=0; id!=0; i++) {
@@ -13344,10 +13135,10 @@ BUILDIN_FUNC(isequipped)
if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue;
if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index) continue;
if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index)) continue;
-
+
if(!sd->inventory_data[index])
continue;
-
+
if (itemdb_type(id) != IT_CARD) {
if (sd->inventory_data[index]->nameid != id)
continue;
@@ -13357,18 +13148,18 @@ BUILDIN_FUNC(isequipped)
if (sd->inventory_data[index]->slot == 0 ||
itemdb_isspecial(sd->status.inventory[index].card[0]))
continue;
-
+
for (k = 0; k < sd->inventory_data[index]->slot; k++)
{ //New hash system which should support up to 4 slots on any equipment. [Skotlex]
unsigned int hash = 0;
if (sd->status.inventory[index].card[k] != id)
continue;
-
+
hash = 1<<((j<5?j:j-5)*4 + k);
// check if card is already used by another set
if ( ( j < 5 ? sd->bonus.setitem_hash : sd->bonus.setitem_hash2 ) & hash)
continue;
-
+
// We have found a match
flag = 1;
// Set hash so this card cannot be used by another
@@ -13392,33 +13183,33 @@ BUILDIN_FUNC(isequipped)
sd->bonus.setitem_hash2 = setitem_hash2;
}
script_pushint(st,ret);
- return 0;
+ return true;
}
/*================================================
* Check how many given inserted cards in the CURRENT
* weapon - used for 2/15's cards patch [Lupus]
*------------------------------------------------*/
-BUILDIN_FUNC(cardscnt)
+BUILDIN(cardscnt)
{
TBL_PC *sd;
int i, k, id = 1;
int ret = 0;
int index;
-
+
sd = script_rid2sd(st);
-
+
for (i=0; id!=0; i++) {
FETCH (i+2, id) else id = 0;
if (id <= 0)
continue;
-
+
index = current_equip_item_index; //we get CURRENT WEAPON inventory index from status.c [Lupus]
if(index < 0) continue;
-
+
if(!sd->inventory_data[index])
continue;
-
+
if(itemdb_type(id) != IT_CARD) {
if (sd->inventory_data[index]->nameid == id)
ret+= sd->status.inventory[index].amount;
@@ -13432,47 +13223,47 @@ BUILDIN_FUNC(cardscnt)
}
}
script_pushint(st,ret);
-// script_pushint(st,current_equip_item_index);
- return 0;
+ // script_pushint(st,current_equip_item_index);
+ return true;
}
/*=======================================================
* Returns the refined number of the current item, or an
* item with inventory index specified
*-------------------------------------------------------*/
-BUILDIN_FUNC(getrefine)
+BUILDIN(getrefine)
{
TBL_PC *sd;
if ((sd = script_rid2sd(st))!= NULL)
script_pushint(st,sd->status.inventory[current_equip_item_index].refine);
else
script_pushint(st,0);
- return 0;
+ return true;
}
/*=======================================================
* Day/Night controls
*-------------------------------------------------------*/
-BUILDIN_FUNC(night)
+BUILDIN(night)
{
if (night_flag != 1) map_night_timer(night_timer_tid, 0, 0, 1);
- return 0;
+ return true;
}
-BUILDIN_FUNC(day)
+BUILDIN(day)
{
if (night_flag != 0) map_day_timer(day_timer_tid, 0, 0, 1);
- return 0;
+ return true;
}
//=======================================================
// Unequip [Spectre]
//-------------------------------------------------------
-BUILDIN_FUNC(unequip)
+BUILDIN(unequip)
{
int i;
size_t num;
TBL_PC *sd;
-
+
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd != NULL && num >= 1 && num <= ARRAYLENGTH(equip) )
@@ -13481,138 +13272,138 @@ BUILDIN_FUNC(unequip)
if (i >= 0)
pc_unequipitem(sd,i,1|2);
}
- return 0;
+ return true;
}
-BUILDIN_FUNC(equip)
+BUILDIN(equip)
{
int nameid=0,i;
TBL_PC *sd;
struct item_data *item_data;
-
+
sd = script_rid2sd(st);
-
+
nameid=script_getnum(st,2);
if((item_data = itemdb_exists(nameid)) == NULL)
{
ShowError("wrong item ID : equipitem(%i)\n",nameid);
- return 1;
+ return false;
}
ARR_FIND( 0, MAX_INVENTORY, i, sd->status.inventory[i].nameid == nameid );
if( i < MAX_INVENTORY )
pc_equipitem(sd,i,item_data->equip);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(autoequip)
+BUILDIN(autoequip)
{
int nameid, flag;
struct item_data *item_data;
nameid=script_getnum(st,2);
flag=script_getnum(st,3);
-
+
if( ( item_data = itemdb_exists(nameid) ) == NULL )
{
ShowError("buildin_autoequip: Invalid item '%d'.\n", nameid);
- return 1;
+ return false;
}
-
+
if( !itemdb_isequip2(item_data) )
{
ShowError("buildin_autoequip: Item '%d' cannot be equipped.\n", nameid);
- return 1;
+ return false;
}
-
+
item_data->flag.autoequip = flag>0?1:0;
- return 0;
+ return true;
}
-BUILDIN_FUNC(setbattleflag)
+BUILDIN(setbattleflag)
{
const char *flag, *value;
-
+
flag = script_getstr(st,2);
value = script_getstr(st,3); // HACK: Retrieve number as string (auto-converted) for battle_set_value
-
+
if (battle->config_set_value(flag, value) == 0)
ShowWarning("buildin_setbattleflag: unknown battle_config flag '%s'\n",flag);
else
ShowInfo("buildin_setbattleflag: battle_config flag '%s' is now set to '%s'.\n",flag,value);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(getbattleflag)
+BUILDIN(getbattleflag)
{
const char *flag;
flag = script_getstr(st,2);
script_pushint(st,battle->config_get_value(flag));
- return 0;
+ return true;
}
//=======================================================
// strlen [Valaris]
//-------------------------------------------------------
-BUILDIN_FUNC(getstrlen)
+BUILDIN(getstrlen)
{
-
+
const char *str = script_getstr(st,2);
int len = (str) ? (int)strlen(str) : 0;
-
+
script_pushint(st,len);
- return 0;
+ return true;
}
//=======================================================
// isalpha [Valaris]
//-------------------------------------------------------
-BUILDIN_FUNC(charisalpha)
+BUILDIN(charisalpha)
{
const char *str=script_getstr(st,2);
int pos=script_getnum(st,3);
-
+
int val = ( str && pos >= 0 && (unsigned int)pos < strlen(str) ) ? ISALPHA( str[pos] ) != 0 : 0;
-
+
script_pushint(st,val);
- return 0;
+ return true;
}
//=======================================================
// charisupper <str>, <index>
//-------------------------------------------------------
-BUILDIN_FUNC(charisupper)
+BUILDIN(charisupper)
{
const char *str = script_getstr(st,2);
int pos = script_getnum(st,3);
-
+
int val = ( str && pos >= 0 && (unsigned int)pos < strlen(str) ) ? ISUPPER( str[pos] ) : 0;
-
+
script_pushint(st,val);
- return 0;
+ return true;
}
//=======================================================
// charislower <str>, <index>
//-------------------------------------------------------
-BUILDIN_FUNC(charislower)
+BUILDIN(charislower)
{
const char *str = script_getstr(st,2);
int pos = script_getnum(st,3);
-
+
int val = ( str && pos >= 0 && (unsigned int)pos < strlen(str) ) ? ISLOWER( str[pos] ) : 0;
-
+
script_pushint(st,val);
- return 0;
+ return true;
}
//=======================================================
// charat <str>, <index>
//-------------------------------------------------------
-BUILDIN_FUNC(charat) {
+BUILDIN(charat) {
const char *str = script_getstr(st,2);
int pos = script_getnum(st,3);
-
+
if( pos >= 0 && (unsigned int)pos < strlen(str) ) {
char output[2];
output[0] = str[pos];
@@ -13620,145 +13411,145 @@ BUILDIN_FUNC(charat) {
script_pushstrcopy(st, output);
} else
script_pushconststr(st, "");
- return 0;
+ return true;
}
//=======================================================
// setchar <string>, <char>, <index>
//-------------------------------------------------------
-BUILDIN_FUNC(setchar)
+BUILDIN(setchar)
{
const char *str = script_getstr(st,2);
const char *c = script_getstr(st,3);
int index = script_getnum(st,4);
char *output = aStrdup(str);
-
+
if(index >= 0 && index < strlen(output))
output[index] = *c;
-
+
script_pushstr(st, output);
- return 0;
+ return true;
}
//=======================================================
// insertchar <string>, <char>, <index>
//-------------------------------------------------------
-BUILDIN_FUNC(insertchar)
+BUILDIN(insertchar)
{
const char *str = script_getstr(st,2);
const char *c = script_getstr(st,3);
int index = script_getnum(st,4);
char *output;
size_t len = strlen(str);
-
+
if(index < 0)
index = 0;
else if(index > len)
index = len;
-
+
output = (char*)aMalloc(len + 2);
-
+
memcpy(output, str, index);
output[index] = c[0];
memcpy(&output[index+1], &str[index], len - index);
output[len+1] = '\0';
-
+
script_pushstr(st, output);
- return 0;
+ return true;
}
//=======================================================
// delchar <string>, <index>
//-------------------------------------------------------
-BUILDIN_FUNC(delchar)
+BUILDIN(delchar)
{
const char *str = script_getstr(st,2);
int index = script_getnum(st,3);
char *output;
size_t len = strlen(str);
-
+
if(index < 0 || index > len) {
//return original
output = aStrdup(str);
script_pushstr(st, output);
- return 0;
+ return true;
}
-
+
output = (char*)aMalloc(len);
-
+
memcpy(output, str, index);
memcpy(&output[index], &str[index+1], len - index);
-
+
script_pushstr(st, output);
- return 0;
+ return true;
}
//=======================================================
// strtoupper <str>
//-------------------------------------------------------
-BUILDIN_FUNC(strtoupper)
+BUILDIN(strtoupper)
{
const char *str = script_getstr(st,2);
char *output = aStrdup(str);
char *cursor = output;
-
+
while (*cursor != '\0') {
*cursor = TOUPPER(*cursor);
cursor++;
}
-
+
script_pushstr(st, output);
- return 0;
+ return true;
}
//=======================================================
// strtolower <str>
//-------------------------------------------------------
-BUILDIN_FUNC(strtolower)
+BUILDIN(strtolower)
{
const char *str = script_getstr(st,2);
char *output = aStrdup(str);
char *cursor = output;
-
+
while (*cursor != '\0') {
*cursor = TOLOWER(*cursor);
cursor++;
}
-
+
script_pushstr(st, output);
- return 0;
+ return true;
}
//=======================================================
// substr <str>, <start>, <end>
//-------------------------------------------------------
-BUILDIN_FUNC(substr)
+BUILDIN(substr)
{
const char *str = script_getstr(st,2);
char *output;
int start = script_getnum(st,3);
int end = script_getnum(st,4);
-
+
int len = 0;
-
+
if(start >= 0 && end < strlen(str) && start <= end) {
len = end - start + 1;
output = (char*)aMalloc(len + 1);
memcpy(output, &str[start], len);
} else
output = (char*)aMalloc(1);
-
+
output[len] = '\0';
-
+
script_pushstr(st, output);
- return 0;
+ return true;
}
//=======================================================
// explode <dest_string_array>, <str>, <delimiter>
// Note: delimiter is limited to 1 char
//-------------------------------------------------------
-BUILDIN_FUNC(explode)
+BUILDIN(explode)
{
struct script_data* data = script_getdata(st, 2);
const char *str = script_getstr(st,3);
@@ -13767,50 +13558,50 @@ BUILDIN_FUNC(explode)
size_t len = strlen(str);
int i = 0, j = 0;
int start;
-
-
+
+
char *temp;
const char* name;
-
+
TBL_PC* sd = NULL;
-
+
temp = (char*)aMalloc(len + 1);
-
+
if( !data_isreference(data) )
{
ShowError("script:explode: not a variable\n");
script_reportdata(data);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
id = reference_getid(data);
start = reference_getindex(data);
name = reference_getname(data);
-
+
if( not_array_variable(*name) )
{
ShowError("script:explode: illegal scope\n");
script_reportdata(data);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
if( !is_string_variable(name) )
{
ShowError("script:explode: not string array\n");
script_reportdata(data);
st->state = END;
- return 1;// data type mismatch
+ return false;// data type mismatch
}
-
+
if( not_server_variable(*name) )
{
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached
+ return true;// no player attached
}
-
+
while(str[i] != '\0') {
if(str[i] == delimiter && start < SCRIPT_MAX_ARRAYSIZE-1) { //break at delimiter but ignore after reaching last array index
temp[j] = '\0';
@@ -13824,64 +13615,64 @@ BUILDIN_FUNC(explode)
//set last string
temp[j] = '\0';
set_reg(st, sd, reference_uid(id, start), name, (void*)temp, reference_getref(data));
-
+
aFree(temp);
- return 0;
+ return true;
}
//=======================================================
// implode <string_array>
// implode <string_array>, <glue>
//-------------------------------------------------------
-BUILDIN_FUNC(implode)
+BUILDIN(implode)
{
struct script_data* data = script_getdata(st, 2);
const char *glue = NULL, *name, *temp;
int32 glue_len = 0, array_size, id;
size_t len = 0;
int i, k = 0;
-
+
TBL_PC* sd = NULL;
-
+
char *output;
-
+
if( !data_isreference(data) )
{
ShowError("script:implode: not a variable\n");
script_reportdata(data);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
id = reference_getid(data);
name = reference_getname(data);
-
+
if( not_array_variable(*name) )
{
ShowError("script:implode: illegal scope\n");
script_reportdata(data);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
if( !is_string_variable(name) )
{
ShowError("script:implode: not string array\n");
script_reportdata(data);
st->state = END;
- return 1;// data type mismatch
+ return false;// data type mismatch
}
-
+
if( not_server_variable(*name) )
{
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached
+ return true;// no player attached
}
-
+
//count chars
array_size = getarraysize(st, id, reference_getindex(data), is_string_variable(name), reference_getref(data)) - 1;
-
+
if(array_size == -1) //empty array check (AmsTaff)
{
ShowWarning("script:implode: array length = 0\n");
@@ -13893,7 +13684,7 @@ BUILDIN_FUNC(implode)
len += strlen(temp);
script_removetop(st, -1, 0);
}
-
+
//allocate mem
if( script_hasdata(st,3) ) {
glue = script_getstr(st,3);
@@ -13901,7 +13692,7 @@ BUILDIN_FUNC(implode)
len += glue_len * (array_size);
}
output = (char*)aMalloc(len + 1);
-
+
//build output
for(i = 0; i < array_size; ++i) {
temp = (char*) get_val2(st, reference_uid(id, i), reference_getref(data));
@@ -13919,12 +13710,12 @@ BUILDIN_FUNC(implode)
memcpy(&output[k], temp, len);
k += len;
script_removetop(st, -1, 0);
-
+
output[k] = '\0';
}
-
+
script_pushstr(st, output);
- return 0;
+ return true;
}
//=======================================================
@@ -13932,7 +13723,7 @@ BUILDIN_FUNC(implode)
// Implements C sprintf, except format %n. The resulting string is
// returned, instead of being saved in variable by reference.
//-------------------------------------------------------
-BUILDIN_FUNC(sprintf)
+BUILDIN(sprintf)
{
unsigned int len, argc = 0, arg = 0, buf2_len = 0;
const char* format;
@@ -13942,31 +13733,31 @@ BUILDIN_FUNC(sprintf)
char* buf2 = NULL;
struct script_data* data;
StringBuf final_buf;
-
+
// Fetch init data
format = script_getstr(st, 2);
argc = script_lastdata(st)-2;
len = strlen(format);
-
+
// Skip parsing, where no parsing is required.
if(len==0){
script_pushconststr(st,"");
- return 0;
+ return true;
}
-
+
// Pessimistic alloc
CREATE(buf, char, len+1);
-
+
// Need not be parsed, just solve stuff like %%.
if(argc==0){
memcpy(buf,format,len+1);
script_pushstrcopy(st, buf);
aFree(buf);
- return 0;
+ return true;
}
-
+
safestrncpy(buf, format, len+1);
-
+
// Issue sprintf for each parameter
StringBuf_Init(&final_buf);
q = buf;
@@ -13999,7 +13790,7 @@ BUILDIN_FUNC(sprintf)
if(buf2) aFree(buf2);
StringBuf_Destroy(&final_buf);
script_pushconststr(st,"");
- return 1;
+ return false;
}
if((p = strchr(q+1, '%'))==NULL){
p = strchr(q, 0); // EOS
@@ -14011,7 +13802,7 @@ BUILDIN_FUNC(sprintf)
}
safestrncpy(buf2, q, len);
q = p;
-
+
// Note: This assumes the passed value being the correct
// type to the current format specifier. If not, the server
// probably crashes or returns anything else, than expected,
@@ -14035,36 +13826,36 @@ BUILDIN_FUNC(sprintf)
if(buf2) aFree(buf2);
StringBuf_Destroy(&final_buf);
script_pushconststr(st,"");
- return 1;
+ return false;
}
arg++;
}
-
+
// Append anything left
if(*q){
StringBuf_AppendStr(&final_buf, q);
}
-
+
// Passed more, than needed
if(arg<argc){
ShowWarning("buildin_sprintf: Unused arguments passed.\n");
script_reportsrc(st);
}
-
+
script_pushstrcopy(st, StringBuf_Value(&final_buf));
-
+
if(buf) aFree(buf);
if(buf2) aFree(buf2);
StringBuf_Destroy(&final_buf);
-
- return 0;
+
+ return true;
}
//=======================================================
// sscanf(<str>, <format>, ...);
// Implements C sscanf.
//-------------------------------------------------------
-BUILDIN_FUNC(sscanf){
+BUILDIN(sscanf){
unsigned int argc, arg = 0, len;
struct script_data* data;
struct map_session_data* sd = NULL;
@@ -14076,15 +13867,15 @@ BUILDIN_FUNC(sscanf){
char* buf_p;
char* ref_str = NULL;
int ref_int;
-
+
// Get data
str = script_getstr(st, 2);
format = script_getstr(st, 3);
argc = script_lastdata(st)-3;
-
+
len = strlen(format);
CREATE(buf, char, len*2+1);
-
+
// Issue sscanf for each parameter
*buf = 0;
q = format;
@@ -14104,7 +13895,7 @@ BUILDIN_FUNC(sscanf){
script_pushint(st, -1);
if(buf) aFree(buf);
if(ref_str) aFree(ref_str);
- return 1;
+ return false;
}
if((p = strchr(q+1, '%'))==NULL){
p = strchr(q, 0); // EOS
@@ -14112,7 +13903,7 @@ BUILDIN_FUNC(sscanf){
len = p-q;
strncat(buf, q, len);
q = p;
-
+
// Validate output
data = script_getdata(st, arg+4);
if(!data_isreference(data) || !reference_tovariable(data)){
@@ -14120,16 +13911,16 @@ BUILDIN_FUNC(sscanf){
script_pushint(st, -1);
if(buf) aFree(buf);
if(ref_str) aFree(ref_str);
- return 1;
+ return false;
}
buf_p = reference_getname(data);
if(not_server_variable(*buf_p) && (sd = script_rid2sd(st))==NULL){
script_pushint(st, -1);
if(buf) aFree(buf);
if(ref_str) aFree(ref_str);
- return 0;
+ return true;
}
-
+
// Save value if any
if(buf_p[strlen(buf_p)-1]=='$'){ // String
if(ref_str==NULL){
@@ -14138,26 +13929,26 @@ BUILDIN_FUNC(sscanf){
if(sscanf(str, buf, ref_str)==0){
break;
}
- set_reg(st, sd, add_str(buf_p), buf_p, (void *)(ref_str), reference_getref(data));
- }else{ // Number
+ set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (void *)(ref_str), reference_getref(data));
+ } else { // Number
if(sscanf(str, buf, &ref_int)==0){
break;
}
- set_reg(st, sd, add_str(buf_p), buf_p, (void *)__64BPRTSIZE(ref_int), reference_getref(data));
+ set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (void *)__64BPTRSIZE(ref_int), reference_getref(data));
}
arg++;
-
+
// Disable used format (%... -> %*...)
buf_p = strchr(buf, 0);
memmove(buf_p-len+2, buf_p-len+1, len);
*(buf_p-len+1) = '*';
}
-
+
script_pushint(st, arg);
if(buf) aFree(buf);
if(ref_str) aFree(ref_str);
-
- return 0;
+
+ return true;
}
//=======================================================
@@ -14167,22 +13958,22 @@ BUILDIN_FUNC(sscanf){
// Implements PHP style strpos. Adapted from code from
// http://www.daniweb.com/code/snippet313.html, Dave Sinkula
//-------------------------------------------------------
-BUILDIN_FUNC(strpos) {
+BUILDIN(strpos) {
const char *haystack = script_getstr(st,2);
const char *needle = script_getstr(st,3);
int i;
size_t len;
-
+
if( script_hasdata(st,4) )
i = script_getnum(st,4);
else
i = 0;
-
+
if (needle[0] == '\0') {
script_pushint(st, -1);
- return 0;
+ return true;
}
-
+
len = strlen(haystack);
for ( ; i < len; ++i ) {
if ( haystack[i] == *needle ) {
@@ -14195,12 +13986,12 @@ BUILDIN_FUNC(strpos) {
}
if ( !*n ) { // matched all of 'needle' to null termination
script_pushint(st, i);
- return 0;
+ return true;
}
}
}
script_pushint(st, -1);
- return 0;
+ return true;
}
//===============================================================
@@ -14211,7 +14002,7 @@ BUILDIN_FUNC(strpos) {
// instances as specified in <count>. By default will be case
// sensitive.
//---------------------------------------------------------------
-BUILDIN_FUNC(replacestr)
+BUILDIN(replacestr)
{
const char *input = script_getstr(st, 2);
const char *find = script_getstr(st, 3);
@@ -14220,48 +14011,48 @@ BUILDIN_FUNC(replacestr)
size_t findlen = strlen(find);
struct StringBuf output;
bool usecase = true;
-
+
int count = 0;
int numFinds = 0;
int i = 0, f = 0;
-
+
if(findlen == 0) {
ShowError("script:replacestr: Invalid search length.\n");
st->state = END;
- return 1;
+ return false;
}
-
+
if(script_hasdata(st, 5)) {
if( !script_isstring(st,5) )
usecase = script_getnum(st, 5) != 0;
else {
ShowError("script:replacestr: Invalid usecase value. Expected int got string\n");
st->state = END;
- return 1;
+ return false;
}
}
-
+
if(script_hasdata(st, 6)) {
count = script_getnum(st, 6);
if(count == 0) {
ShowError("script:replacestr: Invalid count value. Expected int got string\n");
st->state = END;
- return 1;
+ return false;
}
}
-
+
StringBuf_Init(&output);
-
+
for(; i < inputlen; i++) {
if(count && count == numFinds) { //found enough, stop looking
break;
}
-
+
for(f = 0; f <= findlen; f++) {
if(f == findlen) { //complete match
numFinds++;
StringBuf_AppendStr(&output, replace);
-
+
i += findlen - 1;
break;
} else {
@@ -14279,14 +14070,14 @@ BUILDIN_FUNC(replacestr)
}
}
}
-
+
//append excess after enough found
if(i < inputlen)
StringBuf_AppendStr(&output, &(input[i]));
-
+
script_pushstrcopy(st, StringBuf_Value(&output));
StringBuf_Destroy(&output);
- return 0;
+ return true;
}
//========================================================
@@ -14295,33 +14086,33 @@ BUILDIN_FUNC(replacestr)
// Note: Counts the number of times <search> occurs in
// <input>. By default will be case sensitive.
//--------------------------------------------------------
-BUILDIN_FUNC(countstr)
+BUILDIN(countstr)
{
const char *input = script_getstr(st, 2);
const char *find = script_getstr(st, 3);
size_t inputlen = strlen(input);
size_t findlen = strlen(find);
bool usecase = true;
-
+
int numFinds = 0;
int i = 0, f = 0;
-
+
if(findlen == 0) {
ShowError("script:countstr: Invalid search length.\n");
st->state = END;
- return 1;
+ return false;
}
-
+
if(script_hasdata(st, 4)) {
if( !script_isstring(st,4) )
usecase = script_getnum(st, 4) != 0;
else {
ShowError("script:countstr: Invalid usecase value. Expected int got string\n");
st->state = END;
- return 1;
+ return false;
}
}
-
+
for(; i < inputlen; i++) {
for(f = 0; f <= findlen; f++) {
if(f == findlen) { //complete match
@@ -14342,7 +14133,7 @@ BUILDIN_FUNC(countstr)
}
}
script_pushint(st, numFinds);
- return 0;
+ return true;
}
@@ -14353,22 +14144,22 @@ BUILDIN_FUNC(countstr)
/// setnpcdisplay("<npc name>", "<new display name>", <new class id>) -> <int>
/// setnpcdisplay("<npc name>", "<new display name>") -> <int>
/// setnpcdisplay("<npc name>", <new class id>) -> <int>
-BUILDIN_FUNC(setnpcdisplay)
+BUILDIN(setnpcdisplay)
{
const char* name;
const char* newname = NULL;
int class_ = -1, size = -1;
struct script_data* data;
struct npc_data* nd;
-
+
name = script_getstr(st,2);
data = script_getdata(st,3);
-
+
if( script_hasdata(st,4) )
class_ = script_getnum(st,4);
if( script_hasdata(st,5) )
size = script_getnum(st,5);
-
+
get_val(st, data);
if( data_isstring(data) )
newname = conv_str(st,data);
@@ -14378,25 +14169,25 @@ BUILDIN_FUNC(setnpcdisplay)
{
ShowError("script:setnpcdisplay: expected a string or number\n");
script_reportdata(data);
- return 1;
+ return false;
}
-
+
nd = npc_name2id(name);
if( nd == NULL )
{// not found
script_pushint(st,1);
- return 0;
+ return true;
}
-
+
// update npc
if( newname )
npc_setdisplayname(nd, newname);
-
+
if( size != -1 && size != (int)nd->size )
nd->size = size;
else
size = -1;
-
+
if( class_ != -1 && nd->class_ != class_ )
npc_setclass(nd, class_);
else if( size != -1 )
@@ -14404,107 +14195,107 @@ BUILDIN_FUNC(setnpcdisplay)
clif->clearunit_area(&nd->bl, CLR_OUTSIGHT);
clif->spawn(&nd->bl);
}
-
+
script_pushint(st,0);
- return 0;
+ return true;
}
-BUILDIN_FUNC(atoi)
+BUILDIN(atoi)
{
const char *value;
value = script_getstr(st,2);
script_pushint(st,atoi(value));
- return 0;
+ return true;
}
// case-insensitive substring search [lordalfa]
-BUILDIN_FUNC(compare)
+BUILDIN(compare)
{
const char *message;
const char *cmpstring;
message = script_getstr(st,2);
cmpstring = script_getstr(st,3);
script_pushint(st,(stristr(message,cmpstring) != NULL));
- return 0;
+ return true;
}
// [zBuffer] List of mathematics commands --->
-BUILDIN_FUNC(sqrt)
+BUILDIN(sqrt)
{
double i, a;
i = script_getnum(st,2);
a = sqrt(i);
script_pushint(st,(int)a);
- return 0;
+ return true;
}
-BUILDIN_FUNC(pow)
+BUILDIN(pow)
{
double i, a, b;
a = script_getnum(st,2);
b = script_getnum(st,3);
i = pow(a,b);
script_pushint(st,(int)i);
- return 0;
+ return true;
}
-BUILDIN_FUNC(distance)
+BUILDIN(distance)
{
int x0, y0, x1, y1;
-
+
x0 = script_getnum(st,2);
y0 = script_getnum(st,3);
x1 = script_getnum(st,4);
y1 = script_getnum(st,5);
-
+
script_pushint(st,distance_xy(x0,y0,x1,y1));
- return 0;
+ return true;
}
// <--- [zBuffer] List of mathematics commands
-BUILDIN_FUNC(md5)
+BUILDIN(md5)
{
const char *tmpstr;
char *md5str;
-
+
tmpstr = script_getstr(st,2);
md5str = (char *)aMalloc((32+1)*sizeof(char));
MD5_String(tmpstr, md5str);
script_pushstr(st, md5str);
- return 0;
+ return true;
}
// [zBuffer] List of dynamic var commands --->
-BUILDIN_FUNC(setd)
+BUILDIN(setd)
{
TBL_PC *sd=NULL;
char varname[100];
const char *buffer;
int elem;
buffer = script_getstr(st, 2);
-
+
if(sscanf(buffer, "%99[^[][%d]", varname, &elem) < 2)
elem = 0;
-
+
if( not_server_variable(*varname) )
{
sd = script_rid2sd(st);
if( sd == NULL )
{
ShowError("script:setd: no player attached for player variable '%s'\n", buffer);
- return 0;
+ return true;
}
}
-
+
if( is_string_variable(varname) ) {
setd_sub(st, sd, varname, elem, (void *)script_getstr(st, 3), NULL);
} else {
- setd_sub(st, sd, varname, elem, (void *)__64BPRTSIZE(script_getnum(st, 3)), NULL);
+ setd_sub(st, sd, varname, elem, (void *)__64BPTRSIZE(script_getnum(st, 3)), NULL);
}
-
- return 0;
+
+ return true;
}
int buildin_query_sql_sub(struct script_state* st, Sql* handle)
@@ -14517,7 +14308,7 @@ int buildin_query_sql_sub(struct script_state* st, Sql* handle)
int max_rows = SCRIPT_MAX_ARRAYSIZE; // maximum number of rows
int num_vars;
int num_cols;
-
+
// check target variables
for( i = 3; script_hasdata(st,i); ++i ) {
data = script_getdata(st, i);
@@ -14528,7 +14319,7 @@ int buildin_query_sql_sub(struct script_state* st, Sql* handle)
if( sd == NULL ) { // no player attached
script_reportdata(data);
st->state = END;
- return 1;
+ return false;
}
}
if( not_array_variable(*name) )
@@ -14537,26 +14328,26 @@ int buildin_query_sql_sub(struct script_state* st, Sql* handle)
ShowError("script:query_sql: not a variable\n");
script_reportdata(data);
st->state = END;
- return 1;
+ return false;
}
}
num_vars = i - 3;
-
+
// Execute the query
query = script_getstr(st,2);
-
+
if( SQL_ERROR == Sql_QueryStr(handle, query) ) {
Sql_ShowDebug(handle);
script_pushint(st, 0);
- return 1;
+ return false;
}
-
+
if( Sql_NumRows(handle) == 0 ) { // No data received
Sql_FreeResult(handle);
script_pushint(st, 0);
- return 0;
+ return true;
}
-
+
// Count the number of columns to store
num_cols = Sql_NumColumns(handle);
if( num_vars < num_cols ) {
@@ -14566,104 +14357,82 @@ int buildin_query_sql_sub(struct script_state* st, Sql* handle)
ShowWarning("script:query_sql: Too many variables (%u extra).\n", (unsigned int)(num_vars-num_cols));
script_reportsrc(st);
}
-
+
// Store data
for( i = 0; i < max_rows && SQL_SUCCESS == Sql_NextRow(handle); ++i ) {
for( j = 0; j < num_vars; ++j ) {
char* str = NULL;
-
+
if( j < num_cols )
Sql_GetData(handle, j, &str, NULL);
-
+
data = script_getdata(st, j+3);
name = reference_getname(data);
if( is_string_variable(name) )
setd_sub(st, sd, name, i, (void *)(str?str:""), reference_getref(data));
else
- setd_sub(st, sd, name, i, (void *)__64BPRTSIZE((str?atoi(str):0)), reference_getref(data));
+ setd_sub(st, sd, name, i, (void *)__64BPTRSIZE((str?atoi(str):0)), reference_getref(data));
}
}
if( i == max_rows && max_rows < Sql_NumRows(handle) ) {
ShowWarning("script:query_sql: Only %d/%u rows have been stored.\n", max_rows, (unsigned int)Sql_NumRows(handle));
script_reportsrc(st);
}
-
+
// Free data
Sql_FreeResult(handle);
script_pushint(st, i);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(query_sql) {
-#ifdef BETA_THREAD_TEST
- if( st->state != RERUNLINE ) {
- queryThread_add(st,false);
-
- st->state = RERUNLINE;/* will continue when the query is finished running. */
- } else
- st->state = RUN;
-
- return 0;
-#else
+BUILDIN(query_sql) {
return buildin_query_sql_sub(st, mmysql_handle);
-#endif
}
-BUILDIN_FUNC(query_logsql) {
- if( !log_config.sql_logs ) {// logmysql_handle == NULL
+BUILDIN(query_logsql) {
+ if( !logs->config.sql_logs ) {// logmysql_handle == NULL
ShowWarning("buildin_query_logsql: SQL logs are disabled, query '%s' will not be executed.\n", script_getstr(st,2));
script_pushint(st,-1);
- return 1;
+ return false;
}
-#ifdef BETA_THREAD_TEST
- if( st->state != RERUNLINE ) {
- queryThread_add(st,true);
-
- st->state = RERUNLINE;/* will continue when the query is finished running. */
- } else
- st->state = RUN;
-
- return 0;
-#else
return buildin_query_sql_sub(st, logmysql_handle);
-#endif
}
//Allows escaping of a given string.
-BUILDIN_FUNC(escape_sql)
+BUILDIN(escape_sql)
{
const char *str;
char *esc_str;
size_t len;
-
+
str = script_getstr(st,2);
len = strlen(str);
esc_str = (char*)aMalloc(len*2+1);
Sql_EscapeStringLen(mmysql_handle, esc_str, str, len);
script_pushstr(st, esc_str);
- return 0;
+ return true;
}
-BUILDIN_FUNC(getd)
+BUILDIN(getd)
{
char varname[100];
const char *buffer;
int elem;
-
+
buffer = script_getstr(st, 2);
-
+
if(sscanf(buffer, "%[^[][%d]", varname, &elem) < 2)
elem = 0;
-
+
// Push the 'pointer' so it's more flexible [Lance]
push_val(st->stack, C_NAME, reference_uid(add_str(varname), elem));
-
- return 0;
+
+ return true;
}
// <--- [zBuffer] List of dynamic var commands
// Pet stat [Lance]
-BUILDIN_FUNC(petstat)
+BUILDIN(petstat)
{
TBL_PC *sd = NULL;
struct pet_data *pd;
@@ -14674,7 +14443,7 @@ BUILDIN_FUNC(petstat)
script_pushconststr(st, "");
else
script_pushint(st,0);
- return 0;
+ return true;
}
pd = sd->pd;
switch(flag){
@@ -14687,10 +14456,10 @@ BUILDIN_FUNC(petstat)
script_pushint(st,0);
break;
}
- return 0;
+ return true;
}
-BUILDIN_FUNC(callshop)
+BUILDIN(callshop)
{
TBL_PC *sd = NULL;
struct npc_data *nd;
@@ -14699,7 +14468,7 @@ BUILDIN_FUNC(callshop)
sd = script_rid2sd(st);
if (!sd) {
script_pushint(st,0);
- return 0;
+ return true;
}
shopname = script_getstr(st, 2);
if( script_hasdata(st,3) )
@@ -14709,14 +14478,14 @@ BUILDIN_FUNC(callshop)
{
ShowError("buildin_callshop: Shop [%s] not found (or NPC is not shop type)\n", shopname);
script_pushint(st,0);
- return 1;
+ return false;
}
-
+
if( nd->subtype == SHOP )
{
// flag the user as using a valid script call for opening the shop (for floating NPCs)
sd->state.callshop = 1;
-
+
switch( flag )
{
case 1: npc_buysellsel(sd,nd->bl.id,0); break; //Buy window
@@ -14726,28 +14495,28 @@ BUILDIN_FUNC(callshop)
}
else
clif->cashshop_show(sd, nd);
-
+
sd->npc_shopid = nd->bl.id;
script_pushint(st,1);
- return 0;
+ return true;
}
-BUILDIN_FUNC(npcshopitem)
+BUILDIN(npcshopitem)
{
const char* npcname = script_getstr(st, 2);
struct npc_data* nd = npc_name2id(npcname);
int n, i;
int amount;
-
+
if( !nd || ( nd->subtype != SHOP && nd->subtype != CASHSHOP ) )
{ //Not found.
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
// get the count of new entries
amount = (script_lastdata(st)-2)/2;
-
+
// generate new shop item list
RECREATE(nd->u.shop.shop_item, struct npc_item_list, amount);
for( n = 0, i = 3; n < amount; n++, i+=2 )
@@ -14756,27 +14525,27 @@ BUILDIN_FUNC(npcshopitem)
nd->u.shop.shop_item[n].value = script_getnum(st,i+1);
}
nd->u.shop.count = n;
-
+
script_pushint(st,1);
- return 0;
+ return true;
}
-BUILDIN_FUNC(npcshopadditem)
+BUILDIN(npcshopadditem)
{
const char* npcname = script_getstr(st,2);
struct npc_data* nd = npc_name2id(npcname);
int n, i;
int amount;
-
+
if( !nd || ( nd->subtype != SHOP && nd->subtype != CASHSHOP ) )
{ //Not found.
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
// get the count of new entries
amount = (script_lastdata(st)-2)/2;
-
+
// append new items to existing shop item list
RECREATE(nd->u.shop.shop_item, struct npc_item_list, nd->u.shop.count+amount);
for( n = nd->u.shop.count, i = 3; n < nd->u.shop.count+amount; n++, i+=2 )
@@ -14785,12 +14554,12 @@ BUILDIN_FUNC(npcshopadditem)
nd->u.shop.shop_item[n].value = script_getnum(st,i+1);
}
nd->u.shop.count = n;
-
+
script_pushint(st,1);
- return 0;
+ return true;
}
-BUILDIN_FUNC(npcshopdelitem)
+BUILDIN(npcshopdelitem)
{
const char* npcname = script_getstr(st,2);
struct npc_data* nd = npc_name2id(npcname);
@@ -14798,21 +14567,21 @@ BUILDIN_FUNC(npcshopdelitem)
int n, i;
int amount;
int size;
-
+
if( !nd || ( nd->subtype != SHOP && nd->subtype != CASHSHOP ) )
{ //Not found.
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
amount = script_lastdata(st)-2;
size = nd->u.shop.count;
-
+
// remove specified items from the shop item list
for( i = 3; i < 3 + amount; i++ )
{
nameid = script_getnum(st,i);
-
+
ARR_FIND( 0, size, n, nd->u.shop.shop_item[n].nameid == nameid );
if( n < size )
{
@@ -14820,121 +14589,121 @@ BUILDIN_FUNC(npcshopdelitem)
size--;
}
}
-
+
RECREATE(nd->u.shop.shop_item, struct npc_item_list, size);
nd->u.shop.count = size;
-
+
script_pushint(st,1);
- return 0;
+ return true;
}
//Sets a script to attach to a shop npc.
-BUILDIN_FUNC(npcshopattach)
+BUILDIN(npcshopattach)
{
const char* npcname = script_getstr(st,2);
struct npc_data* nd = npc_name2id(npcname);
int flag = 1;
-
+
if( script_hasdata(st,3) )
flag = script_getnum(st,3);
-
+
if( !nd || nd->subtype != SHOP )
{ //Not found.
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
if (flag)
nd->master_nd = ((struct npc_data *)map_id2bl(st->oid));
else
nd->master_nd = NULL;
-
+
script_pushint(st,1);
- return 0;
+ return true;
}
/*==========================================
* Returns some values of an item [Lupus]
* Price, Weight, etc...
- setitemscript(itemID,"{new item bonus script}",[n]);
- Where n:
- 0 - script
- 1 - Equip script
- 2 - Unequip script
+ setitemscript(itemID,"{new item bonus script}",[n]);
+ Where n:
+ 0 - script
+ 1 - Equip script
+ 2 - Unequip script
*------------------------------------------*/
-BUILDIN_FUNC(setitemscript)
+BUILDIN(setitemscript)
{
int item_id,n=0;
const char *script;
struct item_data *i_data;
struct script_code **dstscript;
-
+
item_id = script_getnum(st,2);
script = script_getstr(st,3);
if( script_hasdata(st,4) )
n=script_getnum(st,4);
i_data = itemdb_exists(item_id);
-
+
if (!i_data || script==NULL || ( script[0] && script[0]!='{' )) {
script_pushint(st,0);
- return 0;
+ return true;
}
switch (n) {
- case 2:
- dstscript = &i_data->unequip_script;
- break;
- case 1:
- dstscript = &i_data->equip_script;
- break;
- default:
- dstscript = &i_data->script;
- break;
+ case 2:
+ dstscript = &i_data->unequip_script;
+ break;
+ case 1:
+ dstscript = &i_data->equip_script;
+ break;
+ default:
+ dstscript = &i_data->script;
+ break;
}
if(*dstscript)
script_free_code(*dstscript);
-
+
*dstscript = script[0] ? parse_script(script, "script_setitemscript", 0, 0) : NULL;
script_pushint(st,1);
- return 0;
+ return true;
}
/* Work In Progress [Lupus]
-BUILDIN_FUNC(addmonsterdrop)
-{
- int class_,item_id,chance;
- class_=script_getnum(st,2);
- item_id=script_getnum(st,3);
- chance=script_getnum(st,4);
- if(class_>1000 && item_id>500 && chance>0) {
- script_pushint(st,1);
- } else {
- script_pushint(st,0);
- }
-}
-
-BUILDIN_FUNC(delmonsterdrop)
-{
- int class_,item_id;
- class_=script_getnum(st,2);
- item_id=script_getnum(st,3);
- if(class_>1000 && item_id>500) {
- script_pushint(st,1);
- } else {
- script_pushint(st,0);
- }
-}
-*/
+ BUILDIN(addmonsterdrop)
+ {
+ int class_,item_id,chance;
+ class_=script_getnum(st,2);
+ item_id=script_getnum(st,3);
+ chance=script_getnum(st,4);
+ if(class_>1000 && item_id>500 && chance>0) {
+ script_pushint(st,1);
+ } else {
+ script_pushint(st,0);
+ }
+ }
+
+ BUILDIN(delmonsterdrop)
+ {
+ int class_,item_id;
+ class_=script_getnum(st,2);
+ item_id=script_getnum(st,3);
+ if(class_>1000 && item_id>500) {
+ script_pushint(st,1);
+ } else {
+ script_pushint(st,0);
+ }
+ }
+ */
/*==========================================
* Returns some values of a monster [Lupus]
* Name, Level, race, size, etc...
- getmonsterinfo(monsterID,queryIndex);
+ getmonsterinfo(monsterID,queryIndex);
*------------------------------------------*/
-BUILDIN_FUNC(getmonsterinfo)
+BUILDIN(getmonsterinfo)
{
struct mob_db *mob;
int mob_id;
-
+
mob_id = script_getnum(st,2);
if (!mobdb_checkid(mob_id)) {
ShowError("buildin_getmonsterinfo: Wrong Monster ID: %i\n", mob_id);
@@ -14971,94 +14740,94 @@ BUILDIN_FUNC(getmonsterinfo)
case 22: script_pushint(st,mob->mexp); break;
default: script_pushint(st,-1); //wrong Index
}
- return 0;
+ return true;
}
-BUILDIN_FUNC(checkvending) // check vending [Nab4]
+BUILDIN(checkvending) // check vending [Nab4]
{
TBL_PC *sd = NULL;
-
+
if(script_hasdata(st,2))
sd = map_nick2sd(script_getstr(st,2));
else
sd = script_rid2sd(st);
-
+
if(sd)
script_pushint(st, sd->state.autotrade ? 2 : sd->state.vending);
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(checkchatting) // check chatting [Marka]
+BUILDIN(checkchatting) // check chatting [Marka]
{
TBL_PC *sd = NULL;
-
+
if(script_hasdata(st,2))
sd = map_nick2sd(script_getstr(st,2));
else
sd = script_rid2sd(st);
-
+
if(sd)
script_pushint(st,(sd->chatID != 0));
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(checkidle)
+BUILDIN(checkidle)
{
TBL_PC *sd = NULL;
-
+
if (script_hasdata(st, 2))
sd = map_nick2sd(script_getstr(st, 2));
else
sd = script_rid2sd(st);
-
+
if (sd)
script_pushint(st, DIFF_TICK(last_tick, sd->idletime));
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(searchitem)
+BUILDIN(searchitem)
{
struct script_data* data = script_getdata(st, 2);
const char *itemname = script_getstr(st,3);
struct item_data *items[MAX_SEARCH];
int count;
-
+
char* name;
int32 start;
int32 id;
int32 i;
TBL_PC* sd = NULL;
-
+
if ((items[0] = itemdb_exists(atoi(itemname))))
count = 1;
else {
count = itemdb_searchname_array(items, ARRAYLENGTH(items), itemname);
if (count > MAX_SEARCH) count = MAX_SEARCH;
}
-
+
if (!count) {
script_pushint(st, 0);
- return 0;
+ return true;
}
-
+
if( !data_isreference(data) )
{
ShowError("script:searchitem: not a variable\n");
script_reportdata(data);
st->state = END;
- return 1;// not a variable
+ return false;// not a variable
}
-
+
id = reference_getid(data);
start = reference_getindex(data);
name = reference_getname(data);
@@ -15067,32 +14836,32 @@ BUILDIN_FUNC(searchitem)
ShowError("script:searchitem: illegal scope\n");
script_reportdata(data);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
if( not_server_variable(*name) )
{
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached
+ return true;// no player attached
}
-
+
if( is_string_variable(name) )
{// string array
ShowError("script:searchitem: not an integer array reference\n");
script_reportdata(data);
st->state = END;
- return 1;// not supported
+ return false;// not supported
}
-
+
for( i = 0; i < count; ++start, ++i )
{// Set array
- void* v = (void*)__64BPRTSIZE((int)items[i]->nameid);
+ void* v = (void*)__64BPTRSIZE((int)items[i]->nameid);
set_reg(st, sd, reference_uid(id, start), name, v, reference_getref(data));
}
-
+
script_pushint(st, count);
- return 0;
+ return true;
}
int axtoi(const char *hexStg)
@@ -15129,15 +14898,15 @@ int axtoi(const char *hexStg)
}
// [Lance] Hex string to integer converter
-BUILDIN_FUNC(axtoi)
+BUILDIN(axtoi)
{
const char *hex = script_getstr(st,2);
script_pushint(st,axtoi(hex));
- return 0;
+ return true;
}
// [zBuffer] List of player cont commands --->
-BUILDIN_FUNC(rid2name)
+BUILDIN(rid2name)
{
struct block_list *bl = NULL;
int rid = script_getnum(st,2);
@@ -15159,65 +14928,65 @@ BUILDIN_FUNC(rid2name)
ShowError("buildin_rid2name: invalid RID\n");
script_pushconststr(st,"(null)");
}
- return 0;
+ return true;
}
-BUILDIN_FUNC(pcblockmove)
+BUILDIN(pcblockmove)
{
int id, flag;
TBL_PC *sd = NULL;
-
+
id = script_getnum(st,2);
flag = script_getnum(st,3);
-
+
if(id)
sd = map_id2sd(id);
else
sd = script_rid2sd(st);
-
+
if(sd)
sd->state.blockedmove = flag > 0;
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(pcfollow)
+BUILDIN(pcfollow)
{
int id, targetid;
TBL_PC *sd = NULL;
-
-
+
+
id = script_getnum(st,2);
targetid = script_getnum(st,3);
-
+
if(id)
sd = map_id2sd(id);
else
sd = script_rid2sd(st);
-
+
if(sd)
pc_follow(sd, targetid);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(pcstopfollow)
+BUILDIN(pcstopfollow)
{
int id;
TBL_PC *sd = NULL;
-
-
+
+
id = script_getnum(st,2);
-
+
if(id)
sd = map_id2sd(id);
else
sd = script_rid2sd(st);
-
+
if(sd)
pc_stop_following(sd);
-
- return 0;
+
+ return true;
}
// <--- [zBuffer] List of player cont commands
// [zBuffer] List of mob control commands --->
@@ -15228,10 +14997,10 @@ BUILDIN_FUNC(pcstopfollow)
///
/// unitwalk(<unit_id>,<x>,<y>) -> <bool>
/// unitwalk(<unit_id>,<map_id>) -> <bool>
-BUILDIN_FUNC(unitwalk)
+BUILDIN(unitwalk)
{
struct block_list* bl;
-
+
bl = map_id2bl(script_getnum(st,2));
if( bl == NULL )
{
@@ -15248,27 +15017,27 @@ BUILDIN_FUNC(unitwalk)
int map_id = script_getnum(st,3);
script_pushint(st, unit_walktobl(bl,map_id2bl(map_id),65025,1));
}
-
- return 0;
+
+ return true;
}
/// Kills the unit
///
/// unitkill <unit_id>;
-BUILDIN_FUNC(unitkill)
+BUILDIN(unitkill)
{
struct block_list* bl = map_id2bl(script_getnum(st,2));
if( bl != NULL )
status_kill(bl);
-
- return 0;
+
+ return true;
}
/// Warps the unit to the target position in the target map
/// Returns if it was successfull
///
/// unitwarp(<unit_id>,"<map name>",<x>,<y>) -> <bool>
-BUILDIN_FUNC(unitwarp)
+BUILDIN(unitwarp)
{
int unit_id;
int map;
@@ -15276,28 +15045,28 @@ BUILDIN_FUNC(unitwarp)
short y;
struct block_list* bl;
const char *mapname;
-
+
unit_id = script_getnum(st,2);
mapname = script_getstr(st, 3);
x = (short)script_getnum(st,4);
y = (short)script_getnum(st,5);
-
+
if (!unit_id) //Warp the script's runner
bl = map_id2bl(st->rid);
else
bl = map_id2bl(unit_id);
-
+
if( strcmp(mapname,"this") == 0 )
map = bl?bl->m:-1;
else
map = map_mapname2mapid(mapname);
-
+
if( map >= 0 && bl != NULL )
script_pushint(st, unit_warp(bl,map,x,y,CLR_OUTSIGHT));
else
script_pushint(st, 0);
-
- return 0;
+
+ return true;
}
/// Makes the unit attack the target.
@@ -15307,20 +15076,20 @@ BUILDIN_FUNC(unitwarp)
///
/// unitattack(<unit_id>,"<target name>"{,<action type>}) -> <bool>
/// unitattack(<unit_id>,<target_id>{,<action type>}) -> <bool>
-BUILDIN_FUNC(unitattack)
+BUILDIN(unitattack)
{
struct block_list* unit_bl;
struct block_list* target_bl = NULL;
struct script_data* data;
int actiontype = 0;
-
+
// get unit
unit_bl = map_id2bl(script_getnum(st,2));
if( unit_bl == NULL ) {
script_pushint(st, 0);
- return 0;
+ return true;
}
-
+
data = script_getdata(st, 3);
get_val(st, data);
if( data_isstring(data) )
@@ -15334,44 +15103,44 @@ BUILDIN_FUNC(unitattack)
if( target_bl == NULL )
{
script_pushint(st, 0);
- return 0;
+ return true;
}
-
+
// get actiontype
if( script_hasdata(st,4) )
actiontype = script_getnum(st,4);
-
+
switch( unit_bl->type )
{
- case BL_PC:
- clif->pActionRequest_sub(((TBL_PC *)unit_bl), actiontype > 0 ? 0x07 : 0x00, target_bl->id, gettick());
- script_pushint(st, 1);
- return 0;
- case BL_MOB:
- ((TBL_MOB *)unit_bl)->target_id = target_bl->id;
- break;
- case BL_PET:
- ((TBL_PET *)unit_bl)->target_id = target_bl->id;
- break;
- default:
- ShowError("script:unitattack: unsupported source unit type %d\n", unit_bl->type);
- script_pushint(st, 0);
- return 1;
+ case BL_PC:
+ clif->pActionRequest_sub(((TBL_PC *)unit_bl), actiontype > 0 ? 0x07 : 0x00, target_bl->id, gettick());
+ script_pushint(st, 1);
+ return true;
+ case BL_MOB:
+ ((TBL_MOB *)unit_bl)->target_id = target_bl->id;
+ break;
+ case BL_PET:
+ ((TBL_PET *)unit_bl)->target_id = target_bl->id;
+ break;
+ default:
+ ShowError("script:unitattack: unsupported source unit type %d\n", unit_bl->type);
+ script_pushint(st, 0);
+ return false;
}
script_pushint(st, unit_walktobl(unit_bl, target_bl, 65025, 2));
- return 0;
+ return true;
}
/// Makes the unit stop attacking and moving
///
/// unitstop <unit_id>;
-BUILDIN_FUNC(unitstop)
+BUILDIN(unitstop)
{
int unit_id;
struct block_list* bl;
-
+
unit_id = script_getnum(st,2);
-
+
bl = map_id2bl(unit_id);
if( bl != NULL )
{
@@ -15380,22 +15149,22 @@ BUILDIN_FUNC(unitstop)
if( bl->type == BL_MOB )
((TBL_MOB*)bl)->target_id = 0;
}
-
- return 0;
+
+ return true;
}
/// Makes the unit say the message
///
/// unittalk <unit_id>,"<message>";
-BUILDIN_FUNC(unittalk)
+BUILDIN(unittalk)
{
int unit_id;
const char* message;
struct block_list* bl;
-
+
unit_id = script_getnum(st,2);
message = script_getstr(st, 3);
-
+
bl = map_id2bl(unit_id);
if( bl != NULL )
{
@@ -15407,8 +15176,8 @@ BUILDIN_FUNC(unittalk)
clif->message(((TBL_PC*)bl)->fd, StringBuf_Value(&sbuf));
StringBuf_Destroy(&sbuf);
}
-
- return 0;
+
+ return true;
}
/// Makes the unit do an emotion
@@ -15416,50 +15185,50 @@ BUILDIN_FUNC(unittalk)
/// unitemote <unit_id>,<emotion>;
///
/// @see e_* in const.txt
-BUILDIN_FUNC(unitemote)
+BUILDIN(unitemote)
{
int unit_id;
int emotion;
struct block_list* bl;
-
+
unit_id = script_getnum(st,2);
emotion = script_getnum(st,3);
bl = map_id2bl(unit_id);
if( bl != NULL )
clif->emotion(bl, emotion);
-
- return 0;
+
+ return true;
}
/// Makes the unit cast the skill on the target or self if no target is specified
///
/// unitskilluseid <unit_id>,<skill_id>,<skill_lv>{,<target_id>};
/// unitskilluseid <unit_id>,"<skill name>",<skill_lv>{,<target_id>};
-BUILDIN_FUNC(unitskilluseid)
+BUILDIN(unitskilluseid)
{
int unit_id;
uint16 skill_id;
uint16 skill_lv;
int target_id;
struct block_list* bl;
-
+
unit_id = script_getnum(st,2);
skill_id = ( script_isstring(st,3) ? skill->name2id(script_getstr(st,3)) : script_getnum(st,3) );
skill_lv = script_getnum(st,4);
target_id = ( script_hasdata(st,5) ? script_getnum(st,5) : unit_id );
-
+
bl = map_id2bl(unit_id);
if( bl != NULL )
unit_skilluse_id(bl, target_id, skill_id, skill_lv);
-
- return 0;
+
+ return true;
}
/// Makes the unit cast the skill on the target position.
///
/// unitskillusepos <unit_id>,<skill_id>,<skill_lv>,<target_x>,<target_y>;
/// unitskillusepos <unit_id>,"<skill name>",<skill_lv>,<target_x>,<target_y>;
-BUILDIN_FUNC(unitskillusepos)
+BUILDIN(unitskillusepos)
{
int unit_id;
uint16 skill_id;
@@ -15467,18 +15236,18 @@ BUILDIN_FUNC(unitskillusepos)
int skill_x;
int skill_y;
struct block_list* bl;
-
+
unit_id = script_getnum(st,2);
skill_id = ( script_isstring(st,3) ? skill->name2id(script_getstr(st,3)) : script_getnum(st,3) );
skill_lv = script_getnum(st,4);
skill_x = script_getnum(st,5);
skill_y = script_getnum(st,6);
-
+
bl = map_id2bl(unit_id);
if( bl != NULL )
unit_skilluse_pos(bl, skill_x, skill_y, skill_id, skill_lv);
-
- return 0;
+
+ return true;
}
// <--- [zBuffer] List of mob control commands
@@ -15486,15 +15255,15 @@ BUILDIN_FUNC(unitskillusepos)
/// Pauses the execution of the script, detaching the player
///
/// sleep <mili seconds>;
-BUILDIN_FUNC(sleep)
+BUILDIN(sleep)
{
int ticks;
-
+
ticks = script_getnum(st,2);
-
+
// detach the player
script_detach_rid(st);
-
+
if( ticks <= 0 )
{// do nothing
}
@@ -15508,19 +15277,19 @@ BUILDIN_FUNC(sleep)
st->state = RUN;
st->sleep.tick = 0;
}
- return 0;
+ return true;
}
/// Pauses the execution of the script, keeping the player attached
/// Returns if a player is still attached
///
/// sleep2(<mili secconds>) -> <bool>
-BUILDIN_FUNC(sleep2)
+BUILDIN(sleep2)
{
int ticks;
-
+
ticks = script_getnum(st,2);
-
+
if( ticks <= 0 )
{// do nothing
script_pushint(st, (map_id2sd(st->rid)!=NULL));
@@ -15536,30 +15305,30 @@ BUILDIN_FUNC(sleep2)
st->sleep.tick = 0;
script_pushint(st, (map_id2sd(st->rid)!=NULL));
}
- return 0;
+ return true;
}
/// Awakes all the sleep timers of the target npc
///
/// awake "<npc name>";
-BUILDIN_FUNC(awake)
+BUILDIN(awake)
{
struct npc_data* nd;
struct linkdb_node *node = (struct linkdb_node *)sleep_db;
-
+
nd = npc_name2id(script_getstr(st, 2));
if( nd == NULL ) {
ShowError("awake: NPC \"%s\" not found\n", script_getstr(st, 2));
- return 1;
+ return false;
}
-
+
while( node )
{
- if( (int)__64BPRTSIZE(node->key) == nd->bl.id )
+ if( (int)__64BPTRSIZE(node->key) == nd->bl.id )
{// sleep timer for the npc
struct script_state* tst = (struct script_state*)node->data;
TBL_PC* sd = map_id2sd(tst->rid);
-
+
if( tst->sleep.timer == INVALID_TIMER )
{// already awake ???
node = node->next;
@@ -15570,7 +15339,7 @@ BUILDIN_FUNC(awake)
tst->state = END;
tst->rid = 0;
}
-
+
delete_timer(tst->sleep.timer, run_script_timer);
node = script_erase_sleepdb(node);
tst->sleep.timer = INVALID_TIMER;
@@ -15583,19 +15352,19 @@ BUILDIN_FUNC(awake)
node = node->next;
}
}
- return 0;
+ return true;
}
/// Returns a reference to a variable of the target NPC.
/// Returns 0 if an error occurs.
///
/// getvariableofnpc(<variable>, "<npc name>") -> <reference>
-BUILDIN_FUNC(getvariableofnpc)
+BUILDIN(getvariableofnpc)
{
struct script_data* data;
const char* name;
struct npc_data* nd;
-
+
data = script_getdata(st,2);
if( !data_isreference(data) )
{// Not a reference (aka varaible name)
@@ -15603,9 +15372,9 @@ BUILDIN_FUNC(getvariableofnpc)
script_reportdata(data);
script_pushnil(st);
st->state = END;
- return 1;
+ return false;
}
-
+
name = reference_getname(data);
if( *name != '.' || name[1] == '@' )
{// not a npc variable
@@ -15613,20 +15382,20 @@ BUILDIN_FUNC(getvariableofnpc)
script_reportdata(data);
script_pushnil(st);
st->state = END;
- return 1;
+ return false;
}
-
+
nd = npc_name2id(script_getstr(st,3));
if( nd == NULL || nd->subtype != SCRIPT || nd->u.scr.script == NULL )
{// NPC not found or has no script
ShowError("script:getvariableofnpc: can't find npc %s\n", script_getstr(st,3));
script_pushnil(st);
st->state = END;
- return 1;
+ return false;
}
-
+
push_val2(st->stack, C_NAME, reference_getuid(data), &nd->u.scr.script->script_vars );
- return 0;
+ return true;
}
/// Opens a warp portal.
@@ -15635,7 +15404,7 @@ BUILDIN_FUNC(getvariableofnpc)
/// warpportal <source x>,<source y>,"<target map>",<target x>,<target y>;
///
/// @author blackhole89
-BUILDIN_FUNC(warpportal)
+BUILDIN(warpportal)
{
int spx;
int spy;
@@ -15644,56 +15413,57 @@ BUILDIN_FUNC(warpportal)
int tpy;
struct skill_unit_group* group;
struct block_list* bl;
-
+
bl = map_id2bl(st->oid);
if( bl == NULL )
{
ShowError("script:warpportal: npc is needed\n");
- return 1;
+ return false;
}
-
+
spx = script_getnum(st,2);
spy = script_getnum(st,3);
mapindex = mapindex_name2id(script_getstr(st, 4));
tpx = script_getnum(st,5);
tpy = script_getnum(st,6);
-
+
if( mapindex == 0 )
- return 0;// map not found
-
+ return true;// map not found
+
group = skill->unitsetting(bl, AL_WARP, 4, spx, spy, 0);
if( group == NULL )
- return 0;// failed
+ return true;// failed
+ group->val1 = (group->val1<<16)|(short)0;
group->val2 = (tpx<<16) | tpy;
group->val3 = mapindex;
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(openmail)
+BUILDIN(openmail)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
mail_openmail(sd);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(openauction)
+BUILDIN(openauction)
{
TBL_PC* sd;
-
+
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;
-
+ return true;
+
clif->auction_openwindow(sd);
-
- return 0;
+
+ return true;
}
/// Retrieves the value of the specified flag of the specified cell.
@@ -15701,16 +15471,16 @@ BUILDIN_FUNC(openauction)
/// checkcell("<map name>",<x>,<y>,<type>) -> <bool>
///
/// @see cell_chk* constants in const.txt for the types
-BUILDIN_FUNC(checkcell)
+BUILDIN(checkcell)
{
int16 m = map_mapname2mapid(script_getstr(st,2));
int16 x = script_getnum(st,3);
int16 y = script_getnum(st,4);
cell_chk type = (cell_chk)script_getnum(st,5);
-
+
script_pushint(st, map_getcell(m, x, y, type));
-
- return 0;
+
+ return true;
}
/// Modifies flags of cells in the specified area.
@@ -15718,7 +15488,7 @@ BUILDIN_FUNC(checkcell)
/// setcell "<map name>",<x1>,<y1>,<x2>,<y2>,<type>,<flag>;
///
/// @see cell_* constants in const.txt for the types
-BUILDIN_FUNC(setcell)
+BUILDIN(setcell)
{
int16 m = map_mapname2mapid(script_getstr(st,2));
int16 x1 = script_getnum(st,3);
@@ -15727,79 +15497,79 @@ BUILDIN_FUNC(setcell)
int16 y2 = script_getnum(st,6);
cell_t type = (cell_t)script_getnum(st,7);
bool flag = (bool)script_getnum(st,8);
-
+
int x,y;
-
+
if( x1 > x2 ) swap(x1,x2);
if( y1 > y2 ) swap(y1,y2);
-
+
for( y = y1; y <= y2; ++y )
for( x = x1; x <= x2; ++x )
map_setcell(m, x, y, type, flag);
-
- return 0;
+
+ return true;
}
/*==========================================
* Mercenary Commands
*------------------------------------------*/
-BUILDIN_FUNC(mercenary_create)
+BUILDIN(mercenary_create)
{
struct map_session_data *sd;
int class_, contract_time;
-
+
if( (sd = script_rid2sd(st)) == NULL || sd->md || sd->status.mer_id != 0 )
- return 0;
-
+ return true;
+
class_ = script_getnum(st,2);
-
+
if( !merc_class(class_) )
- return 0;
-
+ return true;
+
contract_time = script_getnum(st,3);
merc_create(sd, class_, contract_time);
- return 0;
+ return true;
}
-BUILDIN_FUNC(mercenary_heal)
+BUILDIN(mercenary_heal)
{
struct map_session_data *sd = script_rid2sd(st);
int hp, sp;
-
+
if( sd == NULL || sd->md == NULL )
- return 0;
+ return true;
hp = script_getnum(st,2);
sp = script_getnum(st,3);
-
+
status_heal(&sd->md->bl, hp, sp, 0);
- return 0;
+ return true;
}
-BUILDIN_FUNC(mercenary_sc_start)
+BUILDIN(mercenary_sc_start)
{
struct map_session_data *sd = script_rid2sd(st);
enum sc_type type;
int tick, val1;
-
+
if( sd == NULL || sd->md == NULL )
- return 0;
-
+ return true;
+
type = (sc_type)script_getnum(st,2);
tick = script_getnum(st,3);
val1 = script_getnum(st,4);
-
+
status_change_start(&sd->md->bl, type, 10000, val1, 0, 0, 0, tick, 2);
- return 0;
+ return true;
}
-BUILDIN_FUNC(mercenary_get_calls)
+BUILDIN(mercenary_get_calls)
{
struct map_session_data *sd = script_rid2sd(st);
int guild;
-
+
if( sd == NULL )
- return 0;
-
+ return true;
+
guild = script_getnum(st,2);
switch( guild )
{
@@ -15816,21 +15586,21 @@ BUILDIN_FUNC(mercenary_get_calls)
script_pushint(st,0);
break;
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(mercenary_set_calls)
+BUILDIN(mercenary_set_calls)
{
struct map_session_data *sd = script_rid2sd(st);
int guild, value, *calls;
-
+
if( sd == NULL )
- return 0;
-
+ return true;
+
guild = script_getnum(st,2);
value = script_getnum(st,3);
-
+
switch( guild )
{
case ARCH_MERC_GUILD:
@@ -15843,23 +15613,23 @@ BUILDIN_FUNC(mercenary_set_calls)
calls = &sd->status.sword_calls;
break;
default:
- return 0; // Invalid Guild
+ return true; // Invalid Guild
}
-
+
*calls += value;
*calls = cap_value(*calls, 0, INT_MAX);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(mercenary_get_faith)
+BUILDIN(mercenary_get_faith)
{
struct map_session_data *sd = script_rid2sd(st);
int guild;
-
+
if( sd == NULL )
- return 0;
-
+ return true;
+
guild = script_getnum(st,2);
switch( guild )
{
@@ -15876,21 +15646,21 @@ BUILDIN_FUNC(mercenary_get_faith)
script_pushint(st,0);
break;
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(mercenary_set_faith)
+BUILDIN(mercenary_set_faith)
{
struct map_session_data *sd = script_rid2sd(st);
int guild, value, *calls;
-
+
if( sd == NULL )
- return 0;
-
+ return true;
+
guild = script_getnum(st,2);
value = script_getnum(st,3);
-
+
switch( guild )
{
case ARCH_MERC_GUILD:
@@ -15903,130 +15673,130 @@ BUILDIN_FUNC(mercenary_set_faith)
calls = &sd->status.sword_faith;
break;
default:
- return 0; // Invalid Guild
+ return true; // Invalid Guild
}
-
+
*calls += value;
*calls = cap_value(*calls, 0, INT_MAX);
if( mercenary_get_guild(sd->md) == guild )
clif->mercenary_updatestatus(sd,SP_MERCFAITH);
-
- return 0;
+
+ return true;
}
/*------------------------------------------
* Book Reading
*------------------------------------------*/
-BUILDIN_FUNC(readbook)
+BUILDIN(readbook)
{
struct map_session_data *sd;
int book_id, page;
-
+
if( (sd = script_rid2sd(st)) == NULL )
- return 0;
-
+ return true;
+
book_id = script_getnum(st,2);
page = script_getnum(st,3);
-
+
clif->readbook(sd->fd, book_id, page);
- return 0;
+ return true;
}
/******************
-Questlog script commands
-*******************/
+ Questlog script commands
+ *******************/
-BUILDIN_FUNC(setquest)
+BUILDIN(setquest)
{
struct map_session_data *sd = script_rid2sd(st);
nullpo_ret(sd);
-
+
quest_add(sd, script_getnum(st, 2));
- return 0;
+ return true;
}
-BUILDIN_FUNC(erasequest)
+BUILDIN(erasequest)
{
struct map_session_data *sd = script_rid2sd(st);
nullpo_ret(sd);
-
+
quest_delete(sd, script_getnum(st, 2));
- return 0;
+ return true;
}
-BUILDIN_FUNC(completequest)
+BUILDIN(completequest)
{
struct map_session_data *sd = script_rid2sd(st);
nullpo_ret(sd);
-
+
quest_update_status(sd, script_getnum(st, 2), Q_COMPLETE);
- return 0;
+ return true;
}
-BUILDIN_FUNC(changequest)
+BUILDIN(changequest)
{
struct map_session_data *sd = script_rid2sd(st);
nullpo_ret(sd);
-
+
quest_change(sd, script_getnum(st, 2),script_getnum(st, 3));
- return 0;
+ return true;
}
-BUILDIN_FUNC(checkquest)
+BUILDIN(checkquest)
{
struct map_session_data *sd = script_rid2sd(st);
quest_check_type type = HAVEQUEST;
-
+
nullpo_ret(sd);
-
+
if( script_hasdata(st, 3) )
type = (quest_check_type)script_getnum(st, 3);
-
+
script_pushint(st, quest_check(sd, script_getnum(st, 2), type));
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(showevent)
+BUILDIN(showevent)
{
TBL_PC *sd = script_rid2sd(st);
struct npc_data *nd = map_id2nd(st->oid);
int state, color;
-
+
if( sd == NULL || nd == NULL )
- return 0;
+ return true;
state = script_getnum(st, 2);
color = script_getnum(st, 3);
-
+
if( color < 0 || color > 3 )
- color = 0; // set default color
-
+ color = 0; // set default color
+
clif->quest_show_event(sd, &nd->bl, state, color);
- return 0;
+ return true;
}
/*==========================================
* BattleGround System
*------------------------------------------*/
-BUILDIN_FUNC(waitingroom2bg)
+BUILDIN(waitingroom2bg)
{
struct npc_data *nd;
struct chat_data *cd;
const char *map_name, *ev = "", *dev = "";
int x, y, i, mapindex = 0, bg_id, n;
struct map_session_data *sd;
-
+
if( script_hasdata(st,7) )
nd = npc_name2id(script_getstr(st,7));
else
nd = (struct npc_data *)map_id2bl(st->oid);
-
+
if( nd == NULL || (cd = (struct chat_data *)map_id2bl(nd->chat_id)) == NULL )
{
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
map_name = script_getstr(st,2);
if( strcmp(map_name,"-") != 0 )
{
@@ -16034,21 +15804,21 @@ BUILDIN_FUNC(waitingroom2bg)
if( mapindex == 0 )
{ // Invalid Map
script_pushint(st,0);
- return 0;
+ return true;
}
}
-
+
x = script_getnum(st,3);
y = script_getnum(st,4);
ev = script_getstr(st,5); // Logout Event
dev = script_getstr(st,6); // Die Event
-
+
if( (bg_id = bg_create(mapindex, x, y, ev, dev)) == 0 )
{ // Creation failed
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
n = cd->users;
for( i = 0; i < n && i < MAX_BG_MEMBERS; i++ )
{
@@ -16057,35 +15827,35 @@ BUILDIN_FUNC(waitingroom2bg)
else
mapreg_setreg(reference_uid(add_str("$@arenamembers"), i), 0);
}
-
+
mapreg_setreg(add_str("$@arenamembersnum"), i);
script_pushint(st,bg_id);
- return 0;
+ return true;
}
-BUILDIN_FUNC(waitingroom2bg_single)
+BUILDIN(waitingroom2bg_single)
{
const char* map_name;
struct npc_data *nd;
struct chat_data *cd;
struct map_session_data *sd;
int x, y, mapindex, bg_id;
-
+
bg_id = script_getnum(st,2);
map_name = script_getstr(st,3);
if( (mapindex = mapindex_name2id(map_name)) == 0 )
- return 0; // Invalid Map
-
+ return true; // Invalid Map
+
x = script_getnum(st,4);
y = script_getnum(st,5);
nd = npc_name2id(script_getstr(st,6));
-
+
if( nd == NULL || (cd = (struct chat_data *)map_id2bl(nd->chat_id)) == NULL || cd->users <= 0 )
- return 0;
-
+ return true;
+
if( (sd = cd->usersd[0]) == NULL )
- return 0;
-
+ return true;
+
if( bg_team_join(bg_id, sd) )
{
pc_setpos(sd, mapindex, x, y, CLR_TELEPORT);
@@ -16093,44 +15863,44 @@ BUILDIN_FUNC(waitingroom2bg_single)
}
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(bg_team_setxy)
+BUILDIN(bg_team_setxy)
{
struct battleground_data *bg;
int bg_id;
-
+
bg_id = script_getnum(st,2);
if( (bg = bg_team_search(bg_id)) == NULL )
- return 0;
-
+ return true;
+
bg->x = script_getnum(st,3);
bg->y = script_getnum(st,4);
- return 0;
+ return true;
}
-BUILDIN_FUNC(bg_warp)
+BUILDIN(bg_warp)
{
int x, y, mapindex, bg_id;
const char* map_name;
-
+
bg_id = script_getnum(st,2);
map_name = script_getstr(st,3);
if( (mapindex = mapindex_name2id(map_name)) == 0 )
- return 0; // Invalid Map
+ return true; // Invalid Map
x = script_getnum(st,4);
y = script_getnum(st,5);
bg_team_warp(bg_id, mapindex, x, y);
- return 0;
+ return true;
}
-BUILDIN_FUNC(bg_monster)
+BUILDIN(bg_monster)
{
int class_ = 0, x = 0, y = 0, bg_id = 0;
const char *str,*map, *evt="";
-
+
bg_id = script_getnum(st,2);
map = script_getstr(st,3);
x = script_getnum(st,4);
@@ -16140,47 +15910,47 @@ BUILDIN_FUNC(bg_monster)
if( script_hasdata(st,8) ) evt = script_getstr(st,8);
check_event(st, evt);
script_pushint(st, mob_spawn_bg(map,x,y,str,class_,evt,bg_id));
- return 0;
+ return true;
}
-BUILDIN_FUNC(bg_monster_set_team)
+BUILDIN(bg_monster_set_team)
{
struct mob_data *md;
struct block_list *mbl;
int id = script_getnum(st,2),
- bg_id = script_getnum(st,3);
-
+ bg_id = script_getnum(st,3);
+
if( (mbl = map_id2bl(id)) == NULL || mbl->type != BL_MOB )
- return 0;
+ return true;
md = (TBL_MOB *)mbl;
md->bg_id = bg_id;
-
+
mob_stop_attack(md);
mob_stop_walking(md, 0);
md->target_id = md->attacked_id = 0;
clif->charnameack(0, &md->bl);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(bg_leave)
+BUILDIN(bg_leave)
{
struct map_session_data *sd = script_rid2sd(st);
if( sd == NULL || !sd->bg_id )
- return 0;
-
+ return true;
+
bg_team_leave(sd,0);
- return 0;
+ return true;
}
-BUILDIN_FUNC(bg_destroy)
+BUILDIN(bg_destroy)
{
int bg_id = script_getnum(st,2);
bg_team_delete(bg_id);
- return 0;
+ return true;
}
-BUILDIN_FUNC(bg_getareausers)
+BUILDIN(bg_getareausers)
{
const char *str;
int16 m, x0, y0, x1, y1;
@@ -16188,21 +15958,21 @@ BUILDIN_FUNC(bg_getareausers)
int i = 0, c = 0;
struct battleground_data *bg = NULL;
struct map_session_data *sd;
-
+
bg_id = script_getnum(st,2);
str = script_getstr(st,3);
-
+
if( (bg = bg_team_search(bg_id)) == NULL || (m = map_mapname2mapid(str)) < 0 )
{
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
x0 = script_getnum(st,4);
y0 = script_getnum(st,5);
x1 = script_getnum(st,6);
y1 = script_getnum(st,7);
-
+
for( i = 0; i < MAX_BG_MEMBERS; i++ )
{
if( (sd = bg->members[i].sd) == NULL )
@@ -16211,39 +15981,39 @@ BUILDIN_FUNC(bg_getareausers)
continue;
c++;
}
-
+
script_pushint(st,c);
- return 0;
+ return true;
}
-BUILDIN_FUNC(bg_updatescore)
+BUILDIN(bg_updatescore)
{
const char *str;
int16 m;
-
+
str = script_getstr(st,2);
if( (m = map_mapname2mapid(str)) < 0 )
- return 0;
-
+ return true;
+
map[m].bgscore_lion = script_getnum(st,3);
map[m].bgscore_eagle = script_getnum(st,4);
-
+
clif->bg_updatescore(m);
- return 0;
+ return true;
}
-BUILDIN_FUNC(bg_get_data)
+BUILDIN(bg_get_data)
{
struct battleground_data *bg;
int bg_id = script_getnum(st,2),
- type = script_getnum(st,3);
-
+ type = script_getnum(st,3);
+
if( (bg = bg_team_search(bg_id)) == NULL )
{
script_pushint(st,0);
- return 0;
+ return true;
}
-
+
switch( type )
{
case 0: script_pushint(st, bg->count); break;
@@ -16251,102 +16021,102 @@ BUILDIN_FUNC(bg_get_data)
ShowError("script:bg_get_data: unknown data identifier %d\n", type);
break;
}
-
- return 0;
+
+ return true;
}
/*==========================================
* Instancing Script Commands
*------------------------------------------*/
-BUILDIN_FUNC(instance_create)
+BUILDIN(instance_create)
{
const char *name;
int party_id, res;
-
+
name = script_getstr(st, 2);
party_id = script_getnum(st, 3);
-
+
res = instance_create(party_id, name);
if( res == -4 ) // Already exists
{
script_pushint(st, -1);
- return 0;
+ return true;
}
else if( res < 0 )
{
const char *err;
switch(res)
{
- case -3: err = "No free instances"; break;
- case -2: err = "Invalid party ID"; break;
- case -1: err = "Invalid type"; break;
- default: err = "Unknown"; break;
+ case -3: err = "No free instances"; break;
+ case -2: err = "Invalid party ID"; break;
+ case -1: err = "Invalid type"; break;
+ default: err = "Unknown"; break;
}
ShowError("buildin_instance_create: %s [%d].\n", err, res);
script_pushint(st, -2);
- return 0;
+ return true;
}
-
+
script_pushint(st, res);
- return 0;
+ return true;
}
-BUILDIN_FUNC(instance_destroy)
+BUILDIN(instance_destroy)
{
int instance_id;
struct map_session_data *sd;
struct party_data *p;
-
+
if( script_hasdata(st, 2) )
instance_id = script_getnum(st, 2);
else if( st->instance_id )
instance_id = st->instance_id;
else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
instance_id = p->instance_id;
- else return 0;
-
+ else return true;
+
if( instance_id <= 0 || instance_id >= MAX_INSTANCE )
{
ShowError("buildin_instance_destroy: Trying to destroy invalid instance %d.\n", instance_id);
- return 0;
+ return true;
}
-
+
instance_destroy(instance_id);
- return 0;
+ return true;
}
-BUILDIN_FUNC(instance_attachmap)
+BUILDIN(instance_attachmap)
{
const char *name;
int16 m;
int instance_id;
bool usebasename = false;
-
+
name = script_getstr(st,2);
instance_id = script_getnum(st,3);
if( script_hasdata(st,4) && script_getnum(st,4) > 0)
usebasename = true;
-
+
if( (m = instance_add_map(name, instance_id, usebasename)) < 0 ) // [Saithis]
{
ShowError("buildin_instance_attachmap: instance creation failed (%s): %d\n", name, m);
script_pushconststr(st, "");
- return 0;
+ return true;
}
script_pushconststr(st, map[m].name);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(instance_detachmap)
+BUILDIN(instance_detachmap)
{
struct map_session_data *sd;
struct party_data *p;
const char *str;
int16 m;
int instance_id;
-
+
str = script_getstr(st, 2);
if( script_hasdata(st, 3) )
instance_id = script_getnum(st, 3);
@@ -16354,34 +16124,34 @@ BUILDIN_FUNC(instance_detachmap)
instance_id = st->instance_id;
else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
instance_id = p->instance_id;
- else return 0;
-
+ else return true;
+
if( (m = map_mapname2mapid(str)) < 0 || (m = instance_map2imap(m,instance_id)) < 0 )
{
ShowError("buildin_instance_detachmap: Trying to detach invalid map %s\n", str);
- return 0;
+ return true;
}
-
+
instance_del_map(m);
- return 0;
+ return true;
}
-BUILDIN_FUNC(instance_attach)
+BUILDIN(instance_attach)
{
int instance_id;
-
+
instance_id = script_getnum(st, 2);
if( instance_id <= 0 || instance_id >= MAX_INSTANCE )
- return 0;
-
+ return true;
+
st->instance_id = instance_id;
- return 0;
+ return true;
}
-BUILDIN_FUNC(instance_id)
+BUILDIN(instance_id)
{
int instance_id;
-
+
if( script_hasdata(st, 2) )
{
struct party_data *p;
@@ -16397,50 +16167,50 @@ BUILDIN_FUNC(instance_id)
}
else
instance_id = st->instance_id;
-
+
script_pushint(st, instance_id);
- return 0;
+ return true;
}
-BUILDIN_FUNC(instance_set_timeout)
+BUILDIN(instance_set_timeout)
{
int progress_timeout, idle_timeout;
int instance_id;
struct map_session_data *sd;
struct party_data *p;
-
+
progress_timeout = script_getnum(st, 2);
idle_timeout = script_getnum(st, 3);
-
+
if( script_hasdata(st, 4) )
instance_id = script_getnum(st, 4);
else if( st->instance_id )
instance_id = st->instance_id;
else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
instance_id = p->instance_id;
- else return 0;
-
+ else return true;
+
if( instance_id > 0 )
instance_set_timeout(instance_id, progress_timeout, idle_timeout);
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(instance_init)
+BUILDIN(instance_init)
{
int instance_id = script_getnum(st, 2);
-
+
if( instance[instance_id].state != INSTANCE_IDLE )
{
ShowError("instance_init: instance already initialized.\n");
- return 0;
+ return true;
}
-
+
instance_init(instance_id);
- return 0;
+ return true;
}
-BUILDIN_FUNC(instance_announce)
+BUILDIN(instance_announce)
{
int instance_id = script_getnum(st,2);
const char *mes = script_getstr(st,3);
@@ -16450,39 +16220,39 @@ BUILDIN_FUNC(instance_announce)
int fontSize = script_hasdata(st,7) ? script_getnum(st,7) : 12; // default fontSize
int fontAlign = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontAlign
int fontY = script_hasdata(st,9) ? script_getnum(st,9) : 0; // default fontY
-
+
int i;
struct map_session_data *sd;
struct party_data *p;
-
+
if( instance_id == 0 )
{
if( st->instance_id )
instance_id = st->instance_id;
else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
instance_id = p->instance_id;
- else return 0;
+ else return true;
}
-
+
if( instance_id <= 0 || instance_id >= MAX_INSTANCE )
- return 0;
-
+ return true;
+
for( i = 0; i < instance[instance_id].num_map; i++ )
map_foreachinmap(buildin_announce_sub, instance[instance_id].map[i], BL_PC,
- mes, strlen(mes)+1, flag&0xf0, fontColor, fontType, fontSize, fontAlign, fontY);
-
- return 0;
+ mes, strlen(mes)+1, flag&0xf0, fontColor, fontType, fontSize, fontAlign, fontY);
+
+ return true;
}
-BUILDIN_FUNC(instance_npcname)
+BUILDIN(instance_npcname)
{
const char *str;
int instance_id = 0;
-
+
struct map_session_data *sd;
struct party_data *p;
struct npc_data *nd;
-
+
str = script_getstr(st, 2);
if( script_hasdata(st, 3) )
instance_id = script_getnum(st, 3);
@@ -16490,7 +16260,7 @@ BUILDIN_FUNC(instance_npcname)
instance_id = st->instance_id;
else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
instance_id = p->instance_id;
-
+
if( instance_id && (nd = npc_name2id(str)) != NULL )
{
static char npcname[NAME_LENGTH];
@@ -16501,20 +16271,20 @@ BUILDIN_FUNC(instance_npcname)
{
ShowError("script:instance_npcname: invalid instance NPC (instance_id: %d, NPC name: \"%s\".)\n", instance_id, str);
st->state = END;
- return 1;
+ return false;
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(has_instance)
+BUILDIN(has_instance)
{
struct map_session_data *sd;
struct party_data *p;
const char *str;
int16 m;
int instance_id = 0;
-
+
str = script_getstr(st, 2);
if( script_hasdata(st, 3) )
instance_id = script_getnum(st, 3);
@@ -16522,18 +16292,18 @@ BUILDIN_FUNC(has_instance)
instance_id = st->instance_id;
else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
instance_id = p->instance_id;
-
+
if( !instance_id || (m = map_mapname2mapid(str)) < 0 || (m = instance_map2imap(m, instance_id)) < 0 )
{
script_pushconststr(st, "");
- return 0;
+ return true;
}
-
+
script_pushconststr(st, map[m].name);
- return 0;
+ return true;
}
-BUILDIN_FUNC(instance_warpall)
+BUILDIN(instance_warpall)
{
struct map_session_data *pl_sd;
int16 m, i;
@@ -16542,7 +16312,7 @@ BUILDIN_FUNC(instance_warpall)
int x, y;
unsigned short mapindex;
struct party_data *p = NULL;
-
+
mapn = script_getstr(st,2);
x = script_getnum(st,3);
y = script_getnum(st,4);
@@ -16552,19 +16322,19 @@ BUILDIN_FUNC(instance_warpall)
instance_id = st->instance_id;
else if( (pl_sd = script_rid2sd(st)) != NULL && pl_sd->status.party_id && (p = party_search(pl_sd->status.party_id)) != NULL && p->instance_id )
instance_id = p->instance_id;
- else return 0;
-
+ else return true;
+
if( (m = map_mapname2mapid(mapn)) < 0 || (map[m].flag.src4instance && (m = instance_mapid2imapid(m, instance_id)) < 0) )
- return 0;
-
+ return true;
+
if( !(p = party_search(instance[instance_id].party_id)) )
- return 0;
-
+ return true;
+
mapindex = map_id2index(m);
for( i = 0; i < MAX_PARTY; i++ )
if( (pl_sd = p->data[i].sd) && map[pl_sd->bl.m].instance_id == st->instance_id ) pc_setpos(pl_sd,mapindex,x,y,CLR_TELEPORT);
-
- return 0;
+
+ return true;
}
/*==========================================
@@ -16577,71 +16347,71 @@ BUILDIN_FUNC(instance_warpall)
* Example: instance_check_party (getcharid(1){,amount}{,min}{,max});
* Example 2: instance_check_party (getcharid(1),1,1,99);
*------------------------------------------*/
-BUILDIN_FUNC(instance_check_party)
+BUILDIN(instance_check_party)
{
struct map_session_data *pl_sd;
int amount, min, max, i, party_id, c = 0;
struct party_data *p = NULL;
-
+
amount = script_hasdata(st,3) ? script_getnum(st,3) : 1; // Amount of needed Partymembers for the Instance.
min = script_hasdata(st,4) ? script_getnum(st,4) : 1; // Minimum Level needed to join the Instance.
max = script_hasdata(st,5) ? script_getnum(st,5) : MAX_LEVEL; // Maxium Level allowed to join the Instance.
-
+
if( min < 1 || min > MAX_LEVEL){
ShowError("instance_check_party: Invalid min level, %d\n", min);
- return 0;
+ return true;
}else if( max < 1 || max > MAX_LEVEL){
ShowError("instance_check_party: Invalid max level, %d\n", max);
- return 0;
+ return true;
}
-
+
if( script_hasdata(st,2) )
party_id = script_getnum(st,2);
- else return 0;
-
+ else return true;
+
if( !(p = party_search(party_id)) ){
script_pushint(st, 0); // Returns false if party does not exist.
- return 0;
+ return true;
}
-
+
for( i = 0; i < MAX_PARTY; i++ )
if( (pl_sd = p->data[i].sd) )
if(map_id2bl(pl_sd->bl.id)){
if(pl_sd->status.base_level < min){
script_pushint(st, 0);
- return 0;
+ return true;
}else if(pl_sd->status.base_level > max){
script_pushint(st, 0);
- return 0;
+ return true;
}
- c++;
+ c++;
}
-
+
if(c < amount){
script_pushint(st, 0); // Not enough Members in the Party to join Instance.
}else
script_pushint(st, 1);
-
- return 0;
+
+ return true;
}
/*==========================================
* Custom Fonts
*------------------------------------------*/
-BUILDIN_FUNC(setfont)
+BUILDIN(setfont)
{
struct map_session_data *sd = script_rid2sd(st);
int font = script_getnum(st,2);
if( sd == NULL )
- return 0;
-
+ return true;
+
if( sd->user_font != font )
sd->user_font = font;
else
sd->user_font = 0;
-
+
clif->font(sd);
- return 0;
+ return true;
}
static int buildin_mobuseskill_sub(struct block_list *bl,va_list ap)
@@ -16655,10 +16425,10 @@ static int buildin_mobuseskill_sub(struct block_list *bl,va_list ap)
int cancel = va_arg(ap,int);
int emotion = va_arg(ap,int);
int target = va_arg(ap,int);
-
+
if( md->class_ != mobid )
return 0;
-
+
// 0:self, 1:target, 2:master, default:random
switch( target )
{
@@ -16667,40 +16437,40 @@ static int buildin_mobuseskill_sub(struct block_list *bl,va_list ap)
case 2: tbl = map_id2bl(md->master_id); break;
default:tbl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md),skill->get_range2(&md->bl, skill_id, skill_lv)); break;
}
-
+
if( !tbl )
return 0;
-
+
if( md->ud.skilltimer != INVALID_TIMER ) // Cancel the casting skill.
unit_skillcastcancel(bl,0);
-
+
if( skill->get_casttype(skill_id) == CAST_GROUND )
unit_skilluse_pos2(&md->bl, tbl->x, tbl->y, skill_id, skill_lv, casttime, cancel);
else
unit_skilluse_id2(&md->bl, tbl->id, skill_id, skill_lv, casttime, cancel);
-
+
clif->emotion(&md->bl, emotion);
-
+
return 0;
}
/*==========================================
* areamobuseskill "Map Name",<x>,<y>,<range>,<Mob ID>,"Skill Name"/<Skill ID>,<Skill Lv>,<Cast Time>,<Cancelable>,<Emotion>,<Target Type>;
*------------------------------------------*/
-BUILDIN_FUNC(areamobuseskill)
+BUILDIN(areamobuseskill)
{
struct block_list center;
int16 m;
int range,mobid,skill_id,skill_lv,casttime,emotion,target,cancel;
-
+
if( (m = map_mapname2mapid(script_getstr(st,2))) < 0 )
{
ShowError("areamobuseskill: invalid map name.\n");
- return 0;
+ return true;
}
-
+
if( map[m].flag.src4instance && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
- return 0;
-
+ return true;
+
center.m = m;
center.x = script_getnum(st,3);
center.y = script_getnum(st,4);
@@ -16709,177 +16479,176 @@ BUILDIN_FUNC(areamobuseskill)
skill_id = ( script_isstring(st,7) ? skill->name2id(script_getstr(st,7)) : script_getnum(st,7) );
if( (skill_lv = script_getnum(st,8)) > battle_config.mob_max_skilllvl )
skill_lv = battle_config.mob_max_skilllvl;
-
+
casttime = script_getnum(st,9);
cancel = script_getnum(st,10);
emotion = script_getnum(st,11);
target = script_getnum(st,12);
-
+
map_foreachinrange(buildin_mobuseskill_sub, &center, range, BL_MOB, mobid, skill_id, skill_lv, casttime, cancel, emotion, target);
- return 0;
+ return true;
}
-BUILDIN_FUNC(progressbar)
+BUILDIN(progressbar)
{
struct map_session_data * sd = script_rid2sd(st);
const char * color;
unsigned int second;
-
+
if( !st || !sd )
- return 0;
-
+ return true;
+
st->state = STOP;
-
+
color = script_getstr(st,2);
second = script_getnum(st,3);
-
+
sd->progressbar.npc_id = st->oid;
sd->progressbar.timeout = gettick() + second*1000;
-
+
clif->progressbar(sd, strtol(color, (char **)NULL, 0), second);
- return 0;
+ return true;
}
-BUILDIN_FUNC(pushpc)
+BUILDIN(pushpc)
{
uint8 dir;
int cells, dx, dy;
struct map_session_data* sd;
-
+
if((sd = script_rid2sd(st))==NULL)
{
- return 0;
+ return true;
}
-
+
dir = script_getnum(st,2);
cells = script_getnum(st,3);
-
+
if(dir>7)
{
ShowWarning("buildin_pushpc: Invalid direction %d specified.\n", dir);
script_reportsrc(st);
-
+
dir%= 8; // trim spin-over
}
-
+
if(!cells)
{// zero distance
- return 0;
+ return true;
}
else if(cells<0)
{// pushing backwards
dir = (dir+4)%8; // turn around
cells = -cells;
}
-
+
dx = dirx[dir];
dy = diry[dir];
-
+
unit_blown(&sd->bl, dx, dy, cells, 0);
- return 0;
+ return true;
}
/// Invokes buying store preparation window
/// buyingstore <slots>;
-BUILDIN_FUNC(buyingstore)
+BUILDIN(buyingstore)
{
struct map_session_data* sd;
-
- if( ( sd = script_rid2sd(st) ) == NULL )
- {
- return 0;
+
+ if( ( sd = script_rid2sd(st) ) == NULL ) {
+ return true;
}
-
- buyingstore_setup(sd, script_getnum(st,2));
- return 0;
+
+ buyingstore->setup(sd, script_getnum(st,2));
+ return true;
}
/// Invokes search store info window
/// searchstores <uses>,<effect>;
-BUILDIN_FUNC(searchstores)
+BUILDIN(searchstores)
{
unsigned short effect;
unsigned int uses;
struct map_session_data* sd;
-
+
if( ( sd = script_rid2sd(st) ) == NULL )
{
- return 0;
+ return true;
}
-
+
uses = script_getnum(st,2);
effect = script_getnum(st,3);
-
+
if( !uses )
{
ShowError("buildin_searchstores: Amount of uses cannot be zero.\n");
- return 1;
+ return false;
}
-
+
if( effect > 1 )
{
ShowError("buildin_searchstores: Invalid effect id %hu, specified.\n", effect);
- return 1;
+ return false;
}
-
- searchstore_open(sd, uses, effect);
- return 0;
+
+ searchstore->open(sd, uses, effect);
+ return true;
}
/// Displays a number as large digital clock.
/// showdigit <value>[,<type>];
-BUILDIN_FUNC(showdigit)
+BUILDIN(showdigit)
{
unsigned int type = 0;
int value;
struct map_session_data* sd;
-
+
if( ( sd = script_rid2sd(st) ) == NULL )
{
- return 0;
+ return true;
}
-
+
value = script_getnum(st,2);
-
+
if( script_hasdata(st,3) )
{
type = script_getnum(st,3);
-
+
if( type > 3 )
{
ShowError("buildin_showdigit: Invalid type %u.\n", type);
- return 1;
+ return false;
}
}
-
+
clif->showdigit(sd, (unsigned char)type, value);
- return 0;
+ return true;
}
/**
* Rune Knight
**/
-BUILDIN_FUNC(makerune) {
+BUILDIN(makerune) {
TBL_PC* sd;
if( (sd = script_rid2sd(st)) == NULL )
- return 0;
+ return true;
clif->skill_produce_mix_list(sd,RK_RUNEMASTERY,24);
sd->itemid = script_getnum(st,2);
- return 0;
+ return true;
}
/**
* checkdragon() returns 1 if mounting a dragon or 0 otherwise.
**/
-BUILDIN_FUNC(checkdragon) {
+BUILDIN(checkdragon) {
TBL_PC* sd;
if( (sd = script_rid2sd(st)) == NULL )
- return 0;
+ return true;
if( pc_isridingdragon(sd) )
script_pushint(st,1);
else
script_pushint(st,0);
- return 0;
+ return true;
}
/**
* setdragon({optional Color}) returns 1 on success or 0 otherwise
@@ -16891,12 +16660,12 @@ BUILDIN_FUNC(checkdragon) {
* - 4 : Blue Dragon
* - 5 : Red Dragon
**/
-BUILDIN_FUNC(setdragon) {
+BUILDIN(setdragon) {
TBL_PC* sd;
int color = script_hasdata(st,2) ? script_getnum(st,2) : 0;
if( (sd = script_rid2sd(st)) == NULL )
- return 0;
+ return true;
if( !pc_checkskill(sd,RK_DRAGONTRAINING) || (sd->class_&MAPID_THIRDMASK) != MAPID_RUNE_KNIGHT )
script_pushint(st,0);//Doesn't have the skill or it's not a Rune Knight
else if ( pc_isridingdragon(sd) ) {//Is mounted; release
@@ -16906,10 +16675,10 @@ BUILDIN_FUNC(setdragon) {
unsigned int option = OPTION_DRAGON1;
if( color ) {
option = ( color == 1 ? OPTION_DRAGON1 :
- color == 2 ? OPTION_DRAGON2 :
- color == 3 ? OPTION_DRAGON3 :
- color == 4 ? OPTION_DRAGON4 :
- color == 5 ? OPTION_DRAGON5 : 0);
+ color == 2 ? OPTION_DRAGON2 :
+ color == 3 ? OPTION_DRAGON3 :
+ color == 4 ? OPTION_DRAGON4 :
+ color == 5 ? OPTION_DRAGON5 : 0);
if( !option ) {
ShowWarning("script_setdragon: Unknown Color %d used; changing to green (1)\n",color);
option = OPTION_DRAGON1;
@@ -16918,21 +16687,21 @@ BUILDIN_FUNC(setdragon) {
pc_setoption(sd, sd->sc.option|option);
script_pushint(st,1);
}
- return 0;
+ return true;
}
/**
* ismounting() returns 1 if mounting a new mount or 0 otherwise
**/
-BUILDIN_FUNC(ismounting) {
+BUILDIN(ismounting) {
TBL_PC* sd;
if( (sd = script_rid2sd(st)) == NULL )
- return 0;
+ return true;
if( sd->sc.option&OPTION_MOUNTING )
script_pushint(st,1);
else
script_pushint(st,0);
- return 0;
+ return true;
}
/**
@@ -16941,10 +16710,10 @@ BUILDIN_FUNC(ismounting) {
* - Will fail if the player is mounting a non-new mount, e.g. dragon, peco, wug, etc.
* - Will unmount the player is he is already mounting
**/
-BUILDIN_FUNC(setmounting) {
+BUILDIN(setmounting) {
TBL_PC* sd;
if( (sd = script_rid2sd(st)) == NULL )
- return 0;
+ return true;
if( sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR) )
script_pushint(st,0);//can't mount with one of these
else {
@@ -16954,33 +16723,33 @@ BUILDIN_FUNC(setmounting) {
pc_setoption(sd, sd->sc.option|OPTION_MOUNTING);//mount
script_pushint(st,1);//in both cases, return 1.
}
- return 0;
+ return true;
}
/**
* Retrieves quantity of arguments provided to callfunc/callsub.
* getargcount() -> amount of arguments received in a function
**/
-BUILDIN_FUNC(getargcount) {
+BUILDIN(getargcount) {
struct script_retinfo* ri;
-
+
if( st->stack->defsp < 1 || st->stack->stack_data[st->stack->defsp - 1].type != C_RETINFO ) {
ShowError("script:getargcount: used out of function or callsub label!\n");
st->state = END;
- return 1;
+ return false;
}
ri = st->stack->stack_data[st->stack->defsp - 1].u.ri;
-
+
script_pushint(st, ri->nargs);
-
- return 0;
+
+ return true;
}
/**
* getcharip(<account ID>/<character ID>/<character name>)
**/
-BUILDIN_FUNC(getcharip)
+BUILDIN(getcharip)
{
struct map_session_data* sd = NULL;
-
+
/* check if a character name is specified */
if( script_hasdata(st, 2) )
{
@@ -16995,169 +16764,174 @@ BUILDIN_FUNC(getcharip)
}
else
sd = script_rid2sd(st);
-
+
/* check for sd and IP */
if (!sd || !session[sd->fd]->client_addr)
{
script_pushconststr(st, "");
- return 0;
+ return true;
}
-
+
/* return the client ip_addr converted for output */
if (sd && sd->fd && session[sd->fd])
{
/* initiliaze */
const char *ip_addr = NULL;
uint32 ip;
-
+
/* set ip, ip_addr and convert to ip and push str */
ip = session[sd->fd]->client_addr;
ip_addr = ip2str(ip, NULL);
script_pushstrcopy(st, ip_addr);
}
-
- return 0;
+
+ return true;
}
/**
* is_function(<function name>) -> 1 if function exists, 0 otherwise
**/
-BUILDIN_FUNC(is_function) {
+BUILDIN(is_function) {
const char* str = script_getstr(st,2);
-
+
if( strdb_exists(userfunc_db, str) )
script_pushint(st,1);
else
script_pushint(st,0);
-
- return 0;
+
+ return true;
}
/**
* get_revision() -> retrieves the current svn revision (if available)
**/
-BUILDIN_FUNC(get_revision) {
+BUILDIN(get_revision) {
const char *svn = get_svn_revision();
-
+
if ( svn[0] != HERC_UNKNOWN_VER )
script_pushint(st,atoi(svn));
else
script_pushint(st,-1);//unknown
-
- return 0;
+
+ return true;
}
/**
* freeloop(<toggle>) -> toggles this script instance's looping-check ability
**/
-BUILDIN_FUNC(freeloop) {
-
+BUILDIN(freeloop) {
+
if( script_getnum(st,2) )
st->freeloop = 1;
else
st->freeloop = 0;
-
+
script_pushint(st, st->freeloop);
-
- return 0;
+
+ return true;
}
/**
* @commands (script based)
**/
-BUILDIN_FUNC(bindatcmd) {
+BUILDIN(bindatcmd) {
const char* atcmd;
const char* eventName;
- int i, level = 0, level2 = 0;
+ int i, group_lv = 0, group_lv_char = 99;
+ bool log = false;
bool create = false;
-
+
atcmd = script_getstr(st,2);
eventName = script_getstr(st,3);
-
- if( *atcmd == atcommand_symbol || *atcmd == charcommand_symbol )
+
+ if( *atcmd == atcommand->at_symbol || *atcmd == atcommand->char_symbol )
atcmd++;
+
+ if( script_hasdata(st,4) ) group_lv = script_getnum(st,4);
+ if( script_hasdata(st,5) ) group_lv_char = script_getnum(st,5);
+ if( script_hasdata(st,6) ) log = script_getnum(st,6) ? true : false;
- if( script_hasdata(st,4) ) level = script_getnum(st,4);
- if( script_hasdata(st,5) ) level2 = script_getnum(st,5);
-
- if( atcmd_binding_count == 0 ) {
- CREATE(atcmd_binding,struct atcmd_binding_data*,1);
-
+
+ if( atcommand->binding_count == 0 ) {
+ CREATE(atcommand->binding,struct atcmd_binding_data*,1);
+
create = true;
} else {
- ARR_FIND(0, atcmd_binding_count, i, strcmp(atcmd_binding[i]->command,atcmd) == 0);
- if( i < atcmd_binding_count ) {/* update existent entry */
- safestrncpy(atcmd_binding[i]->npc_event, eventName, 50);
- atcmd_binding[i]->level = level;
- atcmd_binding[i]->level2 = level2;
+ ARR_FIND(0, atcommand->binding_count, i, strcmp(atcommand->binding[i]->command,atcmd) == 0);
+ if( i < atcommand->binding_count ) {/* update existent entry */
+ safestrncpy(atcommand->binding[i]->npc_event, eventName, ATCOMMAND_LENGTH);
+ atcommand->binding[i]->group_lv = group_lv;
+ atcommand->binding[i]->group_lv_char = group_lv_char;
+ atcommand->binding[i]->log = log;
} else
create = true;
}
-
+
if( create ) {
- i = atcmd_binding_count;
-
- if( atcmd_binding_count++ != 0 )
- RECREATE(atcmd_binding,struct atcmd_binding_data*,atcmd_binding_count);
-
- CREATE(atcmd_binding[i],struct atcmd_binding_data,1);
-
- safestrncpy(atcmd_binding[i]->command, atcmd, 50);
- safestrncpy(atcmd_binding[i]->npc_event, eventName, 50);
- atcmd_binding[i]->level = level;
- atcmd_binding[i]->level2 = level2;
+ i = atcommand->binding_count;
+
+ if( atcommand->binding_count++ != 0 )
+ RECREATE(atcommand->binding,struct atcmd_binding_data*,atcommand->binding_count);
+
+ CREATE(atcommand->binding[i],struct atcmd_binding_data,1);
+
+ safestrncpy(atcommand->binding[i]->command, atcmd, 50);
+ safestrncpy(atcommand->binding[i]->npc_event, eventName, 50);
+ atcommand->binding[i]->group_lv = group_lv;
+ atcommand->binding[i]->group_lv_char = group_lv_char;
+ atcommand->binding[i]->log = log;
}
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(unbindatcmd) {
+BUILDIN(unbindatcmd) {
const char* atcmd;
int i = 0;
-
+
atcmd = script_getstr(st, 2);
-
- if( *atcmd == atcommand_symbol || *atcmd == charcommand_symbol )
+
+ if( *atcmd == atcommand->at_symbol || *atcmd == atcommand->char_symbol )
atcmd++;
-
- if( atcmd_binding_count == 0 ) {
+
+ if( atcommand->binding_count == 0 ) {
script_pushint(st, 0);
- return 0;
+ return true;
}
-
- ARR_FIND(0, atcmd_binding_count, i, strcmp(atcmd_binding[i]->command, atcmd) == 0);
- if( i < atcmd_binding_count ) {
+
+ ARR_FIND(0, atcommand->binding_count, i, strcmp(atcommand->binding[i]->command, atcmd) == 0);
+ if( i < atcommand->binding_count ) {
int cursor = 0;
- aFree(atcmd_binding[i]);
- atcmd_binding[i] = NULL;
+ aFree(atcommand->binding[i]);
+ atcommand->binding[i] = NULL;
/* compact the list now that we freed a slot somewhere */
- for( i = 0, cursor = 0; i < atcmd_binding_count; i++ ) {
- if( atcmd_binding[i] == NULL )
+ for( i = 0, cursor = 0; i < atcommand->binding_count; i++ ) {
+ if( atcommand->binding[i] == NULL )
continue;
-
+
if( cursor != i ) {
- memmove(&atcmd_binding[cursor], &atcmd_binding[i], sizeof(struct atcmd_binding_data*));
+ memmove(&atcommand->binding[cursor], &atcommand->binding[i], sizeof(struct atcmd_binding_data*));
}
-
+
cursor++;
}
-
- if( (atcmd_binding_count = cursor) == 0 )
- aFree(atcmd_binding);
-
+
+ if( (atcommand->binding_count = cursor) == 0 )
+ aFree(atcommand->binding);
+
script_pushint(st, 1);
} else
script_pushint(st, 0);/* not found */
-
- return 0;
+
+ return true;
}
-BUILDIN_FUNC(useatcmd)
+BUILDIN(useatcmd)
{
TBL_PC dummy_sd;
TBL_PC* sd;
int fd;
const char* cmd;
-
+
cmd = script_getstr(st,2);
-
+
if( st->rid )
{
sd = script_rid2sd(st);
@@ -17167,7 +16941,7 @@ BUILDIN_FUNC(useatcmd)
{ // Use a dummy character.
sd = &dummy_sd;
fd = 0;
-
+
memset(&dummy_sd, 0, sizeof(TBL_PC));
if( st->oid )
{
@@ -17177,109 +16951,115 @@ BUILDIN_FUNC(useatcmd)
safestrncpy(dummy_sd.status.name, ((TBL_NPC*)bl)->name, NAME_LENGTH);
}
}
-
+
// compatibility with previous implementation (deprecated!)
- if( cmd[0] != atcommand_symbol )
- {
+ if( cmd[0] != atcommand->at_symbol ) {
cmd += strlen(sd->status.name);
- while( *cmd != atcommand_symbol && *cmd != 0 )
+ while( *cmd != atcommand->at_symbol && *cmd != 0 )
cmd++;
}
-
- is_atcommand(fd, sd, cmd, 1);
- return 0;
+
+ atcommand->parse(fd, sd, cmd, 1);
+ return true;
}
-BUILDIN_FUNC(checkre)
+BUILDIN(checkre)
{
int num;
-
+
num=script_getnum(st,2);
switch(num){
case 0:
- #ifdef RENEWAL
- script_pushint(st, 1);
- #else
- script_pushint(st, 0);
- #endif
+#ifdef RENEWAL
+ script_pushint(st, 1);
+#else
+ script_pushint(st, 0);
+#endif
break;
case 1:
- #ifdef RENEWAL_CAST
- script_pushint(st, 1);
- #else
- script_pushint(st, 0);
- #endif
+#ifdef RENEWAL_CAST
+ script_pushint(st, 1);
+#else
+ script_pushint(st, 0);
+#endif
break;
case 2:
- #ifdef RENEWAL_DROP
- script_pushint(st, 1);
- #else
- script_pushint(st, 0);
- #endif
+#ifdef RENEWAL_DROP
+ script_pushint(st, 1);
+#else
+ script_pushint(st, 0);
+#endif
break;
case 3:
- #ifdef RENEWAL_EXP
- script_pushint(st, 1);
- #else
- script_pushint(st, 0);
- #endif
+#ifdef RENEWAL_EXP
+ script_pushint(st, 1);
+#else
+ script_pushint(st, 0);
+#endif
break;
case 4:
- #ifdef RENEWAL_LVDMG
- script_pushint(st, 1);
- #else
- script_pushint(st, 0);
- #endif
+#ifdef RENEWAL_LVDMG
+ script_pushint(st, 1);
+#else
+ script_pushint(st, 0);
+#endif
break;
case 5:
- #ifdef RENEWAL_EDP
- script_pushint(st, 1);
- #else
- script_pushint(st, 0);
- #endif
+#ifdef RENEWAL_EDP
+ script_pushint(st, 1);
+#else
+ script_pushint(st, 0);
+#endif
break;
case 6:
- #ifdef RENEWAL_ASPD
- script_pushint(st, 1);
- #else
- script_pushint(st, 0);
- #endif
+#ifdef RENEWAL_ASPD
+ script_pushint(st, 1);
+#else
+ script_pushint(st, 0);
+#endif
break;
default:
ShowWarning("buildin_checkre: unknown parameter.\n");
break;
}
- return 0;
+ return true;
}
/* getrandgroupitem <group_id>,<quantity> */
-BUILDIN_FUNC(getrandgroupitem) {
+BUILDIN(getrandgroupitem) {
TBL_PC* sd;
int i, get_count = 0, flag, nameid, group = script_getnum(st, 2), qty = script_getnum(st,3);
struct item item_tmp;
-
+
if( !( sd = script_rid2sd(st) ) )
- return 0;
-
+ return true;
+
if( qty <= 0 ) {
ShowError("getrandgroupitem: qty is <= 0!\n");
- return 1;
+ return false;
}
- if( (nameid = itemdb_searchrandomid(group)) == UNKNOWN_ITEM_ID ) {
- return 1;/* itemdb_searchrandomid will already scream a error */
+
+ if(group < 1 || group >= MAX_ITEMGROUP) {
+ ShowError("getrandgroupitem: Invalid group id %d\n", group);
+ return false;
}
-
+ if (!itemgroup_db[group].qty) {
+ ShowError("getrandgroupitem: group id %d is empty!\n", group);
+ return false;
+ }
+
+ nameid = itemdb_searchrandomid(group);
memset(&item_tmp,0,sizeof(item_tmp));
-
+
item_tmp.nameid = nameid;
item_tmp.identify = itemdb_isidentified(nameid);
-
+
//Check if it's stackable.
if (!itemdb_isstackable(nameid))
get_count = 1;
else
get_count = qty;
-
+
for (i = 0; i < qty; i += get_count) {
// if not pet egg
if (!pet_create_egg(sd, nameid)) {
@@ -17290,8 +17070,8 @@ BUILDIN_FUNC(getrandgroupitem) {
}
}
}
-
- return 0;
+
+ return true;
}
/* cleanmap <map_name>;
@@ -17300,21 +17080,21 @@ static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap)
{
nullpo_ret(bl);
map_clearflooritem(bl);
-
+
return 0;
}
-BUILDIN_FUNC(cleanmap)
+BUILDIN(cleanmap)
{
const char *map;
int16 m = -1;
int16 x0 = 0, y0 = 0, x1 = 0, y1 = 0;
-
+
map = script_getstr(st, 2);
m = map_mapname2mapid(map);
if (!m)
- return 1;
-
+ return false;
+
if ((script_lastdata(st) - 2) < 4) {
map_foreachinmap(atcommand_cleanfloor_sub, m, BL_ITEM);
} else {
@@ -17326,16 +17106,16 @@ BUILDIN_FUNC(cleanmap)
map_foreachinarea(atcommand_cleanfloor_sub, m, x0, y0, x1, y1, BL_ITEM);
} else {
ShowError("cleanarea: invalid coordinate defined!\n");
- return 1;
+ return false;
}
}
-
- return 0;
+
+ return true;
}
/* Cast a skill on the attached player.
* npcskill <skill id>, <skill lvl>, <stat point>, <NPC level>;
* npcskill "<skill name>", <skill lvl>, <stat point>, <NPC level>; */
-BUILDIN_FUNC(npcskill)
+BUILDIN(npcskill)
{
uint16 skill_id;
unsigned short skill_level;
@@ -17343,55 +17123,55 @@ BUILDIN_FUNC(npcskill)
unsigned int npc_level;
struct npc_data *nd;
struct map_session_data *sd;
-
+
skill_id = script_isstring(st, 2) ? skill->name2id(script_getstr(st, 2)) : script_getnum(st, 2);
skill_level = script_getnum(st, 3);
stat_point = script_getnum(st, 4);
npc_level = script_getnum(st, 5);
sd = script_rid2sd(st);
nd = (struct npc_data *)map_id2bl(sd->npc_id);
-
+
if (stat_point > battle_config.max_third_parameter) {
ShowError("npcskill: stat point exceeded maximum of %d.\n",battle_config.max_third_parameter );
- return 1;
+ return false;
}
if (npc_level > MAX_LEVEL) {
ShowError("npcskill: level exceeded maximum of %d.\n", MAX_LEVEL);
- return 1;
+ return false;
}
if (sd == NULL || nd == NULL) { //ain't possible, but I don't trust people.
- return 1;
+ return false;
}
-
+
nd->level = npc_level;
nd->stat_point = stat_point;
-
+
if (!nd->status.hp) {
status_calc_npc(nd, true);
} else {
status_calc_npc(nd, false);
}
-
+
if (skill->get_inf(skill_id)&INF_GROUND_SKILL) {
unit_skilluse_pos(&nd->bl, sd->bl.x, sd->bl.y, skill_id, skill_level);
} else {
unit_skilluse_id(&nd->bl, sd->bl.id, skill_id, skill_level);
}
-
- return 0;
+
+ return true;
}
// declarations that were supposed to be exported from npc_chat.c
#ifdef PCRE_SUPPORT
-BUILDIN_FUNC(defpattern);
-BUILDIN_FUNC(activatepset);
-BUILDIN_FUNC(deactivatepset);
-BUILDIN_FUNC(deletepset);
+BUILDIN(defpattern);
+BUILDIN(activatepset);
+BUILDIN(deactivatepset);
+BUILDIN(deletepset);
#endif
/// script command definitions
-/// for an explanation on args, see add_buildin_func
-struct script_function buildin_func[] = {
+/// for an explanation on args, see add_BUILDIN
+struct script_function BUILDIN[] = {
// NPC interaction
BUILDIN_DEF(mes,"s*"),
BUILDIN_DEF(next,""),
@@ -17826,10 +17606,11 @@ struct script_function buildin_func[] = {
BUILDIN_DEF2(cleanmap,"cleanarea","siiii"),
BUILDIN_DEF(npcskill,"viii"),
BUILDIN_DEF(itemeffect,"v"),
+ BUILDIN_DEF(delequip,"i"),
/**
* @commands (script based)
**/
- BUILDIN_DEF(bindatcmd, "ss??"),
+ BUILDIN_DEF(bindatcmd, "ss???"),
BUILDIN_DEF(unbindatcmd, "s"),
BUILDIN_DEF(useatcmd, "s"),
diff --git a/src/map/script.h b/src/map/script.h
index 3e7f3087f..4a12a3f7f 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -191,8 +191,4 @@ int script_reload(void);
// @commands (script based)
void setd_sub(struct script_state *st, TBL_PC *sd, const char *varname, int elem, void *value, struct DBMap **ref);
-#ifdef BETA_THREAD_TEST
-void queryThread_log(char * entry, int length);
-#endif
-
#endif /* _SCRIPT_H_ */
diff --git a/src/map/searchstore.c b/src/map/searchstore.c
index cac79a242..7e1ee3e84 100644
--- a/src/map/searchstore.c
+++ b/src/map/searchstore.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/cbasetypes.h"
#include "../common/malloc.h" // aMalloc, aRealloc, aFree
@@ -12,8 +13,7 @@
/// failure constants for clif functions
-enum e_searchstore_failure
-{
+enum e_searchstore_failure {
SSI_FAILED_NOTHING_SEARCH_ITEM = 0, // "No matching stores were found."
SSI_FAILED_OVER_MAXCOUNT = 1, // "There are too many results. Please enter more detailed search term."
SSI_FAILED_SEARCH_CNT = 2, // "You cannot search anymore."
@@ -22,15 +22,13 @@ enum e_searchstore_failure
};
-enum e_searchstore_searchtype
-{
+enum e_searchstore_searchtype {
SEARCHTYPE_VENDING = 0,
SEARCHTYPE_BUYING_STORE = 1,
};
-enum e_searchstore_effecttype
-{
+enum e_searchstore_effecttype {
EFFECTTYPE_NORMAL = 0,
EFFECTTYPE_CASH = 1,
EFFECTTYPE_MAX
@@ -43,34 +41,28 @@ typedef bool (*searchstore_searchall_t)(struct map_session_data* sd, const struc
/// retrieves search function by type
-static searchstore_search_t searchstore_getsearchfunc(unsigned char type)
-{
- switch( type )
- {
- case SEARCHTYPE_VENDING: return &vending_search;
- case SEARCHTYPE_BUYING_STORE: return &buyingstore_search;
+static inline searchstore_search_t searchstore_getsearchfunc(unsigned char type) {
+ switch( type ) {
+ case SEARCHTYPE_VENDING: return vending->search;
+ case SEARCHTYPE_BUYING_STORE: return buyingstore->search;
}
return NULL;
}
/// retrieves search-all function by type
-static searchstore_searchall_t searchstore_getsearchallfunc(unsigned char type)
-{
- switch( type )
- {
- case SEARCHTYPE_VENDING: return &vending_searchall;
- case SEARCHTYPE_BUYING_STORE: return &buyingstore_searchall;
+static inline searchstore_searchall_t searchstore_getsearchallfunc(unsigned char type) {
+ switch( type ) {
+ case SEARCHTYPE_VENDING: return vending->searchall;
+ case SEARCHTYPE_BUYING_STORE: return buyingstore->searchall;
}
return NULL;
}
/// checks if the player has a store by type
-static bool searchstore_hasstore(struct map_session_data* sd, unsigned char type)
-{
- switch( type )
- {
+static inline bool searchstore_hasstore(struct map_session_data* sd, unsigned char type) {
+ switch( type ) {
case SEARCHTYPE_VENDING: return sd->state.vending;
case SEARCHTYPE_BUYING_STORE: return sd->state.buyingstore;
}
@@ -79,10 +71,8 @@ static bool searchstore_hasstore(struct map_session_data* sd, unsigned char type
/// returns player's store id by type
-static int searchstore_getstoreid(struct map_session_data* sd, unsigned char type)
-{
- switch( type )
- {
+static inline unsigned int searchstore_getstoreid(struct map_session_data* sd, unsigned char type) {
+ switch( type ) {
case SEARCHTYPE_VENDING: return sd->vender_id;
case SEARCHTYPE_BUYING_STORE: return sd->buyer_id;
}
@@ -90,15 +80,12 @@ static int searchstore_getstoreid(struct map_session_data* sd, unsigned char typ
}
-bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect)
-{
- if( !battle_config.feature_search_stores || sd->searchstore.open )
- {
+bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect) {
+ if( !battle_config.feature_search_stores || sd->searchstore.open ) {
return false;
}
- if( !uses || effect >= EFFECTTYPE_MAX )
- {// invalid input
+ if( !uses || effect >= EFFECTTYPE_MAX ) {// invalid input
return false;
}
@@ -116,63 +103,53 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
{
unsigned int i;
struct map_session_data* pl_sd;
- struct s_mapiterator* iter;
+ struct DBIterator *iter;
struct s_search_store_search s;
searchstore_searchall_t store_searchall;
time_t querytime;
- if( !battle_config.feature_search_stores )
- {
+ if( !battle_config.feature_search_stores ) {
return;
}
- if( !sd->searchstore.open )
- {
+ if( !sd->searchstore.open ) {
return;
}
- if( ( store_searchall = searchstore_getsearchallfunc(type) ) == NULL )
- {
+ if( ( store_searchall = searchstore_getsearchallfunc(type) ) == NULL ) {
ShowError("searchstore_query: Unknown search type %u (account_id=%d).\n", (unsigned int)type, sd->bl.id);
return;
}
time(&querytime);
- if( sd->searchstore.nextquerytime > querytime )
- {
+ if( sd->searchstore.nextquerytime > querytime ) {
clif->search_store_info_failed(sd, SSI_FAILED_LIMIT_SEARCH_TIME);
return;
}
- if( !sd->searchstore.uses )
- {
+ if( !sd->searchstore.uses ) {
clif->search_store_info_failed(sd, SSI_FAILED_SEARCH_CNT);
return;
}
// validate lists
- for( i = 0; i < item_count; i++ )
- {
- if( !itemdb_exists(itemlist[i]) )
- {
+ for( i = 0; i < item_count; i++ ) {
+ if( !itemdb_exists(itemlist[i]) ) {
ShowWarning("searchstore_query: Client resolved item %hu is not known.\n", itemlist[i]);
clif->search_store_info_failed(sd, SSI_FAILED_NOTHING_SEARCH_ITEM);
return;
}
}
- for( i = 0; i < card_count; i++ )
- {
- if( !itemdb_exists(cardlist[i]) )
- {
+ for( i = 0; i < card_count; i++ ) {
+ if( !itemdb_exists(cardlist[i]) ) {
ShowWarning("searchstore_query: Client resolved card %hu is not known.\n", cardlist[i]);
clif->search_store_info_failed(sd, SSI_FAILED_NOTHING_SEARCH_ITEM);
return;
}
}
- if( max_price < min_price )
- {
+ if( max_price < min_price ) {
swap(min_price, max_price);
}
@@ -181,7 +158,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
sd->searchstore.nextquerytime = querytime+battle_config.searchstore_querydelay;
// drop previous results
- searchstore_clear(sd);
+ searchstore->clear(sd);
// allocate max. amount of results
sd->searchstore.items = (struct s_search_store_info_item*)aMalloc(sizeof(struct s_search_store_info_item)*battle_config.searchstore_maxresults);
@@ -194,26 +171,22 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
s.card_count = card_count;
s.min_price = min_price;
s.max_price = max_price;
- iter = mapit_geteachpc();
+ iter = db_iterator(vending->db);
- for( pl_sd = (struct map_session_data*)mapit_first(iter); mapit_exists(iter); pl_sd = (struct map_session_data*)mapit_next(iter) )
- {
- if( sd == pl_sd )
- {// skip own shop, if any
+ for( pl_sd = dbi_first(iter); dbi_exists(iter); pl_sd = dbi_next(iter) ) {
+ if( sd == pl_sd ) {// skip own shop, if any
continue;
}
- if( !store_searchall(pl_sd, &s) )
- {// exceeded result size
+ if( !store_searchall(pl_sd, &s) ) {// exceeded result size
clif->search_store_info_failed(sd, SSI_FAILED_OVER_MAXCOUNT);
break;
}
}
- mapit_free(iter);
+ dbi_destroy(iter);
- if( sd->searchstore.count )
- {
+ if( sd->searchstore.count ) {
// reclaim unused memory
sd->searchstore.items = (struct s_search_store_info_item*)aRealloc(sd->searchstore.items, sizeof(struct s_search_store_info_item)*sd->searchstore.count);
@@ -222,11 +195,9 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
// one page displayed
sd->searchstore.pages++;
- }
- else
- {
+ } else {
// cleanup
- searchstore_clear(sd);
+ searchstore->clear(sd);
// update uses
clif->search_store_info_ack(sd);
@@ -238,10 +209,8 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
/// checks whether or not more results are available for the client
-bool searchstore_querynext(struct map_session_data* sd)
-{
- if( sd->searchstore.count && ( sd->searchstore.count-1 )/SEARCHSTORE_RESULTS_PER_PAGE < sd->searchstore.pages )
- {
+bool searchstore_querynext(struct map_session_data* sd) {
+ if( sd->searchstore.count && ( sd->searchstore.count-1 )/SEARCHSTORE_RESULTS_PER_PAGE < sd->searchstore.pages ) {
return true;
}
@@ -249,8 +218,7 @@ bool searchstore_querynext(struct map_session_data* sd)
}
-void searchstore_next(struct map_session_data* sd)
-{
+void searchstore_next(struct map_session_data* sd) {
if( !battle_config.feature_search_stores || !sd->searchstore.open || sd->searchstore.count <= sd->searchstore.pages*SEARCHSTORE_RESULTS_PER_PAGE )
{// nothing (more) to display
return;
@@ -264,12 +232,10 @@ void searchstore_next(struct map_session_data* sd)
}
-void searchstore_clear(struct map_session_data* sd)
-{
- searchstore_clearremote(sd);
+void searchstore_clear(struct map_session_data* sd) {
+ searchstore->clearremote(sd);
- if( sd->searchstore.items )
- {// release results
+ if( sd->searchstore.items ) {// release results
aFree(sd->searchstore.items);
sd->searchstore.items = NULL;
}
@@ -279,11 +245,9 @@ void searchstore_clear(struct map_session_data* sd)
}
-void searchstore_close(struct map_session_data* sd)
-{
- if( sd->searchstore.open )
- {
- searchstore_clear(sd);
+void searchstore_close(struct map_session_data* sd) {
+ if( sd->searchstore.open ) {
+ searchstore->clear(sd);
sd->searchstore.uses = 0;
sd->searchstore.open = false;
@@ -291,58 +255,49 @@ void searchstore_close(struct map_session_data* sd)
}
-void searchstore_click(struct map_session_data* sd, int account_id, int store_id, unsigned short nameid)
-{
+void searchstore_click(struct map_session_data* sd, int account_id, int store_id, unsigned short nameid) {
unsigned int i;
struct map_session_data* pl_sd;
searchstore_search_t store_search;
- if( !battle_config.feature_search_stores || !sd->searchstore.open || !sd->searchstore.count )
- {
+ if( !battle_config.feature_search_stores || !sd->searchstore.open || !sd->searchstore.count ) {
return;
}
- searchstore_clearremote(sd);
+ searchstore->clearremote(sd);
ARR_FIND( 0, sd->searchstore.count, i, sd->searchstore.items[i].store_id == store_id && sd->searchstore.items[i].account_id == account_id && sd->searchstore.items[i].nameid == nameid );
- if( i == sd->searchstore.count )
- {// no such result, crafted
+ if( i == sd->searchstore.count ) {// no such result, crafted
ShowWarning("searchstore_click: Received request with item %hu of account %d, which is not part of current result set (account_id=%d, char_id=%d).\n", nameid, account_id, sd->bl.id, sd->status.char_id);
clif->search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
return;
}
- if( ( pl_sd = map_id2sd(account_id) ) == NULL )
- {// no longer online
+ if( ( pl_sd = map_id2sd(account_id) ) == NULL ) {// no longer online
clif->search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
return;
}
- if( !searchstore_hasstore(pl_sd, sd->searchstore.type) || searchstore_getstoreid(pl_sd, sd->searchstore.type) != store_id )
- {// no longer vending/buying or not same shop
+ if( !searchstore_hasstore(pl_sd, sd->searchstore.type) || searchstore_getstoreid(pl_sd, sd->searchstore.type) != store_id ) {
+ // no longer vending/buying or not same shop
clif->search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
return;
}
store_search = searchstore_getsearchfunc(sd->searchstore.type);
- if( !store_search(pl_sd, nameid) )
- {// item no longer being sold/bought
+ if( !store_search(pl_sd, nameid) ) {// item no longer being sold/bought
clif->search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
return;
}
- switch( sd->searchstore.effect )
- {
+ switch( sd->searchstore.effect ) {
case EFFECTTYPE_NORMAL:
// display coords
- if( sd->bl.m != pl_sd->bl.m )
- {// not on same map, wipe previous marker
+ if( sd->bl.m != pl_sd->bl.m ) {// not on same map, wipe previous marker
clif->search_store_info_click_ack(sd, -1, -1);
- }
- else
- {
+ } else {
clif->search_store_info_click_ack(sd, pl_sd->bl.x, pl_sd->bl.y);
}
@@ -353,10 +308,9 @@ void searchstore_click(struct map_session_data* sd, int account_id, int store_id
// to bypass range checks
sd->searchstore.remote_id = account_id;
- switch( sd->searchstore.type )
- {
- case SEARCHTYPE_VENDING: vending_vendinglistreq(sd, account_id); break;
- case SEARCHTYPE_BUYING_STORE: buyingstore_open(sd, account_id); break;
+ switch( sd->searchstore.type ) {
+ case SEARCHTYPE_VENDING: vending->list(sd, account_id); break;
+ case SEARCHTYPE_BUYING_STORE: buyingstore->open(sd, account_id); break;
}
break;
@@ -368,26 +322,23 @@ void searchstore_click(struct map_session_data* sd, int account_id, int store_id
/// checks whether or not sd has opened account_id's shop remotely
-bool searchstore_queryremote(struct map_session_data* sd, int account_id)
-{
+bool searchstore_queryremote(struct map_session_data* sd, int account_id) {
return (bool)( sd->searchstore.open && sd->searchstore.count && sd->searchstore.remote_id == account_id );
}
/// removes range-check bypassing for remotely opened stores
-void searchstore_clearremote(struct map_session_data* sd)
-{
+void searchstore_clearremote(struct map_session_data* sd) {
sd->searchstore.remote_id = 0;
}
/// receives results from a store-specific callback
-bool searchstore_result(struct map_session_data* sd, int store_id, int account_id, const char* store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short* card, unsigned char refine)
+bool searchstore_result(struct map_session_data* sd, unsigned int store_id, int account_id, const char* store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short* card, unsigned char refine)
{
struct s_search_store_info_item* ssitem;
- if( sd->searchstore.count >= (unsigned int)battle_config.searchstore_maxresults )
- {// no more
+ if( sd->searchstore.count >= (unsigned int)battle_config.searchstore_maxresults ) {// no more
return false;
}
@@ -403,3 +354,19 @@ bool searchstore_result(struct map_session_data* sd, int store_id, int account_i
return true;
}
+
+void searchstore_defaults (void) {
+ searchstore = &searchstore_s;
+
+ searchstore->open = searchstore_open;
+ searchstore->query = searchstore_query;
+ searchstore->querynext = searchstore_querynext;
+ searchstore->next = searchstore_next;
+ searchstore->clear = searchstore_clear;
+ searchstore->close = searchstore_close;
+ searchstore->click = searchstore_click;
+ searchstore->queryremote = searchstore_queryremote;
+ searchstore->clearremote = searchstore_clearremote;
+ searchstore->result = searchstore_result;
+
+}
diff --git a/src/map/searchstore.h b/src/map/searchstore.h
index ffa8e9784..61e65c7d2 100644
--- a/src/map/searchstore.h
+++ b/src/map/searchstore.h
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _SEARCHSTORE_H_
#define _SEARCHSTORE_H_
@@ -7,8 +8,7 @@
#define SEARCHSTORE_RESULTS_PER_PAGE 10
/// information about the search being performed
-struct s_search_store_search
-{
+struct s_search_store_search {
struct map_session_data* search_sd; // sd of the searching player
const unsigned short* itemlist;
const unsigned short* cardlist;
@@ -18,9 +18,8 @@ struct s_search_store_search
unsigned int max_price;
};
-struct s_search_store_info_item
-{
- int store_id;
+struct s_search_store_info_item {
+ unsigned int store_id;
int account_id;
char store_name[MESSAGE_SIZE];
unsigned short nameid;
@@ -30,8 +29,7 @@ struct s_search_store_info_item
unsigned char refine;
};
-struct s_search_store_info
-{
+struct s_search_store_info {
unsigned int count;
struct s_search_store_info_item* items;
unsigned int pages; // amount of pages already sent to client
@@ -43,15 +41,21 @@ struct s_search_store_info
bool open;
};
-bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect);
-void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short* itemlist, unsigned int item_count, const unsigned short* cardlist, unsigned int card_count);
-bool searchstore_querynext(struct map_session_data* sd);
-void searchstore_next(struct map_session_data* sd);
-void searchstore_clear(struct map_session_data* sd);
-void searchstore_close(struct map_session_data* sd);
-void searchstore_click(struct map_session_data* sd, int account_id, int store_id, unsigned short nameid);
-bool searchstore_queryremote(struct map_session_data* sd, int account_id);
-void searchstore_clearremote(struct map_session_data* sd);
-bool searchstore_result(struct map_session_data* sd, int store_id, int account_id, const char* store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short* card, unsigned char refine);
+struct searchstore_interface {
+ bool (*open) (struct map_session_data* sd, unsigned int uses, unsigned short effect);
+ void (*query) (struct map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short* itemlist, unsigned int item_count, const unsigned short* cardlist, unsigned int card_count);
+ bool (*querynext) (struct map_session_data* sd);
+ void (*next) (struct map_session_data* sd);
+ void (*clear) (struct map_session_data* sd);
+ void (*close) (struct map_session_data* sd);
+ void (*click) (struct map_session_data* sd, int account_id, int store_id, unsigned short nameid);
+ bool (*queryremote) (struct map_session_data* sd, int account_id);
+ void (*clearremote) (struct map_session_data* sd);
+ bool (*result) (struct map_session_data* sd, unsigned int store_id, int account_id, const char* store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short* card, unsigned char refine);
+} searchstore_s;
+
+struct searchstore_interface *searchstore;
+
+void searchstore_defaults (void);
#endif // _SEARCHSTORE_H_
diff --git a/src/map/skill.c b/src/map/skill.c
index e393e4293..874ad1a26 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2233,8 +2233,30 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
* Official Magic Reflection Behavior : damage reflected depends on gears caster wears, not target
**/
#if MAGIC_REFLECTION_TYPE
- if( dmg.dmg_lv != ATK_MISS )//Wiz SL cancelled and consumed fragment
- dmg = battle->calc_attack(BF_MAGIC,bl,bl,skill_id,skill_lv,flag&0xFFF);
+ if( dmg.dmg_lv != ATK_MISS ){ //Wiz SL cancelled and consumed fragment
+ short s_ele = skill->get_ele(skill_id, skill_lv);
+
+ if (s_ele == -1) // the skill takes the weapon's element
+ s_ele = sstatus->rhw.ele;
+ else if (s_ele == -2) //Use status element
+ s_ele = status_get_attack_sc_element(src,status_get_sc(src));
+ else if( s_ele == -3 ) //Use random element
+ s_ele = rnd()%ELE_MAX;
+
+ dmg.damage = battle->attr_fix(bl, bl, dmg.damage, s_ele, status_get_element(bl), status_get_element_level(bl));
+
+ if( sc && sc->data[SC_ENERGYCOAT] ) {
+ struct status_data *status = status_get_status_data(bl);
+ int per = 100*status->sp / status->max_sp -1; //100% should be counted as the 80~99% interval
+ per /=20; //Uses 20% SP intervals.
+ //SP Cost: 1% + 0.5% per every 20% SP
+ if (!status_charge(bl, 0, (10+5*per)*status->max_sp/1000))
+ status_change_end(bl, SC_ENERGYCOAT, INVALID_TIMER);
+ //Reduction: 6% + 6% every 20%
+ dmg.damage -= dmg.damage * (6 * (1+per)) / 100;
+ }
+
+ }
#endif
}
if(sc && sc->data[SC_MAGICROD] && src == dsrc) {
@@ -4043,7 +4065,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->blown(src,bl,distance_bl(src,bl)-1,unit_getdir(src),0);
- if( battle->check_target(src,bl,BCT_ENEMY) )
+ if( battle->check_target(src,bl,BCT_ENEMY) > 0 )
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;
@@ -5223,7 +5245,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int bonus = 25 + 10 * skill_lv;
bonus += (pc_checkskill(sd, SA_FLAMELAUNCHER)+pc_checkskill(sd, SA_FROSTWEAPON)+pc_checkskill(sd, SA_LIGHTNINGLOADER)+pc_checkskill(sd, SA_SEISMICWEAPON))*5;
clif->skill_nodamage( src, bl, skill_id, skill_lv,
- battle->check_target(src,bl,BCT_PARTY) ?
+ battle->check_target(src,bl,BCT_PARTY) > 0 ?
sc_start2(bl, type, 100, skill_lv, bonus, skill->get_time(skill_id,skill_lv)) :
0
);
@@ -6344,7 +6366,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SC_DONTFORGETME:
case SC_FORTUNE:
case SC_SERVICE4U:
- if( tsc->data[i]->val4 ) //val4 = out-of-song-area
+ if( !tsc->data[i]->val4 ) //val4 = out-of-song-area
continue;
break;
case SC_ASSUMPTIO:
@@ -6635,18 +6657,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case NPC_EMOTION_ON:
case NPC_EMOTION:
- //va[0] is the emotion to use.
+ //val[0] is the emotion to use.
//NPC_EMOTION & NPC_EMOTION_ON can change a mob's mode 'permanently' [Skotlex]
//val[1] 'sets' the mode
//val[2] adds to the current mode
//val[3] removes from the current mode
//val[4] if set, asks to delete the previous mode change.
- if(md && md->skill_idx >= 0 && tsc)
- {
+ if(md && md->skill_idx >= 0 && tsc) {
clif->emotion(bl, md->db->skill[md->skill_idx].val[0]);
if(md->db->skill[md->skill_idx].val[4] && tsce)
status_change_end(bl, type, INVALID_TIMER);
+ //If mode gets set by NPC_EMOTION then the target should be reset [Playtester]
+ if(skill_id == NPC_EMOTION && md->db->skill[md->skill_idx].val[1])
+ mob_unlocktarget(md,tick);
+
if(md->db->skill[md->skill_idx].val[1] || md->db->skill[md->skill_idx].val[2])
sc_start4(src, type, 100, skill_lv,
md->db->skill[md->skill_idx].val[1],
@@ -7374,7 +7399,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case ALL_BUYING_STORE:
if( sd )
{// players only, skill allows 5 buying slots
- clif->skill_nodamage(src, bl, skill_id, skill_lv, buyingstore_setup(sd, MAX_BUYINGSTORE_SLOTS));
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, buyingstore->setup(sd, MAX_BUYINGSTORE_SLOTS));
}
break;
case RK_ENCHANTBLADE:
@@ -7740,7 +7765,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case WL_WHITEIMPRISON:
- if( (src == bl || battle->check_target(src, bl, BCT_ENEMY)) && !is_boss(bl) )// Should not work with bosses.
+ if( (src == bl || battle->check_target(src, bl, BCT_ENEMY) > 0 ) && !is_boss(bl) )// Should not work with bosses.
{
int rate = ( sd? sd->status.job_level : 50 ) / 4;
@@ -11670,11 +11695,11 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
case UNT_SEVERE_RAINSTORM:
- if( battle->check_target(&src->bl, bl, BCT_ENEMY) )
+ if( battle->check_target(&src->bl, bl, BCT_ENEMY) > 0 )
skill->attack(BF_WEAPON,ss,&src->bl,bl,WM_SEVERE_RAINSTORM_MELEE,sg->skill_lv,tick,0);
break;
case UNT_NETHERWORLD:
- if( !(status_get_mode(bl)&MD_BOSS) && ss != bl && battle->check_target(&src->bl, bl, BCT_PARTY) ) {
+ if( !(status_get_mode(bl)&MD_BOSS) && ss != bl && battle->check_target(&src->bl, bl, BCT_PARTY) > 0 ) {
if( !(tsc && tsc->data[type]) ){
sc_start(bl, type, 100, sg->skill_lv, skill->get_time2(sg->skill_id,sg->skill_lv));
sg->limit = DIFF_TICK(tick,sg->tick);
@@ -11811,7 +11836,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
case UNT_FIRE_MANTLE:
- if( battle->check_target(&src->bl, bl, BCT_ENEMY) )
+ if( battle->check_target(&src->bl, bl, BCT_ENEMY) > 0 )
skill->attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
break;
@@ -12855,7 +12880,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
MOBID_EMPERIUM, MOBID_GUARIDAN_STONE1, MOBID_GUARIDAN_STONE2)) {
char output[128];
sprintf(output, "You're too close to a stone or emperium to do this skill");
- clif->colormes(sd, COLOR_RED, output);
+ clif->colormes(sd->fd, COLOR_RED, output);
return 0;
}
}
@@ -13236,7 +13261,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
skill->get_desc(skill_id),
require.ammo_qty,
itemdb_jname(sd->status.inventory[i].nameid));
- clif->colormes(sd,COLOR_RED,e_msg);
+ clif->colormes(sd->fd,COLOR_RED,e_msg);
return 0;
}
if (!(require.ammo&1<<sd->inventory_data[i]->look)) { //Ammo type check. Send the "wrong weapon type" message
@@ -14160,9 +14185,9 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
pc_delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
if (per > rnd() % 100) {
- log_pick_pc(sd, LOG_TYPE_OTHER, -1, item);
+ logs->pick_pc(sd, LOG_TYPE_OTHER, -1, item, ditem);
item->refine++;
- log_pick_pc(sd, LOG_TYPE_OTHER, 1, item);
+ logs->pick_pc(sd, LOG_TYPE_OTHER, 1, item, ditem);
if(item->equip) {
ep = item->equip;
pc_unequipitem(sd,idx,3);
diff --git a/src/map/skill.h b/src/map/skill.h
index d1d7d1894..3e2fc7936 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -95,7 +95,6 @@ enum e_skill_inf2 {
INF2_NO_ENEMY = 0x1000,
INF2_NOLP = 0x2000, // Spells that can ignore Land Protector
INF2_CHORUS_SKILL = 0x4000, // Chorus skill
- INF2_CLONE_NOCOPY = 0x8000, // Clones will not copy this skill
};
diff --git a/src/map/sql/CMakeLists.txt b/src/map/sql/CMakeLists.txt
index 2efeabd02..1b2c19979 100644
--- a/src/map/sql/CMakeLists.txt
+++ b/src/map/sql/CMakeLists.txt
@@ -17,8 +17,9 @@ set( SQL_MAP_HEADERS
"${SQL_MAP_SOURCE_DIR}/elemental.h"
"${SQL_MAP_SOURCE_DIR}/guild.h"
"${SQL_MAP_SOURCE_DIR}/homunculus.h"
- "${SQL_MAP_SOURCE_DIR}/instance.h"
+ "${SQL_MAP_SOURCE_DIR}/instance.h"
"${SQL_MAP_SOURCE_DIR}/intif.h"
+ "${SQL_MAP_SOURCE_DIR}/irc-bot.h"
"${SQL_MAP_SOURCE_DIR}/itemdb.h"
"${SQL_MAP_SOURCE_DIR}/log.h"
"${SQL_MAP_SOURCE_DIR}/mail.h"
@@ -28,6 +29,7 @@ set( SQL_MAP_HEADERS
"${SQL_MAP_SOURCE_DIR}/mob.h"
"${SQL_MAP_SOURCE_DIR}/npc.h"
"${SQL_MAP_SOURCE_DIR}/packets.h"
+ "${SQL_MAP_SOURCE_DIR}/packets_struct.h"
"${SQL_MAP_SOURCE_DIR}/party.h"
"${SQL_MAP_SOURCE_DIR}/path.h"
"${SQL_MAP_SOURCE_DIR}/pc.h"
@@ -58,6 +60,7 @@ set( SQL_MAP_SOURCES
"${SQL_MAP_SOURCE_DIR}/homunculus.c"
"${SQL_MAP_SOURCE_DIR}/instance.c"
"${SQL_MAP_SOURCE_DIR}/intif.c"
+ "${SQL_MAP_SOURCE_DIR}/irc-bot.c"
"${SQL_MAP_SOURCE_DIR}/itemdb.c"
"${SQL_MAP_SOURCE_DIR}/log.c"
"${SQL_MAP_SOURCE_DIR}/mail.c"
diff --git a/src/map/status.c b/src/map/status.c
index 5d41acbe0..3892d94cc 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1503,6 +1503,10 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
if( skill_id == map[src->m].zone->disabled_skills[i]->nameid && (map[src->m].zone->disabled_skills[i]->type&src->type) ) {
if( src->type == BL_PC )
clif->msg((TBL_PC*)src, SKILL_CANT_USE_AREA); // This skill cannot be used within this area
+ else if( src->type == BL_MOB && map[src->m].zone->disabled_skills[i]->subtype != MZS_NONE ) {
+ if( (status->mode&MD_BOSS) && !(map[src->m].zone->disabled_skills[i]->subtype&MZS_BOSS) )
+ break;
+ }
return 0;
}
}
@@ -2335,7 +2339,8 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
memset(&status->max_hp, 0, sizeof(struct status_data)-(sizeof(status->hp)+sizeof(status->sp)));
//FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex]
- status->speed = DEFAULT_WALK_SPEED;
+ if (!sd->state.permanent_speed)
+ status->speed = DEFAULT_WALK_SPEED;
//Give them all modes except these (useful for clones)
status->mode = MD_MASK&~(MD_BOSS|MD_PLANT|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK);
@@ -4988,6 +4993,9 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
if( sc == NULL )
return cap_value(speed,10,USHRT_MAX);
+ if (sd && sd->state.permanent_speed)
+ return (short)cap_value(speed,10,USHRT_MAX);
+
if( sd && sd->ud.skilltimer != INVALID_TIMER && (pc_checkskill(sd,SA_FREECAST) > 0 || sd->ud.skill_id == LG_EXEEDBREAK) )
{
if( sd->ud.skill_id == LG_EXEEDBREAK )
@@ -6078,7 +6086,12 @@ void status_change_init(struct block_list *bl)
//the flag values are the same as in status_change_start.
int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int tick, int flag)
{
- int sc_def = 0, tick_def = 0;
+ //Percentual resistance: 10000 = 100% Resist
+ //Example: 50% -> sc_def=5000 -> 25%; 5000ms -> tick_def=5000 -> 2500ms
+ int sc_def = 0, tick_def = -1; //-1 = use sc_def
+ //Linear resistance substracted from rate and tick after percentual resistance was applied
+ //Example: 25% -> sc_def2=2000 -> 5%; 2500ms -> tick_def2=2000 -> 500ms
+ int sc_def2 = 0, tick_def2 = -1; //-1 = use sc_def2
struct status_data* status;
struct status_change* sc;
struct map_session_data *sd;
@@ -6127,67 +6140,72 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
if( sc && !sc->count )
sc = NULL;
switch (type) {
- case SC_STUN:
- case SC_POISON:
- if( sc && sc->data[SC__UNLUCKY] )
- return tick;
- case SC_DPOISON:
- case SC_SILENCE:
- case SC_BLEEDING:
- sc_def = 3 +status->vit;
- break;
- case SC_SLEEP:
- sc_def = 3 +status->int_;
- break;
- case SC_DEEPSLEEP:
- tick_def = status->int_ / 10 + status_get_lv(bl) * 65 / 1000; // Seems to be -1 sec every 10 int and -5% chance every 10 int.
- sc_def = 5 * status->int_ /10;
- break;
- case SC_DECREASEAGI:
- case SC_ADORAMUS://Arch Bishop
- if (sd) tick>>=1; //Half duration for players.
- case SC_STONE:
- case SC_FREEZE:
- sc_def = 3 +status->mdef;
- break;
- case SC_CURSE:
- //Special property: inmunity when luk is greater than level or zero
- if (status->luk > status_get_lv(bl) || status->luk == 0)
- return 0;
- else
- sc_def = 3 +status->luk;
- tick_def = status->vit;
- break;
- case SC_BLIND:
- if( sc && sc->data[SC__UNLUCKY] )
- return tick;
- sc_def = 3 +(status->vit + status->int_)/2;
- break;
- case SC_CONFUSION:
- sc_def = 3 +(status->str + status->int_)/2;
- break;
- case SC_ANKLE:
- if(status->mode&MD_BOSS) // Lasts 5 times less on bosses
- tick /= 5;
- sc_def = status->agi / 2;
- break;
- case SC_MAGICMIRROR:
- case SC_ARMORCHANGE:
- if (sd) //Duration greatly reduced for players.
- tick /= 15;
- //No defense against it (buff).
- rate -= (status_get_lv(bl) / 5 + status->vit / 4 + status->agi / 10)*100; // Lineal Reduction of Rate
- break;
+ case SC_STUN:
+ case SC_POISON:
+ if( sc && sc->data[SC__UNLUCKY] )
+ return tick;
+ case SC_DPOISON:
+ case SC_SILENCE:
+ case SC_BLEEDING:
+ sc_def = status->vit*100;
+ sc_def2 = status->luk*10;
+ break;
+ case SC_SLEEP:
+ sc_def = status->int_*100;
+ sc_def2 = status->luk*10;
+ break;
+ case SC_DEEPSLEEP:
+ sc_def = status->int_*50;
+ tick_def = status->int_*10 + status_get_lv(bl) * 65 / 10; //Seems to be -1 sec every 10 int and -5% chance every 10 int.
+ break;
+ case SC_DECREASEAGI:
+ case SC_ADORAMUS: //Arch Bishop
+ if (sd) tick>>=1; //Half duration for players.
+ case SC_STONE:
+ //Impossible to reduce duration with stats
+ tick_def = 0;
+ tick_def2 = 0;
+ case SC_FREEZE:
+ sc_def = status->mdef*100;
+ sc_def2 = status->luk*10;
+ break;
+ case SC_CURSE:
+ //Special property: inmunity when luk is greater than level or zero
+ if (status->luk > status_get_lv(bl) || status->luk == 0)
+ return 0;
+ sc_def = status->luk*100;
+ sc_def2 = status->luk*10;
+ tick_def = status->vit*100;
+ break;
+ case SC_BLIND:
+ if( sc && sc->data[SC__UNLUCKY] )
+ return tick;
+ sc_def = (status->vit + status->int_)*50;
+ sc_def2 = status->luk*10;
+ break;
+ case SC_CONFUSION:
+ sc_def = (status->str + status->int_)*50;
+ sc_def2 = status->luk*10;
+ break;
+ case SC_ANKLE:
+ if(status->mode&MD_BOSS) // Lasts 5 times less on bosses
+ tick /= 5;
+ sc_def = status->agi*50;
+ break;
+ case SC_MAGICMIRROR:
+ case SC_ARMORCHANGE:
+ if (sd) //Duration greatly reduced for players.
+ tick /= 15;
+ sc_def2 = status_get_lv(bl)*20 + status->vit*25 + status->agi*10; // Lineal Reduction of Rate
+ tick_def2 = 0; //No duration reduction
+ break;
case SC_MARSHOFABYSS:
//5 second (Fixed) + 25 second - {( INT + LUK ) / 20 second }
- tick -= (status->int_ + status->luk) / 20 * 1000;
+ tick_def2 = (status->int_ + status->luk)*50;
break;
case SC_STASIS:
//5 second (fixed) + { Stasis Skill level * 5 - (Target's VIT + DEX) / 20 }
- tick -= (status->vit + status->dex) / 20 * 1000;
- break;
- case SC_WHITEIMPRISON:
- if( tick == 5000 ) // 100% on caster
+ tick_def2 = (status->vit + status->dex)*50;
break;
if( bl->type == BL_PC )
tick -= (status_get_lv(bl) / 5 + status->vit / 4 + status->agi / 10)*100;
@@ -6236,51 +6254,58 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
if (sd) {
- if (battle_config.pc_sc_def_rate != 100)
+ if (battle_config.pc_sc_def_rate != 100) {
sc_def = sc_def*battle_config.pc_sc_def_rate/100;
+ sc_def2 = sc_def2*battle_config.pc_sc_def_rate/100;
+ }
- if (sc_def < battle_config.pc_max_sc_def)
- sc_def += (battle_config.pc_max_sc_def - sc_def)*
- status->luk/battle_config.pc_luk_sc_def;
- else
- sc_def = battle_config.pc_max_sc_def;
+ sc_def = min(sc_def, battle_config.pc_max_sc_def*100);
+ sc_def2 = min(sc_def2, battle_config.pc_max_sc_def*100);
- if (tick_def) {
- if (battle_config.pc_sc_def_rate != 100)
- tick_def = tick_def*battle_config.pc_sc_def_rate/100;
+ if (tick_def > 0 && battle_config.pc_sc_def_rate != 100) {
+ tick_def = tick_def*battle_config.pc_sc_def_rate/100;
+ tick_def2 = tick_def2*battle_config.pc_sc_def_rate/100;
}
-
} else {
- if (battle_config.mob_sc_def_rate != 100)
+ if (battle_config.mob_sc_def_rate != 100) {
sc_def = sc_def*battle_config.mob_sc_def_rate/100;
+ sc_def2 = sc_def2*battle_config.mob_sc_def_rate/100;
+ }
- if (sc_def < battle_config.mob_max_sc_def)
- sc_def += (battle_config.mob_max_sc_def - sc_def)*
- status->luk/battle_config.mob_luk_sc_def;
- else
- sc_def = battle_config.mob_max_sc_def;
+ sc_def = min(sc_def, battle_config.mob_max_sc_def*100);
+ sc_def2 = min(sc_def2, battle_config.mob_max_sc_def*100);
- if (tick_def) {
- if (battle_config.mob_sc_def_rate != 100)
- tick_def = tick_def*battle_config.mob_sc_def_rate/100;
+ if (tick_def > 0 && battle_config.mob_sc_def_rate != 100) {
+ tick_def = tick_def*battle_config.mob_sc_def_rate/100;
+ tick_def2 = tick_def2*battle_config.mob_sc_def_rate/100;
}
}
if (sc) {
if (sc->data[SC_SCRESIST])
- sc_def += sc->data[SC_SCRESIST]->val1; //Status resist
+ sc_def += sc->data[SC_SCRESIST]->val1*100; //Status resist
else if (sc->data[SC_SIEGFRIED])
- sc_def += sc->data[SC_SIEGFRIED]->val3; //Status resistance.
+ sc_def += sc->data[SC_SIEGFRIED]->val3*100; //Status resistance.
}
//When no tick def, reduction is the same for both.
- if( !tick_def && type != SC_STONE ) //Recent tests show duration of petrify isn't reduced by MDEF. [Inkfish]
+ if(tick_def < 0)
tick_def = sc_def;
+ if(tick_def2 < 0)
+ tick_def2 = sc_def2;
//Natural resistance
if (!(flag&8)) {
- rate -= rate*sc_def/100;
+ rate -= rate*sc_def/10000;
+ rate -= sc_def2;
+
+ //Minimum chances
+ switch (type) {
+ case SC_BITE:
+ rate = max(rate, 5000); //Minimum of 50%
+ break;
+ }
//Item resistance (only applies to rate%)
if(sd && SC_COMMON_MIN <= type && type <= SC_COMMON_MAX)
@@ -6291,22 +6316,38 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
rate -= rate*sd->sc.data[SC_COMMONSC_RESIST]->val1/100;
}
}
+
if (!(rnd()%10000 < rate))
return 0;
- //Why would a status start with no duration? Presume it has
- //duration defined elsewhere.
- if (!tick) return 1;
+ //Even if a status change doesn't have a duration, it should still trigger
+ if (tick < 1) return 1;
//Rate reduction
- if (flag&2)
+ if (flag&2)
return tick;
- tick -= tick*tick_def/100;
- // Changed to 5 seconds according to recent tests [Playtester]
- if (type == SC_ANKLE && tick < 5000)
- tick = 5000;
- return tick<=0?0:tick;
+ tick -= tick*tick_def/10000;
+ tick -= tick_def2;
+
+ //Minimum durations
+ switch (type) {
+ case SC_ANKLE:
+ case SC_MARSHOFABYSS:
+ case SC_STASIS:
+ tick = max(tick, 5000); //Minimum duration 5s
+ break;
+ case SC_BURNING:
+ case SC_FREEZING:
+ tick = max(tick, 10000); //Minimum duration 10s
+ break;
+ default:
+ //Skills need to trigger even if the duration is reduced below 1ms
+ tick = max(tick, 1);
+ break;
+ }
+
+ return tick;
}
/*==========================================
@@ -6552,11 +6593,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
opt_flag = 0; //Reuse to check success condition.
if(sd->bonus.unstripable_equip&EQP_WEAPON)
return 0;
- i = sd->equip_index[EQI_HAND_L];
- if (i>=0 && sd->inventory_data[i] && sd->inventory_data[i]->type == IT_WEAPON) {
- opt_flag|=1;
- pc_unequipitem(sd,i,3); //L-hand weapon
- }
i = sd->equip_index[EQI_HAND_R];
if (i>=0 && sd->inventory_data[i] && sd->inventory_data[i]->type == IT_WEAPON) {
@@ -7258,7 +7294,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_MERC_QUICKEN:
val2 = 300;
break;
-#ifndef RENEWAL
+#ifndef RENEWAL_ASPD
case SC_SPEARQUICKEN:
val2 = 200+10*val1;
break;
@@ -8966,7 +9002,6 @@ int status_change_clear(struct block_list* bl, int type) {
sc->opt1 = 0;
sc->opt2 = 0;
sc->opt3 = 0;
- sc->option &= OPTION_MASK;
if( type == 0 || type == 2 )
clif->changeoption(bl);
@@ -9853,6 +9888,9 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
if (--(sce->val4) >= 0) {
int hp = rnd()%600 + 200;
struct block_list* src = map_id2bl(sce->val2);
+ if( src && bl && bl->type == BL_MOB ) {
+ mob_log_damage((TBL_MOB*)bl,src,sd||hp<status->hp?hp:status->hp-1);
+ }
map_freeblock_lock();
status_fix_damage(src, bl, sd||hp<status->hp?hp:status->hp-1, 1);
if( sc->data[type] ) {
diff --git a/src/map/status.h b/src/map/status.h
index 4535b1aed..3c02b9d6c 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -1488,7 +1488,6 @@ enum {
// compound constants
OPTION_DRAGON = OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5,
- OPTION_MASK = ~OPTION_INVISIBLE,
};
//Defines for the manner system [Skotlex]
diff --git a/src/map/trade.c b/src/map/trade.c
index 0b9609322..1417426e9 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -77,7 +77,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
}
// Players can not request trade from far away, unless they are allowed to use @trade.
- if (!pc_can_use_command(sd, "trade", COMMAND_ATCOMMAND) &&
+ if (!pc_can_use_command(sd, "@trade") &&
(sd->bl.m != target_sd->bl.m || !check_distance_bl(&sd->bl, &target_sd->bl, TRADE_DISTANCE))) {
clif->tradestart(sd, 0); // too far
return ;
@@ -135,7 +135,7 @@ void trade_tradeack(struct map_session_data *sd, int type)
// Players can not request trade from far away, unless they are allowed to use @trade.
// Check here as well since the original character could had warped.
- if (!pc_can_use_command(sd, "trade", COMMAND_ATCOMMAND) &&
+ if (!pc_can_use_command(sd, "@trade") &&
(sd->bl.m != tsd->bl.m || !check_distance_bl(&sd->bl, &tsd->bl, TRADE_DISTANCE))) {
clif->tradestart(sd, 0); // too far
sd->trade_partner=0;
@@ -178,8 +178,7 @@ int impossible_trade_check(struct map_session_data *sd)
nullpo_retr(1, sd);
- if(sd->deal.zeny > sd->status.zeny)
- {
+ if(sd->deal.zeny > sd->status.zeny) {
pc_setglobalreg(sd,"ZENY_HACKER",1);
return -1;
}
diff --git a/src/map/unit.c b/src/map/unit.c
index 4732b89dd..952b1a20e 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -330,7 +330,7 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
&& wpd.path_len > 14 ) // Official number of walkable cells is 14 if and only if there is an obstacle between. [malufett]
return 0;
#endif
- if( battle_config.max_walk_path < wpd.path_len )
+ if( (battle_config.max_walk_path < wpd.path_len) && (bl->type != BL_NPC) )
return 0;
if (flag&4 && DIFF_TICK(ud->canmove_tick, gettick()) > 0 &&
@@ -406,7 +406,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
ud = unit_bl2ud(bl);
if( ud == NULL) return 0;
-
+
if (!(status_get_mode(bl)&MD_CANMOVE))
return 0;
@@ -416,13 +416,13 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
ud->target_to = 0;
return 0;
}
-
+
ud->state.walk_easy = flag&1;
ud->target_to = tbl->id;
ud->chaserange = range; //Note that if flag&2, this SHOULD be attack-range
ud->state.attack_continue = flag&2?1:0; //Chase to attack.
unit_set_target(ud, 0);
-
+
sc = status_get_sc(bl);
if (sc && sc->data[SC_CONFUSION]) //Randomize the target position
map_random_dir(bl, &ud->to_x, &ud->to_y);
@@ -432,7 +432,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
set_mobstate(bl, flag&2);
return 1;
}
-
+
if(DIFF_TICK(ud->canmove_tick, gettick()) > 0)
{ //Can't move, wait a bit before invoking the movement.
add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target);
@@ -1149,40 +1149,40 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
if(sd) {
if( (skill->get_inf2(skill_id)&INF2_ENSEMBLE_SKILL) && skill->check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 1 ) {
- clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
- }
-
+ }
+
switch(skill_id){
- case SA_CASTCANCEL:
- if(ud->skill_id != skill_id){
- sd->skill_id_old = ud->skill_id;
- sd->skill_lv_old = ud->skill_lv;
- }
- break;
- case BD_ENCORE:
- //Prevent using the dance skill if you no longer have the skill in your tree.
- if(!sd->skill_id_dance || pc_checkskill(sd,sd->skill_id_dance)<=0){
- clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- return 0;
+ case SA_CASTCANCEL:
+ if(ud->skill_id != skill_id){
+ sd->skill_id_old = ud->skill_id;
+ sd->skill_lv_old = ud->skill_lv;
+ }
+ break;
+ case BD_ENCORE:
+ //Prevent using the dance skill if you no longer have the skill in your tree.
+ if(!sd->skill_id_dance || pc_checkskill(sd,sd->skill_id_dance)<=0){
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+ sd->skill_id_old = skill_id;
+ break;
+ case WL_WHITEIMPRISON:
+ if( battle->check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) {
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0);
+ return 0;
+ }
+ break;
+ case MG_FIREBOLT:
+ case MG_LIGHTNINGBOLT:
+ case MG_COLDBOLT:
+ sd->skill_id_old = skill_id;
+ sd->skill_lv_old = skill_lv;
+ break;
}
- sd->skill_id_old = skill_id;
- break;
- case WL_WHITEIMPRISON:
- if( battle->check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) {
- clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0);
+ if (!skill->check_condition_castbegin(sd, skill_id, skill_lv))
return 0;
- }
- break;
- case MG_FIREBOLT:
- case MG_LIGHTNINGBOLT:
- case MG_COLDBOLT:
- sd->skill_id_old = skill_id;
- sd->skill_lv_old = skill_lv;
- break;
- }
- if (!skill->check_condition_castbegin(sd, skill_id, skill_lv))
- return 0;
}
if( src->type == BL_MOB )
@@ -2089,13 +2089,18 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
case BL_PC: {
struct map_session_data *sd = (struct map_session_data*)bl;
+ if(sd->shadowform_id){
+ struct block_list *d_bl = map_id2bl(sd->shadowform_id);
+ if( d_bl )
+ status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
+ }
//Leave/reject all invitations.
if(sd->chatID)
chat_leavechat(sd,0);
if(sd->trade_partner)
trade_tradecancel(sd);
- buyingstore_close(sd);
- searchstore_close(sd);
+ buyingstore->close(sd);
+ searchstore->close(sd);
if(sd->state.storage_flag == 1)
storage_storage_quit(sd,0);
else if (sd->state.storage_flag == 2)
diff --git a/src/map/vending.c b/src/map/vending.c
index 1f96672f4..1576b684e 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/nullpo.h"
#include "../common/strlib.h"
@@ -20,33 +21,28 @@
#include <stdio.h>
#include <string.h>
-static int vending_nextid = 0;
-
/// Returns an unique vending shop id.
-static int vending_getuid(void)
-{
- return vending_nextid++;
+static inline unsigned int getid(void) {
+ return vending->next_id++;
}
/*==========================================
* Close shop
*------------------------------------------*/
-void vending_closevending(struct map_session_data* sd)
-{
+void vending_closevending(struct map_session_data* sd) {
nullpo_retv(sd);
- if( sd->state.vending )
- {
+ if( sd->state.vending ) {
sd->state.vending = false;
clif->closevendingboard(&sd->bl, 0);
+ idb_remove(vending->db, sd->status.char_id);
}
}
/*==========================================
* Request a shop's item list
*------------------------------------------*/
-void vending_vendinglistreq(struct map_session_data* sd, int id)
-{
+void vending_vendinglistreq(struct map_session_data* sd, unsigned int id) {
struct map_session_data* vsd;
nullpo_retv(sd);
@@ -55,8 +51,8 @@ void vending_vendinglistreq(struct map_session_data* sd, int id)
if( !vsd->state.vending )
return; // not vending
- if (!pc_can_give_items(sd) || !pc_can_give_items(vsd)) //check if both GMs are allowed to trade
- { // GM is not allowed to trade
+ if (!pc_can_give_items(sd) || !pc_can_give_items(vsd)) { //check if both GMs are allowed to trade
+ // GM is not allowed to trade
clif->message(sd->fd, msg_txt(246));
return;
}
@@ -69,27 +65,25 @@ void vending_vendinglistreq(struct map_session_data* sd, int id)
/*==========================================
* Purchase item(s) from a shop
*------------------------------------------*/
-void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const uint8* data, int count)
-{
+void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, const uint8* data, int count) {
int i, j, cursor, w, new_ = 0, blank, vend_list[MAX_VENDING];
double z;
- struct s_vending vending[MAX_VENDING]; // against duplicate packets
+ struct s_vending vend[MAX_VENDING]; // against duplicate packets
struct map_session_data* vsd = map_id2sd(aid);
nullpo_retv(sd);
if( vsd == NULL || !vsd->state.vending || vsd->bl.id == sd->bl.id )
return; // invalid shop
- if( vsd->vender_id != uid )
- {// shop has changed
+ if( vsd->vender_id != uid ) { // shop has changed
clif->buyvending(sd, 0, 0, 6); // store information was incorrect
return;
}
- if( !searchstore_queryremote(sd, aid) && ( sd->bl.m != vsd->bl.m || !check_distance_bl(&sd->bl, &vsd->bl, AREA_SIZE) ) )
+ if( !searchstore->queryremote(sd, aid) && ( sd->bl.m != vsd->bl.m || !check_distance_bl(&sd->bl, &vsd->bl, AREA_SIZE) ) )
return; // shop too far away
- searchstore_clearremote(sd);
+ searchstore->clearremote(sd);
if( count < 1 || count > MAX_VENDING || count > vsd->vend_num )
return; // invalid amount of purchased items
@@ -97,13 +91,12 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
blank = pc_inventoryblank(sd); //number of free cells in the buyer's inventory
// duplicate item in vending to check hacker with multiple packets
- memcpy(&vending, &vsd->vending, sizeof(vsd->vending)); // copy vending list
+ memcpy(&vend, &vsd->vending, sizeof(vsd->vending)); // copy vending list
// some checks
z = 0.; // zeny counter
w = 0; // weight counter
- for( i = 0; i < count; i++ )
- {
+ for( i = 0; i < count; i++ ) {
short amount = *(uint16*)(data + 4*i + 0);
short idx = *(uint16*)(data + 4*i + 2);
idx -= 2;
@@ -122,49 +115,45 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
vend_list[i] = j;
z += ((double)vsd->vending[j].value * (double)amount);
- if( z > (double)sd->status.zeny || z < 0. || z > (double)MAX_ZENY )
- {
+ if( z > (double)sd->status.zeny || z < 0. || z > (double)MAX_ZENY ) {
clif->buyvending(sd, idx, amount, 1); // you don't have enough zeny
return;
}
- if( z + (double)vsd->status.zeny > (double)MAX_ZENY && !battle_config.vending_over_max )
- {
+ if( z + (double)vsd->status.zeny > (double)MAX_ZENY && !battle_config.vending_over_max ) {
clif->buyvending(sd, idx, vsd->vending[j].amount, 4); // too much zeny = overflow
return;
}
w += itemdb_weight(vsd->status.cart[idx].nameid) * amount;
- if( w + sd->weight > sd->max_weight )
- {
+ if( w + sd->weight > sd->max_weight ) {
clif->buyvending(sd, idx, amount, 2); // you can not buy, because overweight
return;
}
//Check to see if cart/vend info is in sync.
- if( vending[j].amount > vsd->status.cart[idx].amount )
- vending[j].amount = vsd->status.cart[idx].amount;
+ if( vend[j].amount > vsd->status.cart[idx].amount )
+ vend[j].amount = vsd->status.cart[idx].amount;
// if they try to add packets (example: get twice or more 2 apples if marchand has only 3 apples).
// here, we check cumulative amounts
- if( vending[j].amount < amount )
- {
+ if( vend[j].amount < amount ) {
// send more quantity is not a hack (an other player can have buy items just before)
clif->buyvending(sd, idx, vsd->vending[j].amount, 4); // not enough quantity
return;
}
- vending[j].amount -= amount;
+ vend[j].amount -= amount;
switch( pc_checkadditem(sd, vsd->status.cart[idx].nameid, amount) ) {
- case ADDITEM_EXIST:
- break; //We'd add this item to the existing one (in buyers inventory)
- case ADDITEM_NEW:
- new_++;
- if (new_ > blank)
- return; //Buyer has no space in his inventory
- break;
- case ADDITEM_OVERAMOUNT:
- return; //too many items
+ case ADDITEM_EXIST:
+ break; //We'd add this item to the existing one (in buyers inventory)
+ case ADDITEM_NEW:
+ new_++;
+ if (new_ > blank)
+ return; //Buyer has no space in his inventory
+ break;
+ case ADDITEM_OVERAMOUNT:
+ return; //too many items
}
}
@@ -173,8 +162,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
z -= z * (battle_config.vending_tax/10000.);
pc_getzeny(vsd, (int)z, LOG_TYPE_VENDING, sd);
- for( i = 0; i < count; i++ )
- {
+ for( i = 0; i < count; i++ ) {
short amount = *(uint16*)(data + 4*i + 0);
short idx = *(uint16*)(data + 4*i + 2);
idx -= 2;
@@ -186,8 +174,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
clif->vendingreport(vsd, idx, amount);
//print buyer's name
- if( battle_config.buyer_name )
- {
+ if( battle_config.buyer_name ) {
char temp[256];
sprintf(temp, msg_txt(265), sd->status.name);
clif->disp_onlyself(vsd,temp,strlen(temp));
@@ -195,13 +182,11 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
}
// compact the vending list
- for( i = 0, cursor = 0; i < vsd->vend_num; i++ )
- {
+ for( i = 0, cursor = 0; i < vsd->vend_num; i++ ) {
if( vsd->vending[i].amount == 0 )
continue;
- if( cursor != i ) // speedup
- {
+ if( cursor != i ) { // speedup
vsd->vending[cursor].index = vsd->vending[i].index;
vsd->vending[cursor].amount = vsd->vending[i].amount;
vsd->vending[cursor].value = vsd->vending[i].value;
@@ -212,21 +197,18 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
vsd->vend_num = cursor;
//Always save BOTH: buyer and customer
- if( save_settings&2 )
- {
+ if( save_settings&2 ) {
chrif_save(sd,0);
chrif_save(vsd,0);
}
//check for @AUTOTRADE users [durf]
- if( vsd->state.autotrade )
- {
+ if( vsd->state.autotrade ) {
//see if there is anything left in the shop
ARR_FIND( 0, vsd->vend_num, i, vsd->vending[i].amount > 0 );
- if( i == vsd->vend_num )
- {
+ if( i == vsd->vend_num ) {
//Close Vending (this was automatically done by the client, we have to do it manually for autovenders) [Skotlex]
- vending_closevending(vsd);
+ vending->close(vsd);
map_quit(vsd); //They have no reason to stay around anymore, do they?
}
}
@@ -246,23 +228,21 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
vending_skill_lvl = pc_checkskill(sd, MC_VENDING);
// skill level and cart check
- if( !vending_skill_lvl || !pc_iscarton(sd) )
- {
+ if( !vending_skill_lvl || !pc_iscarton(sd) ) {
clif->skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
return;
}
// check number of items in shop
- if( count < 1 || count > MAX_VENDING || count > 2 + vending_skill_lvl )
- { // invalid item count
+ if( count < 1 || count > MAX_VENDING || count > 2 + vending_skill_lvl ) {
+ // invalid item count
clif->skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
return;
}
// filter out invalid items
i = 0;
- for( j = 0; j < count; j++ )
- {
+ for( j = 0; j < count; j++ ) {
short index = *(uint16*)(data + 8*j + 0);
short amount = *(uint16*)(data + 8*j + 2);
unsigned int value = *(uint32*)(data + 8*j + 4);
@@ -288,35 +268,33 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
if( i != j )
clif->message (sd->fd, msg_txt(266)); //"Some of your items cannot be vended and were removed from the shop."
- if( i == 0 )
- { // no valid item found
+ if( i == 0 ) { // no valid item found
clif->skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); // custom reply packet
return;
}
sd->state.prevend = 0;
sd->state.vending = true;
- sd->vender_id = vending_getuid();
+ sd->vender_id = getid();
sd->vend_num = i;
safestrncpy(sd->message, message, MESSAGE_SIZE);
clif->openvending(sd,sd->bl.id,sd->vending);
clif->showvendingboard(&sd->bl,message,0);
+
+ idb_put(vending->db, sd->vender_id, sd);
}
/// Checks if an item is being sold in given player's vending.
-bool vending_search(struct map_session_data* sd, unsigned short nameid)
-{
+bool vending_search(struct map_session_data* sd, unsigned short nameid) {
int i;
- if( !sd->state.vending )
- {// not vending
+ if( !sd->state.vending ) { // not vending
return false;
}
ARR_FIND( 0, sd->vend_num, i, sd->status.cart[sd->vending[i].index].nameid == (short)nameid );
- if( i == sd->vend_num )
- {// not found
+ if( i == sd->vend_num ) { // not found
return false;
}
@@ -326,46 +304,36 @@ bool vending_search(struct map_session_data* sd, unsigned short nameid)
/// Searches for all items in a vending, that match given ids, price and possible cards.
/// @return Whether or not the search should be continued.
-bool vending_searchall(struct map_session_data* sd, const struct s_search_store_search* s)
-{
+bool vending_searchall(struct map_session_data* sd, const struct s_search_store_search* s) {
int i, c, slot;
unsigned int idx, cidx;
struct item* it;
- if( !sd->state.vending )
- {// not vending
+ if( !sd->state.vending ) // not vending
return true;
- }
- for( idx = 0; idx < s->item_count; idx++ )
- {
+ for( idx = 0; idx < s->item_count; idx++ ) {
ARR_FIND( 0, sd->vend_num, i, sd->status.cart[sd->vending[i].index].nameid == (short)s->itemlist[idx] );
- if( i == sd->vend_num )
- {// not found
+ if( i == sd->vend_num ) {// not found
continue;
}
it = &sd->status.cart[sd->vending[i].index];
- if( s->min_price && s->min_price > sd->vending[i].value )
- {// too low price
+ if( s->min_price && s->min_price > sd->vending[i].value ) {// too low price
continue;
}
- if( s->max_price && s->max_price < sd->vending[i].value )
- {// too high price
+ if( s->max_price && s->max_price < sd->vending[i].value ) {// too high price
continue;
}
- if( s->card_count )
- {// check cards
- if( itemdb_isspecial(it->card[0]) )
- {// something, that is not a carded
+ if( s->card_count ) {// check cards
+ if( itemdb_isspecial(it->card[0]) ) {// something, that is not a carded
continue;
}
slot = itemdb_slot(it->nameid);
- for( c = 0; c < slot && it->card[c]; c ++ )
- {
+ for( c = 0; c < slot && it->card[c]; c ++ ) {
ARR_FIND( 0, s->card_count, cidx, s->cardlist[cidx] == it->card[c] );
if( cidx != s->card_count )
{// found
@@ -373,13 +341,12 @@ bool vending_searchall(struct map_session_data* sd, const struct s_search_store_
}
}
- if( c == slot || !it->card[c] )
- {// no card match
+ if( c == slot || !it->card[c] ) {// no card match
continue;
}
}
- if( !searchstore_result(s->search_sd, sd->vender_id, sd->status.account_id, sd->message, it->nameid, sd->vending[i].amount, sd->vending[i].value, it->card, it->refine) )
+ if( !searchstore->result(s->search_sd, sd->vender_id, sd->status.account_id, sd->message, it->nameid, sd->vending[i].amount, sd->vending[i].value, it->card, it->refine) )
{// result set full
return false;
}
@@ -387,3 +354,25 @@ bool vending_searchall(struct map_session_data* sd, const struct s_search_store_
return true;
}
+void final(void) {
+ db_destroy(vending->db);
+}
+
+void init(void) {
+ vending->db = idb_alloc(DB_OPT_BASE);
+ vending->next_id = 0;
+}
+
+void vending_defaults(void) {
+ vending = &vending_s;
+
+ vending->init = init;
+ vending->final = final;
+
+ vending->close = vending_closevending;
+ vending->open = vending_openvending;
+ vending->list = vending_vendinglistreq;
+ vending->purchase = vending_purchasereq;
+ vending->search = vending_search;
+ vending->searchall = vending_searchall;
+}
diff --git a/src/map/vending.h b/src/map/vending.h
index 402df5579..0148deb71 100644
--- a/src/map/vending.h
+++ b/src/map/vending.h
@@ -1,11 +1,12 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _VENDING_H_
#define _VENDING_H_
#include "../common/cbasetypes.h"
-//#include "map.h"
+#include "../common/db.h"
struct map_session_data;
struct s_search_store_search;
@@ -15,11 +16,23 @@ struct s_vending {
unsigned int value; //at wich price
};
-void vending_closevending(struct map_session_data* sd);
-void vending_openvending(struct map_session_data* sd, const char* message, const uint8* data, int count);
-void vending_vendinglistreq(struct map_session_data* sd, int id);
-void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const uint8* data, int count);
-bool vending_search(struct map_session_data* sd, unsigned short nameid);
-bool vending_searchall(struct map_session_data* sd, const struct s_search_store_search* s);
+struct vending_interface {
+ unsigned int next_id;/* next vender id */
+ DBMap *db;
+ /* */
+ void (*init) (void);
+ void (*final) (void);
+ /* */
+ void (*close) (struct map_session_data* sd);
+ void (*open) (struct map_session_data* sd, const char* message, const uint8* data, int count);
+ void (*list) (struct map_session_data* sd, unsigned int id);
+ void (*purchase) (struct map_session_data* sd, int aid, unsigned int uid, const uint8* data, int count);
+ bool (*search) (struct map_session_data* sd, unsigned short nameid);
+ bool (*searchall) (struct map_session_data* sd, const struct s_search_store_search* s);
+} vending_s;
+
+struct vending_interface * vending;
+
+void vending_defaults(void);
#endif /* _VENDING_H_ */
diff --git a/vcproj-10/map-server.vcxproj b/vcproj-10/map-server.vcxproj
index 4f51870e8..3810095fe 100644
--- a/vcproj-10/map-server.vcxproj
+++ b/vcproj-10/map-server.vcxproj
@@ -171,6 +171,7 @@
<ClInclude Include="..\src\map\elemental.h" />
<ClInclude Include="..\src\map\guild.h" />
<ClInclude Include="..\src\map\intif.h" />
+ <ClInclude Include="..\src\map\irc-bot.h" />
<ClInclude Include="..\src\map\itemdb.h" />
<ClInclude Include="..\src\map\log.h" />
<ClInclude Include="..\src\map\mail.h" />
@@ -182,6 +183,7 @@
<ClInclude Include="..\src\map\mob.h" />
<ClInclude Include="..\src\map\npc.h" />
<ClInclude Include="..\src\map\packets.h" />
+ <ClInclude Include="..\src\map\packets_struct.h" />
<ClInclude Include="..\src\map\party.h" />
<ClInclude Include="..\src\map\path.h" />
<ClInclude Include="..\src\map\pc.h" />
@@ -243,6 +245,7 @@
<ClCompile Include="..\src\map\elemental.c" />
<ClCompile Include="..\src\map\guild.c" />
<ClCompile Include="..\src\map\intif.c" />
+ <ClCompile Include="..\src\map\irc-bot.c" />
<ClCompile Include="..\src\map\itemdb.c" />
<ClCompile Include="..\src\map\log.c" />
<ClCompile Include="..\src\map\mail.c" />
diff --git a/vcproj-10/map-server.vcxproj.filters b/vcproj-10/map-server.vcxproj.filters
index 82bbcbc09..325a62f67 100644
--- a/vcproj-10/map-server.vcxproj.filters
+++ b/vcproj-10/map-server.vcxproj.filters
@@ -43,6 +43,9 @@
<ClCompile Include="..\src\map\intif.c">
<Filter>map_sql</Filter>
</ClCompile>
+ <ClCompile Include="..\src\map\irc-bot.c">
+ <Filter>map_sql</Filter>
+ </ClCompile>
<ClCompile Include="..\src\map\itemdb.c">
<Filter>map_sql</Filter>
</ClCompile>
@@ -240,6 +243,9 @@
<ClInclude Include="..\src\map\intif.h">
<Filter>map_sql</Filter>
</ClInclude>
+ <ClInclude Include="..\src\map\irc-bot.h">
+ <Filter>map_sql</Filter>
+ </ClInclude>
<ClInclude Include="..\src\map\itemdb.h">
<Filter>map_sql</Filter>
</ClInclude>
@@ -267,6 +273,9 @@
<ClInclude Include="..\src\map\packets.h">
<Filter>map_sql</Filter>
</ClInclude>
+ <ClInclude Include="..\src\map\packets_struct.h">
+ <Filter>map_sql</Filter>
+ </ClInclude>
<ClInclude Include="..\src\map\party.h">
<Filter>map_sql</Filter>
</ClInclude>
diff --git a/vcproj-12/map-server.vcxproj b/vcproj-12/map-server.vcxproj
index 4acdf7d87..ba61a956f 100644
--- a/vcproj-12/map-server.vcxproj
+++ b/vcproj-12/map-server.vcxproj
@@ -175,6 +175,7 @@
<ClInclude Include="..\src\map\elemental.h" />
<ClInclude Include="..\src\map\guild.h" />
<ClInclude Include="..\src\map\intif.h" />
+ <ClInclude Include="..\src\map\irc-bot.h" />
<ClInclude Include="..\src\map\itemdb.h" />
<ClInclude Include="..\src\map\log.h" />
<ClInclude Include="..\src\map\mail.h" />
@@ -186,6 +187,7 @@
<ClInclude Include="..\src\map\mob.h" />
<ClInclude Include="..\src\map\npc.h" />
<ClInclude Include="..\src\map\packets.h" />
+ <ClInclude Include="..\src\map\packets_struct.h" />
<ClInclude Include="..\src\map\party.h" />
<ClInclude Include="..\src\map\path.h" />
<ClInclude Include="..\src\map\pc.h" />
@@ -247,6 +249,7 @@
<ClCompile Include="..\src\map\elemental.c" />
<ClCompile Include="..\src\map\guild.c" />
<ClCompile Include="..\src\map\intif.c" />
+ <ClCompile Include="..\src\map\irc-bot.c" />
<ClCompile Include="..\src\map\itemdb.c" />
<ClCompile Include="..\src\map\log.c" />
<ClCompile Include="..\src\map\mail.c" />
diff --git a/vcproj-12/map-server.vcxproj.filters b/vcproj-12/map-server.vcxproj.filters
index 82bbcbc09..325a62f67 100644
--- a/vcproj-12/map-server.vcxproj.filters
+++ b/vcproj-12/map-server.vcxproj.filters
@@ -43,6 +43,9 @@
<ClCompile Include="..\src\map\intif.c">
<Filter>map_sql</Filter>
</ClCompile>
+ <ClCompile Include="..\src\map\irc-bot.c">
+ <Filter>map_sql</Filter>
+ </ClCompile>
<ClCompile Include="..\src\map\itemdb.c">
<Filter>map_sql</Filter>
</ClCompile>
@@ -240,6 +243,9 @@
<ClInclude Include="..\src\map\intif.h">
<Filter>map_sql</Filter>
</ClInclude>
+ <ClInclude Include="..\src\map\irc-bot.h">
+ <Filter>map_sql</Filter>
+ </ClInclude>
<ClInclude Include="..\src\map\itemdb.h">
<Filter>map_sql</Filter>
</ClInclude>
@@ -267,6 +273,9 @@
<ClInclude Include="..\src\map\packets.h">
<Filter>map_sql</Filter>
</ClInclude>
+ <ClInclude Include="..\src\map\packets_struct.h">
+ <Filter>map_sql</Filter>
+ </ClInclude>
<ClInclude Include="..\src\map\party.h">
<Filter>map_sql</Filter>
</ClInclude>
diff --git a/vcproj-9/map-server.vcproj b/vcproj-9/map-server.vcproj
index 234908427..2b95e6b7f 100644
--- a/vcproj-9/map-server.vcproj
+++ b/vcproj-9/map-server.vcproj
@@ -588,6 +588,14 @@
>
</File>
<File
+ RelativePath="..\src\map\irc-bot.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\map\irc-bot.h"
+ >
+ </File>
+ <File
RelativePath="..\src\map\itemdb.c"
>
</File>
@@ -658,7 +666,11 @@
<File
RelativePath="..\src\map\packets.h"
>
- </File>
+ </File>
+ <File
+ RelativePath="..\src\map\packets_struct.h"
+ >
+ </File>
<File
RelativePath="..\src\map\party.c"
>