summaryrefslogtreecommitdiff
path: root/src/emap/horse.c
blob: 90c736e31aa910350ed8dc1b2d2c5384e9ac9566 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// Copyright (c) 2014 - 2015 Evol developers

#include "common/hercules.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "common/HPMi.h"
#include "common/memmgr.h"
#include "common/mmo.h"
#include "common/socket.h"
#include "common/strlib.h"
#include "map/map.h"
#include "map/pc.h"

#include "emap/data/session.h"
#include "emap/struct/sessionext.h"

void horse_add_bonus(TBL_PC *sd)
{
    struct SessionExt *data = session_get_bysd(sd);
    if (!sd || !data || data->mount == 0)
        return;

    struct status_data *bstatus = &sd->base_status;

    bstatus->aspd_rate += 50 - 10 * pc->checkskill(sd, KN_CAVALIERMASTERY);

    if (pc->checkskill(sd, KN_RIDING) > 0)
        sd->max_weight += 10000;
}

unsigned short horse_add_speed_bonus(TBL_PC *sd, unsigned short val)
{
    if (sd)
    {
        struct SessionExt *data = session_get_bysd(sd);
        if (!data || data->mount == 0)
            return val;

        val -= 25;
    }
    return val;
}