Skrypty & Kody Mod metin stone vent , protection zone problem

bejo669

Active User
Zarejestrowany
Dołączył
Maj 3, 2009
Posty
114
Liczba reakcji
1
Witam
Szukam skryptu na Metinstone event - mojego co? nie mo?e za?adowa? , drugim moim problem jest to , ?e gracz maj?cy PK mo?e si? wylogowa? .
Kolejn? rzecz? kt?rej szukam jest skrypt na to ?e po zabiciu BOSSA pojawia si? skrzynka po kt?rej klikni?ciu gracz dostanie 5lvli i np. cc .
[/ <config name="Stones_config">
<![CDATA[
stonesConfig = {
maxTopPlayers = 6,
maxDistance = 6,
maxStones = 2,
eventstorage = 20000,
pos_od = {x=1036,y=990,z=7}, --lewy gorny rog
pos_do = {x=1036,y=993,z=7}, --prawy dolny rog
time = 360, --pierwsze i kazde nastepne losowanie od momentu startu serwera, w minutach
chance = 50 --szansa na wylosowanie kamulca
}

stones_positions = {
{x=1038, y=991, z=7},
{x=1037, y=992, z=7},
{x=1037, y=993, z=7},
{x=1038, y=991, z=7},
{x=1038, y=992, z=7},
}

metin_stones = {
['Wind Stone'] = {
experience = 25000000,
rewardID = {2346, 8306, 8300, 9941, 7720,}, -- reward id which player can win (reward is random)
resp = true, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20001,
secondStorage = 20002,
appearEffect = CONST_ME_INSECTS,
},
['Fire Stone'] = {
experience = 25000000,
rewardID = {2346, 8306, 8300, 9941, 7720}, -- reward id which player can win (reward is random)
resp = true, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20003,
secondStorage = 20004,
appearEffect = CONST_ME_FIREAREA,
},
['Icy Stone'] = {
experience = 25000000,
rewardID = {2346, 8306, 8300, 9941, 7720}, -- reward id which player can win (reward is random)
resp = true, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20005,
secondStorage = 20006,
appearEffect = CONST_ME_ICETORNADO,
},
['Earth Stone'] = {
experience = 25000000,
rewardID = {2346, 8306, 8300, 9941, 7720}, -- reward id which player can win (reward is random)
resp = true, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20007,
secondStorage = 20008,
appearEffect = CONST_ME_GROUNDSHAKER,
},
['Metin of Darkness'] = {
experience = 45000000,
rewardID = {2346, 8306, 8300, 8300, 8300, 8300, 9941, 7720, 7958, 11366, 7450, 2508, 2352, 7416, 8858, 2538, 2437}, -- reward id which player can win (reward is random)
resp = false, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20009,
secondStorage = 20010,
appearEffect = CONST_ME_GROUNDSHAKER,
},
}
stones_days = {
['Tuesday'] = {'17:59:20'},
['Thursday'] = {'17:59:20'},
['Friday'] = {'17:59:20'},
['Sunday'] = {'17:59:20'},
}
]]>
</config>QUOTE]
 
Odp: Mod metin stone vent , protection zone problem

3.
[LUA]
-- autor Chakoo GG 53218128
local monstery = { -- nazwa, miejsce gdzie ma sie pojawic skrzynia
["Name"] = { x=x, y=y, z=z }
}

local czas = 360 -- 5 minut
local itemid = id skrzyni
local item = doCreateItem(itemid, 1, pozycja[1])
function onKill(cid, target, lastHit)
for name, pozycja in pairs(monstery) do
if (name == getCreatureName(target):lower()) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Zabiles "..name.." odbierz nagrode ze skrzyni. Po ".. czas .." sekundach skrzynia zniknie.")
doItemSetAttribute(item,"uid",12345)
addEvent(doRemoveItem, czas * 1000, getTileItemById(pos[2], 1387).uid, 1)
end
end
return true
end
[/LUA]
To by?o dreaturescripts..
 
Odp: Mod metin stone vent , protection zone problem

dzi?ki ! :) a powiedzia? by? mi mo?e jeszcze jak zrobi? ?eby po klikni?ciu w ni? gracz dosta? 5 lvli ??
 
