Moj mistrz
Monster Creator
Does it work for TFS[1.2]?
If not (can't confirm myself, because I never compiled anything) then can someone update it?
If not (can't confirm myself, because I never compiled anything) then can someone update it?
Printer said some time ago that it is possible you just need to update the spectators list, however he did not go into much more detail than that.Does it work for TFS[1.2]?
If not (can't confirm myself, because I never compiled anything) then can someone update it?
I've got errors while compiling.. tried 3 times and everytime errors :/From what I remember, the client saves the creature name when the creature first appears.
This means, the only way to update the creature's name is to have it teleport off screen, and back on screen (Or maybe just teleport at all). Unless you want to edit the client source parse, and tfs protocol, so it can send updated names each time it updates the character.
const std::string& getName() const final {
const std::string& getName() const final {
return name;
}
const std::string& getNameDescription() const final {
return nameDescription;
}
std::string getDescription(int32_t) const final {
return nameDescription + '.';
}
static int luaSetItemOutfit(lua_State* L);
static int luaSetCreatureName(lua_State* L);
int LuaScriptInterface::luaSetCreatureOutfit(lua_State* L)
{
//doSetCreatureOutfit(cid, outfit, time)
Creature* creature = getCreature(L, 1);
if (!creature) {
reportErrorFunc(getErrorDesc(LUA_ERROR_CREATURE_NOT_FOUND));
pushBoolean(L, false);
return 1;
}
Outfit_t outfit = getOutfit(L, 2);
int32_t time = getNumber<int32_t>(L, 3);
pushBoolean(L, Spell::CreateIllusion(creature, outfit, time) == RETURNVALUE_NOERROR);
return 1;
}
int LuaScriptInterface::luaSetCreatureName(lua_State* L)
{
//setCreatureName(cid, newName, newDescription)
Creature* creature = getCreature(L, 1);
if (creature) {
Monster* monster = (Monster*)creature;
std::string newName = getString(L, 2);
std::string newDesc = getString(L, 3);
monster->name = newName;
monster->nameDescription = newDesc;
pushBoolean(L, false);
}
else {
reportErrorFunc(getErrorDesc(LUA_ERROR_CREATURE_NOT_FOUND));
pushBoolean(L, false);
}
return 1;
}
//doSetCreatureOutfit(cid, outfit, time)
lua_register(luaState, "doSetCreatureOutfit", LuaScriptInterface::luaSetCreatureOutfit);
//setCreatureName(cid, name, description)
lua_register(luaState, "setCreatureName", LuaScriptInterface::luaSetCreatureName);
could you help me please?Make sure you still add
Code:std::string name, nameDescription;
In the same spot.
could you help me please?
where should i put this?
thanks in advice!!
firstable thanks for your answer, going to take a look, bless!Look on the thread owners tutorial and look for where its placed. Put it in the same spot as he did.