Nie tylko o Tibii i OTS...
Zbanowany
Hej.
Mam dla was inwazje czyli rzecz, na którą się naciśnie ,,USE" to będzie inwazja.
Wchodzimy do data/actions/actions.xml i wpisujemy linijke
<action itemid="4838" script="inwazja.lua" />
Później wejdźcie do data/actions/scripts i zróbice plik LUA o nazwie inwazja.lua i wpisujemy to
--Invasion script
-- By Tworn
--Variables that need to be set according to your map/desire:
--topleft=the top left cordinate of the invasion area
--bottonright= the botton right cordinate of the invasion area
--maxmonsters= the maximum number of monsters that will appear. Set it "nil" for no monster limit.
--spawnrate= the chance of a monster appearing in a square of the invasion area
--species= the odds that determine what kind of monster will be summoned
-- DO NOT CHANGE THE FOLLOWING VARIABLES: checking, summonedtotal, checkforsummon.
function onUse(cid, item, frompos, item2, topos)
if getPlayerAccess(cid) ~=0 then
topleft={x=130, y=41, z=7}
bottonright={x=172, y=69, z=7}
maxmonsters= 10
checking={x=topleft.x, y=topleft.y, z=topleft.z} --Do Not Change
summonedtotal=0 --Do Not Change
repeat
checkforsummon=0 --Do Not Change
spawnrate=math.random(0,10)
if spawnrate==0 and summonedtotal ~= maxmonsters then
species=math.random(1,10)
if species == 1 then
checkforsummon = doSummonCreature("draggy",checking)
elseif species == 2 then
checkforsummon = doSummonCreature("draggy",checking)
elseif species == 3 then
checkforsummon = doSummonCreature("terror draggy",checking)
elseif species == 4 then
checkforsummon = doSummonCreature("dragon lord",checking)
elseif species == 5 then
checkforsummon = doSummonCreature("terror draggy",checking)
elseif species == 6 then
checkforsummon = doSummonCreature("dragon",checking)
elseif species == 7 then
checkforsummon = doSummonCreature("demodras",checking)
else
checkforsummon = doSummonCreature("demordas",checking)
end
-- if species<5 and species >=0 then
-- checkforsummon=doSummonCreature("dragon",checking)
-- elseif species == 5 then
-- checkforsummon=doSummonCreature("dragon lord",checking)
-- end
if checkforsummon~= 0 then
summonedtotal=summonedtotal+1
end
end
checking.x=checking.x+1
if checking.x>bottonright.x then
checking.x=topleft.x
checking.y=checking.y+1
end
until checking.y > bottonright.y
--doPlayerSay(cid,"#b Dragons have been spotted near the city!",23)
print("Number of creatures summoned:",summonedtotal)
end
return 1
end
jak coś nie działa pisać do mnie xD
Albo jak nie działa to lepiej zrobić te potworki, które dałem ja i kogut
Narka
Offline
No całkiem ciekawe.
Tylko mógłbyś jeszcze wytłumaczyć np. gdzie wstawić ID przedmiotu (dla tych którzy niewiedzą), który mamy użyć i inne informacje.
Jak zrobisz drobne poprawki to będzie good .
Offline
Ja tam nie wiem czy to jest skopiowane czy nie, ale może akurat się komuś przyda
Offline
Zbanowany
ID przedmiotu się zmienia w pierwszym,,KOD'' xD to jest proste
Więc się zmienia tak:
<action itemid="4838" script="inwazja.lua" />
Tu gdzie jest "4838" trzeba zmieniać nie wiem kto by się nie skapował xD
Offline
Teraz good xD
Offline
Spox czekam na nowe skrypty bo jestem ciekawy co wymyslicie
Offline
To jest na tibie 7.6? A czy mógłbyś zrobić do Evolutions 0.7.6 pod tibie 7.92? Jeśli nie to trudno, ale gdybyś mógł to byłbym wdzięczny.
Offline
Zbanowany
Offline
Zbanowany
Offline
function onUse(cid, item, frompos, item2, topos)
if getPlayerAccess(cid) ~=0 then
topleft={x=130, y=41, z=7}
bottonright={x=172, y=69, z=7}
maxmonsters= 10
checking={x=topleft.x, y=topleft.y, z=topleft.z} --Do Not Change to ma byc tam gdzie maja atakowac czy co??
Offline
Zbanowany
fajne dorub wiencej potworkuw (ja se sam dorobilem)
ale newbi mogom nie wiedzieć jak
Offline