diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-07-16 19:54:43 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-07-17 21:58:40 +0200 |
commit | fc8e16e33bc34bda74559d021f5c1855a789a2b2 (patch) | |
tree | 6d1ec98d2619b1026024698ab408a3a7d1d55b2c /src | |
parent | 55e227f90e86a960e111a286bd70d49578eb838b (diff) | |
download | manaserv-fc8e16e33bc34bda74559d021f5c1855a789a2b2.tar.gz manaserv-fc8e16e33bc34bda74559d021f5c1855a789a2b2.tar.bz2 manaserv-fc8e16e33bc34bda74559d021f5c1855a789a2b2.tar.xz manaserv-fc8e16e33bc34bda74559d021f5c1855a789a2b2.zip |
Added lua bind to send text effect particle to clients
Change is tested.
Reviewed-by: bjorn.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/manaserv_protocol.h | 1 | ||||
-rw-r--r-- | src/scripting/lua.cpp | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/common/manaserv_protocol.h b/src/common/manaserv_protocol.h index 9feedfd9..4bac0837 100644 --- a/src/common/manaserv_protocol.h +++ b/src/common/manaserv_protocol.h @@ -185,6 +185,7 @@ enum { GPMSG_BEINGS_DAMAGE = 0x0310, // { W being id, W amount }* GPMSG_CREATE_EFFECT_POS = 0x0320, // W effect id, W*2 position GPMSG_CREATE_EFFECT_BEING = 0x0321, // W effect id, W BeingID + GPMSG_CREATE_TEXT_PARTICLE = 0x0322, // S text GPMSG_SHAKE = 0x0330, // W intensityX, W intensityY, [W decay_times_10000, [W duration]] // Guild diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index a6b26e92..05845a36 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -1703,6 +1703,18 @@ static int chr_shake_screen(lua_State *s) return 0; } +static int chr_create_text_particle(lua_State *s) +{ + Character *c = checkCharacter(s, 1); + const char *text = luaL_checkstring(s, 2); + + MessageOut msg(GPMSG_CREATE_TEXT_PARTICLE); + msg.writeString(text); + c->getClient()->send(msg); + + return 0; +} + /** * chr_get_exp(Character*, int skill): int @@ -2478,6 +2490,7 @@ LuaScript::LuaScript(): { "being_register", &being_register }, { "effect_create", &effect_create }, { "chr_shake_screen", &chr_shake_screen }, + { "chr_create_text_particle", &chr_create_text_particle }, { "test_tableget", &test_tableget }, { "get_map_id", &get_map_id }, { "get_map_property", &get_map_property }, |