Odp: Mod metin stone vent , protection zone problem

[LUA]function onUse (cid,item,frompos,item2,topos)

local needlvl = 1
local efekt = 1

if getPlayerLevel(cid) >= needlvl then

doPlayerSendTextMessage(cid,22,"Otrzymales 5 lvl") -- Info po otworzeniu chesta
doPlayerAddLevel(cid,level)
doSendMagicEffect(pos, efekt)
else
doPlayerSendCancel(cid,'Musisz miec "..needlvl..".')
end
return 1
end[/LUA]
 
Ostatnia edycja:
Odp: Mod metin stone vent , protection zone problem

Tak jak zrobi? to [USER]qwasniak[/USER] to ta skrzynia b?dzie dawa? level za ka?dym klikni?ciem.

Zr?b tak jak jest tutaj: https://tibia.net.pl/threads/587909-Poszukiwany-skrypcik
Doda poziom i itemy dla ka?dego kto bi? Bossa
G??wny skrypt ma wygl?da? tak:
[LUA]
local config = {item = , count = } -- wstaw id itemu i ilo??
local lvl = -- ilo?? poziom?w kt?re ma doda?
function onDeath(creature, corpse, deathList)
for i = 1, #deathList do
if isPlayer(creature) == false then
doPlayerAddItem(deathList,config.item,config.count)
doPlayerAddItem(deathList,lvl)
end
end
return true
end

[/LUA]


Co do ston?w, ten skrypt powinien ci dzia?a? o ile wszystko dobrze ustawisz:

