- Added new settings for autotrade on battle/misc.conf (you can read descriptions there).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12243 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
7ff4f10106
commit
3868080ead
@ -3,6 +3,8 @@ Date Added
|
||||
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||
|
||||
2008/02/26
|
||||
* Added new settings for Autotrade. [Zephyrus]
|
||||
2008/02/23
|
||||
* Now the server will print an error message if an invalid mapflag is
|
||||
found during script loading (see bugreport:980 for the motivation)
|
||||
|
@ -107,3 +107,11 @@ duel_only_on_same_map: no
|
||||
// NOTE: For this setting to make effect you have to use a server compiled with
|
||||
// Cell Stack Limit support (see src/map/map.h)
|
||||
cell_stack_limit: 1
|
||||
|
||||
// Allow autrade only in map with autotrade flag?
|
||||
// Set this to "no" will allow autotrade where no "autotrade" mapflag is set
|
||||
// Set this to "yes" to only allow autotrade on maps with "autotrade" mapflag
|
||||
at_mapflag: no
|
||||
|
||||
// Set this to the amount of minutes autotrade chars will be kicked from the server.
|
||||
at_timeout: 0
|
||||
|
@ -5881,17 +5881,24 @@ int atcommand_autotrade(const int fd, struct map_session_data* sd, const char* c
|
||||
nullpo_retr(-1, sd);
|
||||
if( sd->vender_id ) //check if player's vending
|
||||
{
|
||||
sd->state.autotrade = 1;
|
||||
clif_authfail_fd(fd, 15);
|
||||
}
|
||||
else
|
||||
if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag )
|
||||
{
|
||||
//"You should be vending to use @Autotrade."
|
||||
clif_displaymessage(fd, msg_txt(549));
|
||||
}
|
||||
return 0;
|
||||
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);
|
||||
}
|
||||
|
||||
clif_authfail_fd(fd, 15);
|
||||
} else
|
||||
clif_displaymessage(fd, "Autotrade is not allowed on this map.");
|
||||
}
|
||||
else
|
||||
clif_displaymessage(fd, msg_txt(549)); // You should be vending to use @Autotrade.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* @changegm by durf (changed by Lupus)
|
||||
|
@ -3652,6 +3652,8 @@ static const struct _battle_data {
|
||||
{ "sg_miracle_skill_duration", &battle_config.sg_miracle_skill_duration, 3600000, 0, INT_MAX, },
|
||||
{ "hvan_explosion_intimate", &battle_config.hvan_explosion_intimate, 45000, 0, 100000, },
|
||||
{ "quest_exp_rate", &battle_config.quest_exp_rate, 100, 0, INT_MAX, },
|
||||
{ "at_mapflag", &battle_config.autotrade_mapflag, 0, 0, 1, },
|
||||
{ "at_timeout", &battle_config.at_timeout, 0, 0, INT_MAX, },
|
||||
{ "homunculus_autoloot", &battle_config.homunculus_autoloot, 0, 0, 1, },
|
||||
{ "idle_no_autoloot", &battle_config.idle_no_autoloot, 0, 0, INT_MAX, },
|
||||
{ "max_guild_alliance", &battle_config.max_guild_alliance, 3, 1, 3, },
|
||||
|
@ -438,6 +438,8 @@ extern struct Battle_Config
|
||||
int homunculus_show_growth ; //[orn]
|
||||
int homunculus_friendly_rate;
|
||||
int quest_exp_rate;
|
||||
int autotrade_mapflag;
|
||||
int at_timeout;
|
||||
int homunculus_autoloot;
|
||||
int idle_no_autoloot;
|
||||
int max_guild_alliance;
|
||||
|
@ -1564,6 +1564,8 @@ int map_quit(struct map_session_data *sd)
|
||||
//(changing map-servers invokes unit_free but bypasses map_quit)
|
||||
if(sd->sc.count) {
|
||||
//Status that are not saved...
|
||||
if(sd->sc.data[SC_AUTOTRADE])
|
||||
status_change_end(&sd->bl,SC_AUTOTRADE,-1);
|
||||
if(sd->sc.data[SC_SPURT])
|
||||
status_change_end(&sd->bl,SC_SPURT,-1);
|
||||
if(sd->sc.data[SC_BERSERK])
|
||||
|
@ -1168,6 +1168,7 @@ struct map_data {
|
||||
int npc_num;
|
||||
int users;
|
||||
struct map_flag {
|
||||
unsigned autotrade : 1;
|
||||
unsigned allowks : 1; // [Kill Steal Protection]
|
||||
unsigned nomemo : 1;
|
||||
unsigned noteleport : 1;
|
||||
|
@ -2318,6 +2318,8 @@ static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, con
|
||||
}
|
||||
map[m].flag.nosave = state;
|
||||
}
|
||||
else if (!strcmpi(w3,"autotrade"))
|
||||
map[m].flag.autotrade=state;
|
||||
else if (!strcmpi(w3,"allowks"))
|
||||
map[m].flag.allowks=state; // [Kill Steal Protection]
|
||||
else if (!strcmpi(w3,"nomemo"))
|
||||
|
@ -4206,7 +4206,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
|
||||
case SC_INCHITRATE: case SC_INCATKRATE: case SC_NEN:
|
||||
case SC_READYSTORM: case SC_READYDOWN: case SC_READYTURN:
|
||||
case SC_READYCOUNTER:case SC_DODGE: case SC_WARM:
|
||||
case SC_SPEEDUP1:
|
||||
case SC_SPEEDUP1: case SC_AUTOTRADE:
|
||||
continue;
|
||||
}
|
||||
if(i==SC_BERSERK) tsc->data[i]->val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "script.h"
|
||||
#include "unit.h"
|
||||
#include "mercenary.h"
|
||||
#include "vending.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
@ -6489,6 +6490,15 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
|
||||
status_set_hp(bl, 10, 0);
|
||||
status_set_sp(bl, 10, 0);
|
||||
break;
|
||||
case SC_AUTOTRADE:
|
||||
if (tid == -1)
|
||||
break;
|
||||
vending_closevending(sd);
|
||||
map_quit(sd);
|
||||
// Because map_quit calls status_change_end with tid -1
|
||||
// from here it's not neccesary to continue
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
opt_flag = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user