é muito grande o escript e eu não sei coloca em partes escondidos no forum.. mais la vai
esta parte é da pasta lib
--[[
System developed by MaXwEllDeN[
[email protected]]
Version 1.0
]]
L_Soul = {
souls = {
["dark"] = {effects = {distance = 31, eff = 17}, combat = COMBAT_DEATHDAMAGE},
["flame"] = {effects = {distance = 3, eff = 15}, combat = COMBAT_FIREDAMAGE},
["frozen"] = {effects = {distance = 36, eff = 43}, combat = COMBAT_ICEDAMAGE},
["holy"] = {effects = {distance = 37, eff = 39}, combat = COMBAT_HOLYDAMAGE},
["electric"] = {effects = {distance = 35, eff = 11}, combat = COMBAT_ENERGYDAMAGE},
},
creatures = {
["Necromancer"] = {chance = 50, type = "dark",
summ = {
hp = {hpb = 50, maxb = 700},
needSoulPoints = 50,
needMana = 0,
needHealth = 20,
minP = 50,
},
enchant = {charges = 100, min = 10, max = 60, attack_speed = 250},
},
["Dragon Lord"] = {chance = 100, type = "flame",
summ = {
hp = {hpb = 50, maxb = 700},
needSoulPoints = 50,
needMana = 0,
needHealth = 20,
minP = 50,
},
enchant = {charges = 200, min = 50, max = 150, attack_speed = 1000},
},
["Frost Dragon"] = {chance = 100, type = "frozen",
summ = {
hp = {hpb = 50, maxb = 700},
needSoulPoints = 50,
needMana = 0,
needHealth = 20,
minP = 50,
},
enchant = {charges = 200, min = 50, max = 160, attack_speed = 1500},
},
["Wyrm"] = {chance = 100, type = "electric",
summ = {
hp = {hpb = 50, maxb = 700},
needSoulPoints = 50,
needMana = 0,
needHealth = 20,
minP = 50,
},
enchant = {charges = 200, min = 50, max = 160, attack_speed = 550},
},
["Monk"] = {chance = 150, type = "holy",
summ = {
hp = {hpb = 50, maxb = 700},
needSoulPoints = 50,
needMana = 0,
needHealth = 20,
minP = 50,
},
enchant = {charges = 200, min = 50, max = 160, attack_speed = 550},
},
},
ids = {8300},
max_distance = 5,
language = "en",
auras_sto = 77143,
soul_t = 10, -- Em Minutos
}
---------------------- A U R A S ----------------------------
L_Soul.auras = {
["dark"] = {stones_n = 7, damage = {25, 250}, interval = 1200, duration = 120, raio = 4, speed = 150},
["flame"] = {stones_n = 5, damage = {250, 650}, interval = 500, duration = 60, raio = 7, speed = 75},
["frozen"] = {stones_n = 2, damage = {150, 350}, interval = 750, duration = 60, raio = 2, speed = 150},
["electric"] = {stones_n = 5, damage = {150, 350}, interval = 750, duration = 60, raio = 2, speed = 150},
["holy"] = {stones_n = 0, damage = {150, 350}, interval = 750, duration = 60, raio = 7, speed = 150},
}
------------------- E N C A N T A M E N T O -----------------
L_Soul.enchant = {
weapons = {
[2408] = {"dark", "flame", "frozen"}, -- Warlord Sword
[2190] = {"dark", "holy"}, -- Wand of Vortex
[2456] = {"dark", "holy"}, -- Bow
[2400] = {"dark", "holy", "frozen", "flame", "electric"}, -- Magic Sword(SOV)
},
}
------------------ L I N G U A G E M ------------------------
L_Soul.lang = {
["en"] = {
"This soul stone is filled with a %s's %s soul!",
"This soul stone must be near the creature's corpse.",
"There's no soul!",
"Your soul stone didn't supported the soul and broke! This %s's %s soul escaped!",
"Congratulations, you caught a %s's soul[%s]!",
"Filled with a %s's %s soul.",
"This item can't be enchanted.",
"To summon a %s you must have at least %d soul points.",
"You can't summon a %s there.",
"To summon a %s you must have at least %d mana points.",
"To summon a %s you must have at least %d health points.",
"The soul stone broke and the corpse was possessed by %s's %s soul!",
"This corpse doesn't support this %s's powerful %s soul. The soul has escaped and is roaming the world and tormenting people.",
"A body can't have two souls.",
"The %s's soul was aprisioned in weapon.",
"This weapon is enchanted with a %s's soul. Charges: %d/%d.",
"Your %s lost charm.",
"This weapon already is enchanted with a soul!", -- 18
--> AURAS <--
"You haven't enought %s souls[%d].",
"You need wait %d minutes to use an aura protection again.",
"You can't use an aura protection on protected zones.",
{
"Alive again!? How!? AH! It doesn't matter, i just want to get my revenge! MUHAUHAUHUAUA!",
"OH how is sweet live!",
},
}
}
function isWeapon(uid) -- Function by Mock the bear.
local uid = uid or 0
local f = getItemWeaponType(uid)
return (f == 1 or f == 2 or f == 3) or false
end
function string:formal()
local self = self:sub(1, 1):upper() .. self:sub(2, #self)
while (self:find(" (%l)")) do
local a = self:find(" (%l)")
self = self:sub(1, a) .. self:sub(a + 1, a + 1):upper() .. self:sub(a + 2, #self)
end
return self
end
function getUidsInArea(ext1, ext2)
local uids = {}
for a = 0, ext2.x-ext1.x do
for b = 0, ext2.y-ext1.y do
local pos = {x = ext1.x+a, y = ext1.y+b, z = ext1.z, stackpos = 255}
local cid = getTopCreature(pos).uid
if (isCreature(cid)) then
table.insert(uids, cid)
end
end
end
return uids
end
function getItemsInContainerById(container, itemid) -- Function By Kydrai
local items = {}
if isContainer(container) and getContainerSize(container) > 0 then
for slot = 0, getContainerSize(container) - 1 do
local item = getContainerItem(container, slot)
if isContainer(item.uid) then
for i, v in ipairs (getItemsInContainerById(item.uid, itemid)) do
table.insert(items, v)
end
elseif itemid == item.itemid then
table.insert(items, item)
end
end
end
return items
end
function getAllPlayerItemsById(uid, itemid)
local items = {}
for a = CONST_SLOT_FIRST, CONST_SLOT_LAST do
local item = getPlayerSlotItem(uid, a)
if ((item.uid > 0) and (item.itemid == itemid)) then
table.insert(items, item)
end
if ((isContainer(item.uid)) and (getContainerSize(item.uid) > 0)) then
for i, v in ipairs(getItemsInContainerById(item.uid, itemid)) do
table.insert(items, v)
end
end
end
return items
end
function getAllPlayerSoulStones(uid, empty)
local stones = {}
for _, s in ipairs(L_Soul.ids) do
for _, v in pairs(getAllPlayerItemsById(uid, s)) do
if not ((empty) and (not getItemAttribute(v.uid, "Soul"))) then
table.insert(stones, v)
end
end
end
return stones
end
function getPlayerSoulStonesByType(uid, type)
local stones = {}
for _, v in pairs(getAllPlayerSoulStones(uid)) do
if ((getItemAttribute(v.uid, "Soul")) and (L_Soul.creatures[getItemAttribute(v.uid, "Soul")].type:lower() == type:lower())) then
table.insert(stones, v)
end
end
return stones
end
function doPlayerRemoveSoulStoneByType(uid, type, ammount)
local stones = getPlayerSoulStonesByType(uid, type)
local ammount = ammount or 1
if (#stones < ammount) then
return false
end
local a = 0
for _, v in pairs(stones) do
if (a ~= ammount) then
a = a + 1
doRemoveItem(v.uid, 1)
else
break
end
end
return true
end
function getPlayerSoulStonesCount(uid, type)
return #getPlayerSoulStonesByType(uid, type)
end
--------------------
esta parte é da pasta mods.xml
<?xml version = "1.0" encoding = "UTF-8" ?>
<mod name="Soul System" version="1.0" author="MaXwEllDeN" contact="tibiaking.com" enabled="yes">
<talkaction words="dark protection" filter="word-spaced" event="script" value = "Soul System/Auras.lua"/>
<talkaction words="flame protection" filter="word-spaced" event="script" value = "Soul System/Auras.lua"/>
<talkaction words="frozen protection" filter="word-spaced" event="script" value = "Soul System/Auras.lua"/>
<talkaction words="electric protection" filter="word-spaced" event="script" value = "Soul System/Auras.lua"/>
<talkaction words="holy protection" filter="word-spaced" event="script" value = "Soul System/Auras.lua"/>
<action itemid="8300" event="script" value="Soul System/Action.lua" allowfaruse="1"/>
<event type = "login" name = "SoulL" event="script" value="Soul System/Creaturescript.lua"/>
<event type = "kill" name = "SoulKill" event="script" value="Soul System/Creaturescript.lua"/>
<event type = "death" name = "SoulD" event="script" value="Soul System/Creaturescript.lua"/>
<event type = "attack" name = "SoulATK" event="script" value="Soul System/Creaturescript.lua"/>
</mod>
---------------------
esta parte é da pasta mods/script/soul system
dentro da pasta sol system tem 3 arquivos lua vou posta eles abaixo
1º Action.lua
--[[
System developed by MaXwEllDeN[
[email protected]]
Version 1.0
]]
function onUse(cid, item, fromPos, item2, toPos)
doCreatureSay(cid, "A")
if (getItemAttribute(item2.uid, "M_Soul")) and (os.clock() - getItemAttribute(item2.uid, "M_Time") > L_Soul.soul_t) then
doItemSetAttribute(item2.uid, "M_Soul", false)
end
local fromPos = (fromPos.x ~= 65535) and fromPos or getThingPos(cid)
local lan = L_Soul.lang[L_Soul.language]
if (getItemAttribute(item.uid, "Soul")) then
if (toPos.x ~= 65535) and (getItemAttribute(item2.uid, "criaturaS")) then
if (getItemAttribute(item2.uid, "M_Soul")) then
return doPlayerSendCancel(cid, lan[14])
end
local soulT = L_Soul.creatures[getItemAttribute(item.uid, "Soul")].type
local summ = L_Soul.creatures[getItemAttribute(item.uid, "Soul")].summ
local tos = getMonsterInfo(getItemAttribute(item2.uid, "criaturaS"))
if (tos.experience < getMonsterInfo(getItemAttribute(item.uid, "Soul")).experience) then
doSendMagicEffect(fromPos, L_Soul.souls[soulT].effects.eff)
doPlayerSendTextMessage(cid, 27, string.format(lan[13], getItemAttribute(item.uid, "Soul"), soulT))
return doRemoveItem(item.uid, 1)
elseif (getPlayerSoul(cid) < summ.needSoulPoints) then
return doPlayerSendCancel(cid, string.format(lan[8], getItemAttribute(item.uid, "Soul"), summ.needSoulPoints))
elseif (getCreatureMana(cid) < summ.needMana) then
return doPlayerSendCancel(cid, string.format(lan[10], getItemAttribute(item.uid, "Soul"), summ.needMana))
elseif (getCreatureHealth(cid) < summ.needHealth) then
return doPlayerSendCancel(cid, string.format(lan[11], getItemAttribute(item.uid, "Soul"), summ.needHealth))
elseif (getTopCreature(toPos).uid > 0) then
return doPlayerSendCancel(cid, string.format(lan[9], getItemAttribute(item.uid, "Soul")))
elseif (getTileInfo(toPos).protection) then
return doPlayerSendCancel(cid, string.format(lan[9], getItemAttribute(item.uid, "Soul")))
end
doPlayerAddSoul(cid, -summ.needSoulPoints)
doCreatureAddMana(cid, -summ.needMana)
doCreatureAddHealth(cid, -summ.needHealth)
local crea = doCreateMonster(getItemAttribute(item.uid, "Soul"), toPos)
if (summ.needMana > 0) then doSendAnimatedText(getThingPos(cid), -summ.needMana, 120) end
if (summ.needHealth > 0) then doSendAnimatedText(getThingPos(cid), -summ.needHealth, 180) end
setCreatureMaxHealth(crea, summ.hp.maxb)
doCreatureAddHealth(crea, summ.hp.maxb)
doCreatureChangeOutfit(crea, tos.outfit)
doCreatureAddHealth(crea, (-summ.hp.maxb + 1) + summ.hp.hpb - 1)
doMonsterSetTarget(crea, cid)
setPlayerStorageValue(crea, 7148, getItemAttribute(item2.uid, "criaturaS"))
doSendMagicEffect(toPos, L_Soul.souls[soulT].effects.eff)
doSendDistanceShoot(fromPos, toPos, L_Soul.souls[soulT].effects.distance)
doPlayerSendTextMessage(cid, 27, string.format(lan[12], getItemAttribute(item.uid, "Soul"), soulT))
doRemoveItem(item.uid, 1)
doCreatureSay(crea, lan[#lan][math.random(#lan[#lan])], 19)
return doRemoveItem(item2.uid, 1)
elseif (toPos.x == 65535) then
local enchant = L_Soul.creatures[getItemAttribute(item.uid, "Soul")].enchant
if not (L_Soul.enchant.weapons[item2.itemid] or (L_Soul.enchant.weapons[item2.itemid] and not isInArray(L_Soul.enchant.weapons[item2.itemid], soulT:lower()))) then
return doPlayerSendCancel(cid, lan[7])
end
if (getItemAttribute(item2.uid, "ES_Charges")) then
return doPlayerSendCancel(cid, lan[18])
end
doItemSetAttribute(item2.uid, "description", string.format(lan[16], getItemAttribute(item.uid, "Soul"), enchant.charges, enchant.charges))
doItemSetAttribute(item2.uid, "ES_Charges", enchant.charges)
doItemSetAttribute(item2.uid, "ES_Type", getItemAttribute(item.uid, "Soul"))
doPlayerSendTextMessage(cid, 27, string.format(lan[15], getItemAttribute(item.uid, "Soul")))
doSendMagicEffect(toPos, L_Soul.souls[L_Soul.creatures[getItemAttribute(item.uid, "Soul")].type].effects.eff)
return doRemoveItem(item.uid, 1)
end
end
if not (isContainer(item2.uid)) or not (getItemAttribute(item2.uid, "M_Soul")) then
return doPlayerSendCancel(cid, lan[3])
end
if (getItemAttribute(item.uid, "Soul")) then
return doPlayerSendCancel(cid, string.format(lan[1], getItemAttribute(item.uid, "Soul"), L_Soul.creatures[getItemAttribute(item.uid, "Soul")].type))
end
if (getDistanceBetween(fromPos, toPos) > L_Soul.max_distance) then
return doPlayerSendCancel(cid, lan[2])
end
if (isCreature(item2.uid)) then
return true
end
local soul = L_Soul.creatures[getItemAttribute(item2.uid, "M_Soul")]
if not (soul) then
return true
end
if (math.random(100) + soul.chance < 100 + math.floor(soul.chance/2)) then
doRemoveItem(item.uid, 1)
doSendMagicEffect(toPos, L_Soul.souls[L_Soul.creatures[getItemAttribute(item2.uid, "M_Soul")].type].effects.eff)
doPlayerSendTextMessage(cid, 27, string.format(lan[4], getItemAttribute(item2.uid, "M_Soul"), soul.type:formal()))
doSendMagicEffect(fromPos, 2)
return doItemSetAttribute(item2.uid, "M_Soul", false)
end
doSendDistanceShoot(toPos, fromPos, L_Soul.souls[soul.type].effects.distance)
doPlayerSendTextMessage(cid, 27, string.format(lan[5], getItemAttribute(item2.uid, "M_Soul"), soul.type:formal()))
doItemSetAttribute(item.uid, "Soul", getItemAttribute(item2.uid, "M_Soul"))
doItemSetAttribute(item.uid, "description", string.format(lan[6], getItemAttribute(item2.uid, "M_Soul"), soul.type))
doSendMagicEffect(fromPos, 28)
doSendMagicEffect(fromPos, 29)
doSendMagicEffect(fromPos, 30)
return doItemSetAttribute(item2.uid, "M_Soul", false)
end
2º Auras.lua
-- ######################################################## --
-- ## Aura System ## --
-- ## Developed by MaXwEllDeN[
[email protected]] ## --
-- ## Version: 1.0 ## --
-- ######################################################## --
function checkDam(uid, AurAz, st)
if (isCreature(uid)) and (os.time() - st < L_Soul.auras[AurAz].duration)then
local p = getThingPos(uid)
local poz = {{x = p.x, y = p.y - 2, z = p.z},
{x = p.x - 2, y = p.y, z = p.z},
{x = p.x, y = p.y + 2, z = p.z},
{x = p.x + 2, y = p.y, z = p.z},}
if (getTileInfo(p).protection) then
st = st - L_Soul.auras[AurAz].duration
end
local function getBest(a)
local pz = poz[1]
for i, v in pairs(poz) do
if (getDistanceBetween(v, getThingPos(a)) < getDistanceBetween(pz, getThingPos(a))) then
pz = v
end
end
return pz
end
local creat = getUidsInArea({x = p.x - L_Soul.auras[AurAz].raio, y = p.y - L_Soul.auras[AurAz].raio, z = p.z}, {x = p.x + L_Soul.auras[AurAz].raio, y = p.y + L_Soul.auras[AurAz].raio, z = p.z})
local target = ((isCreature(getCreatureTarget(uid))) and getCreatureTarget(uid)) or 0
local cs = {}
if (target == 0) then
for _, v in pairs(creat) do
if ((getCreatureTarget(v) == uid)) or ((isMonster(v)) or ((getCreatureSkullType(v) > 2) and (getCreatureTarget(v) == uid))) and (v ~= uid) then
table.insert(cs, v)
end
end
target = (#cs > 0 and cs[math.random(#cs)]) or 0
end
if (target ~= 0) then
doSendDistanceShoot(getBest(target), getThingPos(target), L_Soul.souls[AurAz].effects.distance)
doTargetCombatHealth(uid, target, L_Soul.souls[AurAz].combat, -L_Soul.auras[AurAz].damage[1], -L_Soul.auras[AurAz].damage[2], 255)
end
addEvent(checkDam, L_Soul.auras[AurAz].interval, uid, AurAz, st)
end
end
function sendEffect(uid, interval, at, st, AurAz)
local at = at or 1
if (isCreature(uid)) then
local p = getThingPos(uid)
if (getTileInfo(p).protection) then
st = st - L_Soul.auras[AurAz].duration
end
local poz = {{x = p.x, y = p.y - 2, z = p.z},
{x = p.x - 2, y = p.y, z = p.z},
{x = p.x, y = p.y + 2, z = p.z},
{x = p.x + 2, y = p.y, z = p.z},}
if (os.time() - st > L_Soul.auras[AurAz].duration) then
for i, v in ipairs(poz) do
doSendDistanceShoot(v, p, L_Soul.souls[AurAz].effects.distance)
end
setPlayerStorageValue(uid, L_Soul.auras_sto, -1)
addEvent(doSendMagicEffect, 250, p, L_Soul.souls[AurAz].effects.eff)
return true
end
local next = poz[at + 1] and at+1 or 1
doSendDistanceShoot(poz[at], poz[next], L_Soul.souls[AurAz].effects.distance)
addEvent(sendEffect, interval, uid, interval, next, st, AurAz)
end
return true
end
function onSay(cid, words, param)
domodlib("Soul System[LIB]")
local lan = L_Soul.lang[L_Soul.language]
local AurAz = words:explode(" ")[1]
if not (L_Soul.auras[AurAz]) then
return false
end
if (#getPlayerSoulStonesByType(cid, AurAz) < L_Soul.auras[AurAz].stones_n) then
return doPlayerSendCancel(cid, string.format(lan[19], AurAz, L_Soul.auras[AurAz].stones_n))
end
if (getPlayerStorageValue(cid, L_Soul.auras_sto) > 0) then
return doPlayerSendCancel(cid, string.format(lan[20], math.floor(L_Soul.auras[AurAz].duration/60)))
end
if (getTileInfo(getThingPos(cid)).protection) then
return doPlayerSendCancel(cid, lan[21])
end
setPlayerStorageValue(cid, L_Soul.auras_sto, os.time())
doPlayerRemoveSoulStoneByType(cid, AurAz, L_Soul.auras[AurAz].stones_n)
sendEffect(cid, L_Soul.auras[AurAz].speed, nil, os.time(), AurAz)
checkDam(cid, AurAz, os.time())
return true
end
3° Creaturescript.lua
--[[
System developed by MaXwEllDeN[
[email protected]]
Version 1.0
]]
function onKill(cid, target, lastHit)
if (getPlayerStorageValue(target, 7148) ~= -1) then
doCreatureSetDropLoot(target, {})
end
return registerCreatureEvent(target, "SoulD")
end
function onLogin(cid)
setPlayerStorageValue(cid, 7126, -1)
registerCreatureEvent(cid, "SoulATK")
setPlayerStorageValue(cid, L_Soul.auras_sto, -1)
return registerCreatureEvent(cid, "SoulKill")
end
local function TransformAMerda(cas)
for a = 0, 255 do
local pos = cas.pos
pos.stackpos = a
local item = getThingFromPos(pos)
if (item.uid > 0) and (item.itemid == cas.it.itemid) and (cas.n == getItemAttribute(item.uid, "criaturaS")) and (not getItemAttribute(item.uid, "M_Time")) then
return doTransformItem(item.uid, cas.nid)
end
end
return false
end
function onDeath(cid, corpse, deathList)
doItemSetAttribute(corpse.uid, "criaturaS", getCreatureName(cid):formal())
if (getPlayerStorageValue(cid, 7148) ~= -1) then
addEvent(TransformAMerda, 1, {pos = getThingPos(cid), it = corpse, n = getCreatureName(cid), nid = getMonsterInfo(getPlayerStorageValue(cid, 7148)).lookCorpse})
return true
end
doItemSetAttribute(corpse.uid, "M_Time", os.clock())
return doItemSetAttribute(corpse.uid, "M_Soul", getCreatureName(cid):formal())
end
local function Atacar(cid)
if (not isCreature(cid)) then
return false
elseif (not isCreature(getCreatureTarget(cid))) then
setPlayerStorageValue(cid, 7126, -1)
return false
end
local target = getCreatureTarget(cid)
local enc = isWithEnchantedW(cid)
local lan = L_Soul.lang[L_Soul.language]
if (enc) then
if (isWeapon(enc.arma.uid)) and (getDistanceBetween(getThingPos(getCreatureTarget(cid)), getThingPos(cid)) > 1) then
setPlayerStorageValue(cid, 7126, -1)
return false
end
local typ, enchant = L_Soul.souls[L_Soul.creatures[getItemAttribute(enc.arma.uid, "ES_Type")].type:lower()], L_Soul.creatures[getItemAttribute(enc.arma.uid, "ES_Type")].enchant
doTargetCombatHealth(cid, target, typ.combat, -enchant.min, -enchant.max, typ.effects.eff)
doSendDistanceShoot(getThingPos(cid), getThingPos(target), typ.effects.distance)
if (enc.at == 1) then
doPlayerSendTextMessage(cid, 27, string.format(lan[17], getItemNameById(enc.arma.itemid)))
doItemSetAttribute(enc.arma.uid, "description", false)
doItemSetAttribute(enc.arma.uid, "ES_Charges", false)
else
doItemSetAttribute(enc.arma.uid, "description", string.format(lan[16], getItemAttribute(enc.arma.uid, "ES_Type"), enc.at - 1, enchant.charges))
doItemSetAttribute(enc.arma.uid, "ES_Charges", enc.at - 1)
end
addEvent(Atacar, enchant.attack_speed, cid)
else
setPlayerStorageValue(cid, 7126, -1)
end
end
function onAttack(cid, target)
if (getPlayerStorageValue(cid, 7126) < 1) then
setPlayerStorageValue(cid, 7126, 5)
Atacar(cid)
end
return true
end
function isWithEnchantedW(uid)
for a = 5, 6 do
local item = getPlayerSlotItem(uid, a)
if (item.uid > 2) and (getItemAttribute(item.uid, "ES_Charges")) then
return {arma = item, at = getItemAttribute(item.uid, "ES_Charges")}
end
end
return false
end
la no perfil do maxwell tem pra fazer download mais não funfa os escript queria uma explicação mais clara!
desculpa por ta tao grande cara eu não sei mexe direito no forum!