[XML] <?xml version='1.0' encoding='UTF-8'?>
<mod name='Stones_Event' version='2.0' enabled='yes'>
<config name="Stones_config">
<![CDATA[
stonesConfig = {
stones = {
['Wind Stone'] = {
experience = 25000000,
rewardID = {2346, 8306, 8300, 9941, 7720}, -- reward id which player can win (reward is random)
resp = true, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20001,
secondStorage = 20002,
appearEffect = CONST_ME_INSECTS
},
['Fire Stone'] = {
experience = 25000000,
rewardID = {2346, 8306, 8300, 9941, 7720}, -- reward id which player can win (reward is random)
resp = true, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20003,
secondStorage = 20004,
appearEffect = CONST_ME_FIREAREA
},
['Icy Stone'] = {
experience = 25000000,
rewardID = {2346, 8306, 8300, 9941, 7720}, -- reward id which player can win (reward is random)
resp = true, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20005,
secondStorage = 20006,
appearEffect = CONST_ME_ICETORNADO
},
['Earth Stone'] = {
experience = 25000000,
rewardID = {2346, 8306, 8300, 9941, 7720}, -- reward id which player can win (reward is random)
resp = true, -- czy ma go tworzyc automatycznie (globaleventem nizej)
storage = 20007,
secondStorage = 20008,
appearEffect = CONST_ME_GROUNDSHAKER
}
},

positions = {
{x=974, y=1082, z=7},
{x=1032, y=1054, z=7},
{x=1089, y=1068, z=7},
{x=1058, y=1107, z=7},
{x=1080, y=992, z=7}
},

maxTopPlayers = 6,
maxDistance = 6,
maxStones = 2,
storage = 7858
}

summons = {
['Wind Stone'] = {
{90, {'Behemoth', 'Behemoth', 'Behemoth', 'Behemoth', 'Ghastly Dragon', 'Behemoth', 'Behemoth', 'Undead Dragon', 'Undead Dragon'}},
{70, {'Ghastly Dragon', 'Ghastly Dragon', 'Ghastly Dragon', 'Nosferatu', 'vile centurion', 'vile centurion'}},
{50, {'hand of darkness', 'hand of darkness', 'hand of darkness', 'Ise', 'Ghastly Dragon', 'Ghastly Dragon', 'Undead Dragon', 'Undead Dragon'}},
{40, {'Ghazbaran', 'Ghazbaran', 'Eye of Terror', 'hand of darkness', 'hand of darkness', 'hand of darkness', 'hand of darkness'}},
{20, {'apocalypse', 'apocalypse', 'hand of darkness', 'hand of darkness', 'vile centurion', 'vile centurion', 'Undead Dragon'}},
{5, {'apocalypse', 'Ghazbaran', 'Eye of Terror', 'Nosferatu', 'hand of darkness', 'hand of darkness', 'vile centurion'}},
{0, {}}
},
['Fire Stone'] = {
{90, {'dragon lord', 'dragon lord', 'dragon lord', 'dragon lord', 'demon', 'demon', 'diabolic imp', 'diabolic imp'}},
{70, {'dragon lord', 'dragon lord', 'demon', 'demon', 'demon', 'diabolic imp', 'diabolic imp', 'diabolic imp', 'diabolic imp'}},
{50, {'demon', 'demon', 'orshabaal', 'demon', 'diabolic imp', 'diabolic imp', 'diabolic imp', 'diabolic imp'}},
{40, {'Phyrus the ancient', 'Phyrus the ancient', 'Phyrus the ancient', 'Phyrus the ancient', 'hellfire fighter', 'hellfire fighter'}},
{20, {'orshabaal', 'orshabaal', 'hellfire fighter', 'hellfire fighter', 'Phyrus the ancient', 'Phyrus the ancient', 'diabolic imp', 'diabolic imp'}},
{5, {'infernatill', 'infernatill', 'diabolic imp', 'diabolic imp', 'demon', 'demon', 'demon', 'diabolic imp', 'diabolic imp'}},
{0, {}}
},
['Icy Stone'] = {
{90, {'frost dragon', 'frost dragon', 'frost dragon', 'frost dragon', 'frost dragon', 'frost dragon', 'frost dragon', 'frost dragon'}},
{70, {'frost dragon', 'yeti', 'frost dragon', 'yeti', 'frost dragon', 'yeti'}},
{50, {'azerus', 'azerus'}},
{30, {'azerus', 'azerus'}},
{10, {'azerus', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti'}},
{6, {'azerus', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti'}},
{5, {'azerus', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'yeti', 'azerus'}},
{0, {}}
},
['Earth Stone'] = {
{90, {'hydra', 'hydra', 'hydra', 'bog raider', 'bog raider', 'bog raider', 'bog raider', 'bog raider', 'Plaguesmith', 'Plaguesmith', 'Plaguesmith'}},
{70, {'defiler', 'hellhound', 'defiler', 'defiler', 'hellhound', 'medusa', 'medusa', 'medusa', 'medusa', 'Plaguesmith', 'Plaguesmith'}},
{50, {'azerus', 'hellhound', 'hellhound', 'hellhound', 'defiler', 'Plaguesmith', 'Plaguesmith', 'Plaguesmith', 'Phantasm', 'Phantasm'}},
{40, {'azerus', 'Massacre', 'Massacre', 'Massacre'}},
{20, {'juggernaut', 'juggernaut', 'juggernaut', 'defiler', 'defiler', 'hellhound', 'azerus', 'azerus'}},
{5, {'azerus', 'azerus', 'juggernaut', 'juggernaut', 'hellhound', 'hellhound', 'hellhound', 'hellhound', 'juggernaut', 'Plaguesmith', 'Plaguesmith', 'Plaguesmith', 'Phantasm', 'Phantasm'}},
{0, {}}

}
}

u = 0
]]>
</config>

<lib name="Stones_lib">
<![CDATA[
function getSummonsToSummon(pctHealth, x, storage, cid)
local summon = {}

for i = 2, #x do
if pctHealth >= x[1] and pctHealth < x[i - 1][1] then
if getCreatureStorage(cid, storage) ~= i - 1 then
local l, v = i - 1, 0
for j = getCreatureStorage(cid, storage), l do
for _, name in pairs(x[j][2]) do
table.insert(summon, name)
end
v = v + 1
end
doCreatureSetStorage(cid, storage, getCreatureStorage(cid, storage) + v)
return summon
else
for _, name in pairs(x[i - 1][2]) do
table.insert(summon, name)
end
doCreatureSetStorage(cid, storage, getCreatureStorage(cid, storage) + 1)
return summon
end
end
end
return summon
end

function doSendMagicEffectInArea(pos, effect, area) -- Function by mock
local centro = {}
centro.y = math.floor(#area / 2) + 1
for y = 1, #area do
for x = 1, #area[y] do
if area[y][x] > 0 then
centro.x = math.floor(#area[y] / 2) + 1
doSendMagicEffect({x=pos.x+x-centro.x, y=pos.y+y-centro.y, z=pos.z}, (effect or 0))
end
end
end
return true
end

function addDamageToArea(pos, area) -- Function by mock
local centro = {}
centro.y = math.floor(#area / 2) + 1
for y = 1, #area do
for x = 1, #area[y] do
if area[y][x] > 0 then
centro.x = math.floor(#area[y] / 2) + 1
local t = getThingfromPos({x=pos.x+x-centro.x, y=pos.y+y-centro.y, z=pos.z, stackpos=253}).uid
if isPlayer(t) then
doCreatureAddHealth(t, - (getCreatureMaxHealth(t) * 1 / 100))
doCreatureAddMana(t, - (getCreatureMaxMana(t) * 1 / 100))
end
doSendMagicEffect({x=pos.x+x-centro.x, y=pos.y+y-centro.y, z=pos.z}, 34)
end
end
end
return true
end

function doCleanArea(pos, area) -- Function by mock
local centro = {}
centro.y = math.floor(#area / 2) + 1
for y = 1, #area do
for x = 1, #area[y] do
if area[y][x] > 0 then
centro.x = math.floor(#area[y] / 2) + 1
local i = getTileItemByType({x=pos.x+x-centro.x, y=pos.y+y-centro.y, z=pos.z}, ITEM_TYPE_MAGICFIELD)
if i.uid > 0 then
doRemoveItem(i.uid)
end
end
end
end
return true
end
]]>
</lib>

<globalevent name="Summon_Stones" interval="10800000" event="script">
<![CDATA[
domodlib("Stones_config")
domodlib("Stones_lib")

local area = {
{1, 1, 1},
{1, 1, 1},
{1, 1, 1}
}

function onThink(interval, lastExecution)
local names, stonesSum = {}, {}

for k, v in pairs(stonesConfig.stones) do
if getStorage(v.storage) <= 0 then
if v.resp then
table.insert(names, k)
end
end
end

if #names == 0 then
return false
end

local pos, name = stonesConfig.positions[math.random(#stonesConfig.positions)], names[math.random(#names)]

if getStorage(stonesConfig.storage) < 0 then
doSetStorage(stonesConfig.storage, 0)
end

if getStorage(stonesConfig.storage) + 1 > stonesConfig.maxStones then
for o, p in pairs(stonesConfig.stones) do
if getStorage(p.storage) == 1 then
table.insert(stonesSum, o)
end
end

if #stonesSum == 0 then
if u ~= 1 then
doSetStorage(stonesConfig.storage, 0)
u = 1
end
else
local rand = math.random(#stonesSum)
local mon = getCreatureByName(stonesSum[rand])
if isCreature(mon) then
doSendMagicEffect(getThingPos(mon), 10)
doSetStorage(stonesConfig.stones[stonesSum[rand]].storage, 0)
doSetStorage(stonesConfig.stones[stonesSum[rand]].secondStorage, 1)
doSetStorage(stonesConfig.storage, getStorage(stonesConfig.storage) - 1)

doRemoveCreature(mon)
table.remove(stonesSum, rand)
end
end
end

local monsters = doCreateMonster(name, pos, true, true, false)
if type(monsters) == "number" then
doSendMagicEffectInArea(getThingPos(monsters), stonesConfig.stones[name].appearEffect, area)

doBroadcastMessage(name..' have been spawn. Find and defeat it.', MESSAGE_STATUS_WARNING)
doCreatureSetStorage(monsters, stonesConfig.stones[name].secondStorage, 1)

doSetStorage(stonesConfig.stones[name].storage, 1)
doSetStorage(stonesConfig.storage, getStorage(stonesConfig.storage) + 1)
end

return true
end
]]>
</globalevent>

<event type="statschange" name="StonesStatsChange_Event" event="script">
<![CDATA[
function onStatsChange(cid, attacker, type, combat, value)
local stor = 546849
if #getCreatureSummons(cid) > 0 and value > 0 and type == 1 then
if isPlayer(attacker) then
if exhaustion.check(attacker, stor) ~= true then
doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_BLUE, 'You have to kill stone\'s summons until you will be able to kill it.')
exhaustion.set(attacker, stor, 5)
end
end
return false
end
return true
end
]]>
</event>

<event type="think" name="StonesThink_Event" event="script">
<![CDATA[
domodlib("Stones_config")
domodlib("Stones_lib")

local area = {
{1, 0, 0, 1, 0, 0, 1},
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
{1, 0, 0, 1, 0, 0, 1}
}

local cleanArea = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
}

function onThink(cid, interval)
local xTable, pct = summons[getCreatureName(cid)], getCreatureHealth(cid) / getCreatureMaxHealth(cid) * 100

if not xTable then
return false
end

if getCreatureStorage(cid, stonesConfig.stones[getCreatureName(cid)].secondStorage) <= 0 then
doCreatureSetStorage(cid, stonesConfig.stones[getCreatureName(cid)].secondStorage, 1)
end

table.sort(xTable, function(a, b) return a[1] > b[1] end)

local summonsToSumm = getSummonsToSummon(pct, xTable, stonesConfig.stones[getCreatureName(cid)].secondStorage, cid)

if #summonsToSumm ~= 0 then
doCleanArea(getThingPos(cid), cleanArea)
addDamageToArea(getThingPos(cid), area)

local number, k = #getCreatureSummons(cid), 0
for _, mName in pairs(summonsToSumm) do
doSummonMonster(cid, mName)
end

for _, j in ipairs(getCreatureSummons(cid)) do
k = k + 1
if number <= k then
doSendMagicEffect(getThingPos(j), 34)
end
end

doCreatureSay(cid, 'I will be alive until my soldiers won\'t be killed!', TALKTYPE_MONSTER_YELL)
end

for _, y in ipairs(getCreatureSummons(cid)) do
if isCreature(y) then
if getDistanceBetween(getThingPos(cid), getThingPos(y)) > stonesConfig.maxDistance then
doTeleportThing(y, getThingPos(cid))
end
end
end
return true
end
]]>
</event>

<event type="death" name="StonesDeath_Event" event="script">
<![CDATA[
domodlib("Stones_config")
domodlib("Stones_lib")

function onDeath(cid, corpse, deathList)
doCreatureSay(cid, 'I WILL BACK THERE!', TALKTYPE_MONSTER)
local i, v = 1, stonesConfig.stones[getCreatureName(cid)]

doCreatureSetStorage(cid, v.secondStorage, 1)
doSetStorage(v.storage, -1)
doSetStorage(stonesConfig.storage, getStorage(stonesConfig.storage) - 1)

for _, pid in ipairs(deathList) do
if isPlayer(pid) then
local item = math.random(#v.rewardID)
doPlayerAddExperience(pid, v.experience)
doPlayerAddItem(pid, v.rewardID[item], 1)
doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, 'Congratulation!\nYou defeat the ' .. getCreatureName(cid) .. '. Your reward is ' .. getItemNameById(v.rewardID[item]) .. '.')
doSendAnimatedText(getThingPos(pid), v.experience, COLOR_WHITE)

i = i + 1

if i == stonesConfig.maxTopPlayers then
break
end
end
end
return true
end
]]>
</event>

<globalevent name="Start_Stones" type="startup" event="script">
<![CDATA[
domodlib("Stones_config")
domodlib("Stones_lib")

function onStartup()
for k, v in pairs(stonesConfig.stones) do
doSetStorage(v.storage, -1)
end

doSetStorage(stonesConfig.storage, 0)

return true
end
]]>
</globalevent>
</mod>[/XML]
 
Odp: Mod metin stone vent , protection zone problem

Zapomnialem dodac doRemoveItem, ta skrzynia i tak zniknie po 5 min
 
Back
Do góry