From 506a41d6926405b2753894f0b40130b4077828b3 Mon Sep 17 00:00:00 2001 From: wushin Date: Tue, 9 Jun 2015 01:06:22 -0500 Subject: Remove old Magic --- src/map/script-fun.cpp | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) (limited to 'src/map/script-fun.cpp') diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 35e119b..2d9ac23 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -47,7 +47,6 @@ #include "globals.hpp" #include "intif.hpp" #include "itemdb.hpp" -#include "magic-interpreter-base.hpp" #include "map.hpp" #include "mob.hpp" #include "npc.hpp" @@ -259,7 +258,6 @@ void builtin_menu(ScriptState *st) buf += choice_str; buf += ':'; } - clif_scriptmenu(script_rid2sd(st), st->oid, AString(buf)); } else @@ -2767,18 +2765,6 @@ void builtin_getitemlink(ScriptState *st) push_str(st->stack, buf); } -static -void builtin_getspellinvocation(ScriptState *st) -{ - RString name = conv_str(st, &AARG(0)); - - AString invocation = magic::magic_find_invocation(name); - if (!invocation) - invocation = "..."_s; - - push_str(st->stack, invocation); -} - static void builtin_getpartnerid2(ScriptState *st) { @@ -3328,18 +3314,6 @@ void builtin_npctalk(ScriptState *st) clif_message(nd, str); } -/*========================================== - * casttime - *------------------------------------------ - */ -static -void builtin_casttime(ScriptState *st) -{ - dumb_ptr sd = script_rid2sd(st); - interval_t tick = static_cast(conv_num(st, &AARG(0))); - sd->cast_tick = gettick() + tick; -} - /*========================================== * register cmd *------------------------------------------ @@ -3347,13 +3321,15 @@ void builtin_casttime(ScriptState *st) static void builtin_registercmd(ScriptState *st) { - dumb_ptr nd = map_id_is_npc(st->oid); RString evoke = conv_str(st, &AARG(0)); + NpcName npcname = stringish(conv_str(st, &AARG(1))); ZString event_ = conv_str(st, &AARG(1)); NpcEvent event; extract(event_, &event); - - spells_by_name.put(evoke, event); + if (event.label) + spells_by_events.put(evoke, event); + else + spells_by_name.put(evoke, npcname); } /*========================================== @@ -3826,7 +3802,6 @@ BuiltinFunction builtin_functions[] = BUILTIN(marriage, "P"_s, 'i'), BUILTIN(divorce, ""_s, 'i'), BUILTIN(getitemlink, "I"_s, 's'), - BUILTIN(getspellinvocation, "s"_s, 's'), BUILTIN(getpartnerid2, ""_s, 'i'), BUILTIN(explode, "Nss"_s, '\0'), BUILTIN(getinventorylist, ""_s, '\0'), @@ -3843,8 +3818,7 @@ BuiltinFunction builtin_functions[] = BUILTIN(npcareawarp, "xyxyis"_s, '\0'), BUILTIN(message, "Ps"_s, '\0'), BUILTIN(npctalk, "ss?"_s, '\0'), - BUILTIN(casttime, "i"_s, '\0'), - BUILTIN(registercmd, "sE"_s, '\0'), + BUILTIN(registercmd, "ss"_s, '\0'), BUILTIN(title, "s"_s, '\0'), BUILTIN(smsg, "e??"_s, '\0'), BUILTIN(remotecmd, "s?"_s, '\0'), -- cgit v1.2.3-70-g09d2