You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.
Então eu fiz uma função simples para usar como revive das pokeball
luascript.h
static int luaItemRevivePokemon(lua_State* L);
luascript.cpp
int LuaScriptInterface::luaItemRevivePokemon(lua_State* L) { // item:revivePokemon() Item* item = getUserdata<Item>(L, 1); if (item) { Pokemon* pokemon = g_game.getPokemonByGUID(item->getPokemonId()); if (pokemon) { pokemon->revivePokemon(); g_game.transformItem(item, pokemon->getChargedIcon()); } } return 1; }
e
registerMethod("Item", "revivePokemon", LuaScriptInterface::luaItemRevivePokemon);
No Pokemon.h
void revivePokemon();
no pokemon.cpp
void Pokemon::revivePokemon() { setHealth(getMaxHealth()); eventWalk = 0; }
no action
function onUse(player, item, fromPosition, target, toPosition, isHotkey) if (target:isItem()) then target:revivePokemon() end end
The text was updated successfully, but these errors were encountered: