Descrição:
Nome : Monster Skull randomicas
Versão : 8.54
Bom abra as SOUCER e vai em: luascript.cpp e procure:
int32_t LuaScriptInterface::luaGetPlayersOnline(lua_State* L) { //getPlayersOnline() ScriptEnviroment* env = getEnv(); AutoList<Player>::iterator it = Player::autoList.begin(); lua_newtable(L); for(int32_t i = 1; it != Player::autoList.end(); ++it, ++i) { lua_pushnumber(L, i); lua_pushnumber(L, env->addThing(it->second)); pushTable(L); } return 1; }
Embaixo disso Adicione isso :
int32_t LuaScriptInterface::luaCheckSpawnMonster(lua_State* L) { ScriptEnviroment* env = getEnv(); AutoList<Monster>::iterator it = Monster::autoList.begin(); lua_newtable(L); for(int32_t i = 1; it != Monster::autoList.end(); ++it, ++i) { lua_pushnumber(L, i); lua_pushnumber(L, env->addThing(it->second)); pushTable(L); } return 1; }
Agora Procure essas linhas
//getPlayersOnline() lua_register(m_luaState, "getPlayersOnline", LuaScriptInterface::luaGetPlayersOnline);
E Adicione isso Abaixo delas
//checkSpawnMonster() lua_register(m_luaState, "checkSpawnMonster", LuaScriptInterface::luaCheckSpawnMonster);
AGORA EM LUASCRIPT.H PROCURE ESSA LINHA:
static int32_t luaGetPlayersOnline(lua_State* L);
E bote isso embaixo dela:
static int32_t luaCheckSpawnMonster(lua_State* L);
Acabou o Sistema, Agora a 2 jeitos de você usar esse script
1° Talkactions ( quando você falar o comando ele vai dar um skull randomica para cada monster, mais caso ele morra quando voltar vai vir sem skull )
Data/Talkactions/Scripts
function onSay(cid, words, param, channel) local m = checkSpawnMonster for _, mid in ipairs(m) do local mpos = getThingPos(mid) doCreatureSetSkullType(mid, math.random(1, 5)) end return 0 end
Agora crie uma tag e use o sistema.
2° jeito, Globalevents ( Agora a cada respow ele ja vem com skull, + demora cerca de 1 milezimo de segundo pra adicionar a skull.
Data/globalevents/scripts
function onThink(interval, lastExecution, thinkInterval) local m = checkSpawnMonster() local sex = {1, 2} -- numero da skull ou seja, desenho do sexo for _, mid in ipairs(m) do local mpos = getThingPos(mid) if (getCreatureSkullType(mid) == 1) or (getCreatureSkullType(mid) == 2) then else doCreatureSetSkullType(mid, math.random(1, #sex)) end end return 0 end
Data/Globalevents/Globalevents.xml
<globalevent name="sex" interval="0" event="script" value="sex.lua"/>
Bom galerinha esse script um amigo fez pra mim e se eu não tivese postado só eu teria, não sei se é o lugar certo mais se não for por favor mova o tópico.
Se for usar de ++rep
ESTE SCRIPT ESTA PROIBIDO DE SER POSTADO EM OUTROS FÓRUM !!!!!