summaryrefslogtreecommitdiff
path: root/src/map/vending.c
diff options
context:
space:
mode:
authorglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-12 00:06:25 +0000
committerglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-12 00:06:25 +0000
commitae57ff81700dbe6714ef107b34510457e9c9c5b6 (patch)
treee624b5ac4214e5ac9e00aee596055ce19ff95be5 /src/map/vending.c
parent20e444cce123f97b5e2d60cfb4c134c08479fb41 (diff)
downloadhercules-ae57ff81700dbe6714ef107b34510457e9c9c5b6.tar.gz
hercules-ae57ff81700dbe6714ef107b34510457e9c9c5b6.tar.bz2
hercules-ae57ff81700dbe6714ef107b34510457e9c9c5b6.tar.xz
hercules-ae57ff81700dbe6714ef107b34510457e9c9c5b6.zip
-Add Homon-S skills, 1st implementation (all done except Eleanors)
--Upd Skill conf to set land-limit for homonculus by default (ground skill limit) --Mv MH_HEILIGE_STANGE and MH_ANGRIFFS_MODUS skill from Eleanor to Bayeri -Enforce all zeny transaction to use pc_payzeny and pc_getzeny handlers, (auto log and clif) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16914 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/vending.c')
-rw-r--r--src/map/vending.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/map/vending.c b/src/map/vending.c
index a61e6fc79..723cb014f 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -59,7 +59,7 @@ void vending_vendinglistreq(struct map_session_data* sd, int id)
{ // GM is not allowed to trade
clif_displaymessage(sd->fd, msg_txt(246));
return;
- }
+ }
sd->vended_id = vsd->vender_id; // register vending uid
@@ -139,11 +139,11 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
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 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 )
@@ -152,7 +152,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // not enough quantity
return;
}
-
+
vending[j].amount -= amount;
switch( pc_checkadditem(sd, vsd->status.cart[idx].nameid, amount) ) {
@@ -168,13 +168,10 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
}
}
- //Logs (V)ending Zeny [Lupus]
- log_zeny(vsd, LOG_TYPE_VENDING, sd, (int)z);
-
- pc_payzeny(sd, (int)z);
+ pc_payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd);
if( battle_config.vending_tax )
z -= z * (battle_config.vending_tax/10000.);
- pc_getzeny(vsd, (int)z);
+ pc_getzeny(vsd, (int)z, LOG_TYPE_VENDING, sd);
for( i = 0; i < count; i++ )
{
@@ -202,7 +199,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
{
if( vsd->vending[i].amount == 0 )
continue;
-
+
if( cursor != i ) // speedup
{
vsd->vending[cursor].index = vsd->vending[i].index;
@@ -236,18 +233,18 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
}
static int vending_checknearnpc_sub(struct block_list* bl, va_list args) {
struct npc_data *nd = (struct npc_data*)bl;
-
+
if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) )
return 0;
return 1;
}
bool vending_checknearnpc(struct block_list * bl) {
-
+
if( battle_config.min_npc_vending_distance > 0 &&
map_foreachinrange(vending_checknearnpc_sub,bl, battle_config.min_npc_vending_distance, BL_NPC) )
return true;
-
+
return false;
}
/*==========================================
@@ -287,8 +284,8 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool
clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
return;
}
-
-
+
+
// filter out invalid items
i = 0;
for( j = 0; j < count; j++ )