diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.cpp | 2 | ||||
-rw-r--r-- | src/map/intif.cpp | 2 | ||||
-rw-r--r-- | src/map/map.hpp | 2 | ||||
-rw-r--r-- | src/map/party.cpp | 14 | ||||
-rw-r--r-- | src/map/pc.cpp | 7 | ||||
-rw-r--r-- | src/map/script-fun.cpp | 56 |
6 files changed, 69 insertions, 14 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 346b0ac..feacd52 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -4415,7 +4415,7 @@ ATCE atcommand_email(Session *s, dumb_ptr<map_session_data> sd, else { chrif_changeemail(sd->status_key.account_id, actual_email, new_email); - clif_displaymessage(s, "Information sended to login-server via char-server."_s); + clif_displaymessage(s, "Information sent to login-server via char-server."_s); } return ATCE::OKAY; diff --git a/src/map/intif.cpp b/src/map/intif.cpp index f64f797..bdb73b6 100644 --- a/src/map/intif.cpp +++ b/src/map/intif.cpp @@ -364,7 +364,7 @@ void mapif_parse_WisToGM(Session *, const Packet_Head<0x3803>& head, AString& me // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B GmLevel min_gm_level = head.min_gm_level; CharName Wisp_name = head.char_name; - // information is sended to all online GM + // information is sent to all online GM for (io::FD i : iter_fds()) { Session *s2 = get_session(i); diff --git a/src/map/map.hpp b/src/map/map.hpp index 8bb5aa7..0a1bd06 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -275,7 +275,7 @@ struct map_session_data : block_list, SessionData int deal_zeny; short deal_locked; - int party_sended; + int party_sent; PartyId party_invite; AccountId party_invite_account; int party_hp, party_x, party_y; diff --git a/src/map/party.cpp b/src/map/party.cpp index ccbfd75..2210064 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -250,10 +250,10 @@ int party_recv_info(const PartyPair sp) { // 設定情報の送信 // dumb_ptr<map_session_data> sd = map_id2sd(p->member[i].account_id); dumb_ptr<map_session_data> sd = dumb_ptr<map_session_data>(p->member[i].sd); - if (sd != nullptr && sd->party_sended == 0) + if (sd != nullptr && sd->party_sent == 0) { clif_party_option(p, sd, 0x100); - sd->party_sended = 1; + sd->party_sent = 1; } } @@ -393,7 +393,7 @@ int party_member_added(PartyId party_id, AccountId account_id, int flag) } // 成功 - sd->party_sended = 0; + sd->party_sent = 0; sd->status.party_id = party_id; if (sd2 != nullptr) @@ -476,7 +476,7 @@ int party_member_leaved(PartyId party_id, AccountId account_id, CharName name) if (sd != nullptr && sd->status.party_id == party_id) { sd->status.party_id = PartyId(); - sd->party_sended = 0; + sd->party_sent = 0; } return 0; } @@ -495,7 +495,7 @@ int party_broken(PartyId party_id) p->member[i].account_id, p->member[i].name, 0x10); p->member[i].sd->status.party_id = PartyId(); - p->member[i].sd->party_sended = 0; + p->member[i].sd->party_sent = 0; } } party_db.erase(party_id); @@ -582,7 +582,7 @@ int party_send_movemap(dumb_ptr<map_session_data> sd) return 0; intif_party_changemap(sd, 1); - if (sd->party_sended != 0) // もうパーティデータは送信済み + if (sd->party_sent != 0) // もうパーティデータは送信済み return 0; // 競合確認 @@ -596,7 +596,7 @@ int party_send_movemap(dumb_ptr<map_session_data> sd) { clif_party_info(p, sd->sess); clif_party_option(p, sd, 0x100); - sd->party_sended = 1; + sd->party_sent = 1; } } diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 9ef70fe..54ea13d 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -871,6 +871,11 @@ int pc_authok(AccountId id, int login_id2, ClientVersion client_version, sd->quick_regeneration_sp.amount = 0; sd->heal_xp = 0; sd->max_weight_override = 0; + sd->activity.kills = 0; + sd->activity.casts = 0; + sd->activity.items_used = 0; + sd->activity.tiles_walked = 0; + sd->activity.attacks = 0; sd->canact_tick = tick; sd->canmove_tick = tick; sd->attackabletime = tick; @@ -899,7 +904,7 @@ int pc_authok(AccountId id, int login_id2, ClientVersion client_version, } // パーティー関係の初期化 | Initializing Party Relationships - sd->party_sended = 0; + sd->party_sent = 0; sd->party_invite = PartyId(); sd->party_x = -1; sd->party_y = -1; diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 27807b9..58bca90 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -1920,7 +1920,7 @@ void builtin_countitem(ScriptState *st) else { if (battle_config.error_log) - PRINTF("wrong item ID: countitem (%i)\n"_fmt, nameid); + PRINTF("builtin_countitem: no item ID\n"_fmt); } push_int<ScriptDataInt>(st->stack, count); @@ -2491,9 +2491,9 @@ void builtin_end(ScriptState *st) { dumb_ptr<npc_data> nd = map_id_is_npc(st->oid); if(nd) - PRINTF("Deprecated: close in a callfunc or callsub! @ %s\n"_fmt, nd->name); + PRINTF("Deprecated: end in a callfunc or callsub! @ %s\n"_fmt, nd->name); else - PRINTF("Deprecated: close in a callfunc or callsub! (no npc)\n"_fmt); + PRINTF("Deprecated: end in a callfunc or callsub! (no npc)\n"_fmt); } st->state = ScriptEndState::END; } @@ -5517,6 +5517,53 @@ void builtin_getmapnamefromhash(ScriptState *st) } /*========================================== + * Look if a map exists + * return value: + * 0 = map does not exist + * 1 = map exists + *------------------------------------------ + */ +static +void builtin_mapexists(ScriptState *st) +{ + MapName mapname = stringish<MapName>(ZString(conv_str(st, &AARG(0)))); + push_int<ScriptDataInt>(st->stack, map_mapname2mapid(mapname).is_some()); +} + +/*========================================== + * Returns number of available maps + *------------------------------------------ + */ +static +void builtin_numberofmaps(ScriptState *st) +{ + push_int<ScriptDataInt>(st->stack, maps_db.size()); +} + +/*========================================== + * Get the map name of a specific maps_db index + *------------------------------------------ + */ +static +void builtin_getmapnamebyindex(ScriptState *st) +{ + int index = conv_num(st, &AARG(0)); + int count = 0; + + for (auto& mit : maps_db) + { + if (count == index) + { + push_str<ScriptDataStr>(st->stack, mit.second->name_); + return; + } + ++count; + } + + push_str<ScriptDataStr>(st->stack, ""_s); +} + +/*========================================== * Get the NPC's info *------------------------------------------ */ @@ -5782,6 +5829,9 @@ BuiltinFunction builtin_functions[] = BUILTIN(getmapmaxy, "M"_s, 'i'), BUILTIN(getmaphash, "M"_s, 'i'), BUILTIN(getmapnamefromhash, "i"_s, 's'), + BUILTIN(mapexists, "M"_s, 'i'), + BUILTIN(numberofmaps, ""_s, 'i'), + BUILTIN(getmapnamebyindex, "i"_s, 's'), BUILTIN(mapexit, ""_s, '\0'), BUILTIN(freeloop, "i"_s, '\0'), BUILTIN(if_then_else, "iii"_s, 'v'), |