#pragma once // ast/npc.hpp - Structure of non-player characters (including mobs). // // Copyright © 2014 Ben Longbons // // This file is part of The Mana World (Athena server) // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #include "fwd.hpp" #include #include "../compat/result.hpp" #include "../mmo/clif.t.hpp" #include "../mmo/ids.hpp" #include "../mmo/strs.hpp" #include "../net/timer.t.hpp" #include "script.hpp" namespace tmwa { namespace npc { namespace parse { using io::Spanned; struct TopLevel { io::LineSpan span; virtual ~TopLevel(); }; struct Comment : TopLevel { RString comment; }; struct Warp : TopLevel { Spanned m; Spanned x, y; io::LineSpan key_span; Spanned name; Spanned xs, ys; Spanned to_m; Spanned to_x, to_y; }; struct ShopItem { Spanned name; Spanned value; }; struct Shop : TopLevel { Spanned m; Spanned x, y; Spanned d; io::LineSpan key_span; Spanned name; Spanned npc_class; Spanned>> items; }; struct Monster : TopLevel { Spanned m; Spanned x, y; Spanned xs, ys; io::LineSpan key_span; Spanned name; Spanned mob_class; Spanned num; Spanned delay1, delay2; Spanned event; }; struct MapFlag : TopLevel { Spanned m; io::LineSpan key_span; // TODO should this extract all the way? Spanned name; Spanned opt_extra; }; struct Script : TopLevel { io::LineSpan key_span; // see src/script/parser.hpp script::parse::ScriptBody body; }; struct ScriptFunction : Script { io::LineSpan key1_span; Spanned name; }; struct ScriptNone : Script { io::LineSpan key1_span; Spanned name; io::LineSpan key4_span; }; struct ScriptMapNone : Script { Spanned m; Spanned x, y; Spanned d; Spanned name; io::LineSpan key4_span; }; struct ScriptMap : Script { Spanned m; Spanned x, y; Spanned d; Spanned name; Spanned npc_class; Spanned xs, ys; }; // other Script subclasses elsewhere? (for item and magic scripts) Result> parse_top(io::LineCharReader& in); } // namespace parse } // namespace npc } // namespace tmwa