summaryrefslogtreecommitdiff
path: root/src/echar/int_party.c
blob: 9c248887c6c8f125229c653958fee33b2d475249 (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
// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// Copyright (c) 2014 - 2015 Evol developers

#include "common/hercules.h"
#include "common/HPMi.h"
#include "common/nullpo.h"
#include "char/int_party.h"
#include "char/char.h"
#include "char/inter.h"
#include "char/mapif.h"
#include "common/mmo.h"
#include "common/sql.h"


#include "plugins/HPMHooking.h"

int einter_party_check_lv(struct party_data **p)
{
	hookStop();
	nullpo_ret(p);

	// Force EXP sharing to be active
	if ((*p)->party.exp == 0) {
		(*p)->party.exp = 1;
		mapif->party_optionchanged(0, &(*p)->party, 0, 0);
		inter_party->tosql(&(*p)->party, PS_BASIC, 0);
	}

	return 1;
}

//Party setting change request
// Overrides exp to always be true
bool einter_party_change_option_pre(int *party_id __attribute__ ((unused)),
                                    int *account_id __attribute__ ((unused)),
                                    int *exp,
                                    int *item __attribute__ ((unused)),
                                    int *map_fd __attribute__ ((unused)))
{
	(*exp) = 1;
	return true;
}