eduardbean
Member
- Joined
- Nov 26, 2010
- Messages
- 129
- Solutions
- 2
- Reaction score
- 15
Descrição:
Nome : Monster Skull randomicas
Versão : 8.54
Well the open Soucer and goes : luascript.cpp and search:
beneath it Add this :
Now Look for these lines
beneath it Add this :
NOW IN LUASCRIPT.H SEARCH THIS LINE:
E bote isso embaixo dela:
Eventually the system, Now you two ways to use this script
1° Talkactions (when you speak the command it will give a random skull for each monster, the more if he dies will come without skull)
Data/Talkactions/Scripts
Now create a tag and use the system.
2 way, Globalevents (now respawn every skull comes with it, + it takes about a thousandth of a second to add the skull.)
Data/globalevents/scripts
Data/Globalevents/Globalevents.xml
Good guys this script a friend made for me
If u use please ++rep
Nome : Monster Skull randomicas
Versão : 8.54
Well the open Soucer and goes : luascript.cpp and search:
Code:
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;
}
beneath it Add this :
Code:
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;
}
Now Look for these lines
Code:
//getPlayersOnline()
lua_register(m_luaState, "getPlayersOnline", LuaScriptInterface::luaGetPlayersOnline);
beneath it Add this :
Code:
//checkSpawnMonster()
lua_register(m_luaState, "checkSpawnMonster", LuaScriptInterface::luaCheckSpawnMonster);
NOW IN LUASCRIPT.H SEARCH THIS LINE:
Code:
static int32_t luaGetPlayersOnline(lua_State* L);
E bote isso embaixo dela:
Code:
static int32_t luaCheckSpawnMonster(lua_State* L);
Eventually the system, Now you two ways to use this script
1° Talkactions (when you speak the command it will give a random skull for each monster, the more if he dies will come without skull)
Data/Talkactions/Scripts
Code:
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
Now create a tag and use the system.
2 way, Globalevents (now respawn every skull comes with it, + it takes about a thousandth of a second to add the skull.)
Data/globalevents/scripts
Code:
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
Code:
<globalevent name="sex" interval="0" event="script" value="sex.lua"/>
Good guys this script a friend made for me
If u use please ++rep