Skrypt:Witam mam dla Ciebie pewn? pro?b?. Da?by? rade wykona? takie co??
Rodzaj: actions(chyba)
Wersja tibii: 8.4
O czym ma by? skrypt: Chodzi mi o to, ?e po zabiciu monstera pojawia si? TP.
(Prosz? nie wkleja? mi tego potwora z firewalker bootsow nie mog? si? w nim po?apa?)
local pozycjaTP = {x=123, y=123, z=7} -- Na jakiej pozycji ma si? robi? teleport
local gdzieTP = {x=123, y=123, z=7} -- Gdzie ten teleport ma teleportowa?
local ile = 2*60 -- Na ile sekund teleport ma si? tworzy?. Pocz?tkowo na 2 minuty. Po tym czasie teleport znika.
local id = 1234 -- ID teleportu
function onKill(cid, target)
local tp = doCreateTeleport(id, gdzieTP, pozycjaTP)
addEvent(doRemoveItem,ile,tp,1)
return TRUE
end
<event type="kill" name="Teleport" script="nazwa tego skruptu.lua" />
registerCreatureEvent(cid,"Teleport")
-- D?wignia do Backpack?w
local itemy = {
[1234] = {item = 2050, ile = 5, cap = 500, backpack = 2000, koszt = 500000, ladunki = 5},
[1235] = {item = 2350, ile = 20, cap = 580, backpack = 2001, koszt = 5000000, ladunki = 2}
}
-- Tutaj uzupe?niasz tak:
-- [action id d?wigni] = {item = id runy lub innego itemu, ile = ile tych item?w ma by? w bp, cap = ile wa?y bp z tymi rzeczami, backpack = id backpacka, koszt = ile kosztuje ca?y backpack tych rzeczy w gp, ladunki = ile ?adunk?w ma mie? runa/inna rzecz}
-- Wa?ne, ?eby nie dawa? do tego skryptu d?wigni, kt?ra nie ma actionid
function onUse(cid, item, frompos, item2, topos)
local cap = getPlayerFreeCap(cid)
local dzwignia = itemy[item.actionid]
if(cap < dzwignia.cap) then
doPlayerSendCancel(cid,"It's too heavy. You need to have ".. dzwignia.cap .." capacity.")
return TRUE
end
if(doPlayerRemoveMoney(cid,dzwignia.koszt) == FALSE) then
doPlayerSendCancel(cid,"You don't have enought gold. You need to have ".. dzwignia.koszt .." gold coins.")
return TRUE
end
local bp = doPlayerAddItem(cid,dzwignia.backpack,1)
for i=1, dzwignia.ile do
doAddContainerItem(bp,dzwignia.item,dzwignia.ladunki)
end
doPlayerSendCancel(cid,"Here you are.")
return TRUE
end
-- D?wignia do Backpack?w
local itemy = {
[1234] = {item = 2050, ladunki = 5, koszt = 200},
[1235] = {item = 2350, ladunki = 2, koszt = 500}
}
-- Tutaj uzupe?niasz tak:
-- [action id d?wigni] = {item = id runy, ladunki = ile ?adunk?w, koszt = cena w gp
-- Wa?ne, ?eby nie dawa? do tego skryptu d?wigni, kt?ra nie ma actionid
function onUse(cid, item, frompos, item2, topos)
local dzwignia = itemy[item.actionid]
if(doPlayerRemoveMoney(cid,dzwignia.koszt) == FALSE) then
doPlayerSendCancel(cid,"You don't have enought gold. You need to have ".. dzwignia.koszt .." gold coins.")
return TRUE
end
local bp = doPlayerAddItem(cid,dzwignia.item,dzwignia.ladunki)
doPlayerSendCancel(cid,"Here you are.")
return TRUE
end
local pos = {x=123, y=123, z=7}
local promoID = 2 -- Ile promocji daje np.: 2 = profesja pocz?tkowa + 4*2
function onUse(cid, item, frompos, item2, topos)
doRemoveItem(item.uid,1)
doTeleportThing(cid,pos)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Dostales promocje.")
setPlayerPromotionLevel(cid,promoID)
return TRUE
end
local SKINS = {
-- Przedmioty
[5892] = {25000, 2472},
}
local pozycja = {x=1004, y=983, z=7} -- Pozycja, na jakiej jest u?ywany item.
function onUse(cid, item, fromPosition, itemEx, toPosition)
local skin = SKINS[itemEx.itemid]
if(toPosition.x == pozycja.x and toPosition.y == pozycja.y and toPosition.z == pozycja.z) then
if(skin == nil) then
doPlayerSendCancel(cid, "To jest niemozliwe.")
return TRUE
end
local random = math.random(1, 5)
if random == 1 then
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, skin[2], 1)
doPlayerSendTextMessage(cid, 22, "Swietnie, wlasnie wykules przedmiot")
elseif(skin[3] and random >= skin[3]) then
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, skin[4], 1)
doPlayerSendTextMessage(cid, 22, "Swietnie, wlasnie wykules przedmiot")
else
doSendMagicEffect(toPosition, CONST_ME_POFF)
doPlayerSendTextMessage(cid, 22, "Nie udalo sie.")
end
doTransformItem(itemEx.uid, 2223)
else
doPlayerSendCancel(cid,"Mozesz to zrobic tylko na kowadle.")
end
end
local ileMany = 100 -- Ile many si? dostaje
function onUse(cid, item, frompos, item2, topos)
doPlayerAddMana(cid,ileMany)
doRemoveItem(item.uid,1) -- Usu? t? linijk? ?eby scroll by? niesko?czony
return TRUE
end
function onSay(cid, words, param)
playerpos = getPlayerPosition(cid)
mana = getPlayerMana(cid)
vocation = getPlayerVocation(cid)
if mana >= 2550 and vocation == 1 then
if getPlayerSkill(cid,6) >= 90 then
creature = doSummonCreature("Gamabunta", playerpos)
doConvinceCreature(cid, creature)
doPlayerAddMana(cid, -2550)
doPlayerSay(cid,"Kuchiyose no Jutsu",16)
else
doPlayerSendCancel(cid,"You do not have enough chakra control level")
end
else
doPlayerSendCancel(cid,"You can't summon this creature")
end
if mana >= 2550 and vocation == 24 then
if getPlayerSkill(cid,6) >= 90 then
creature = doSummonCreature("Gamabunta", playerpos)
doConvinceCreature(cid, creature)
doPlayerAddMana(cid, -2550)
doPlayerSay(cid,"Kuchiyose no Jutsu",16)
else
doPlayerSendCancel(cid,"You do not have enough chakra control level")
end
else
doPlayerSendCancel(cid,"You can't summon this creature")
end
end
<action itemid="2557" script="kowal.lua"/>
local SKINS = {
-- Przedmioty
[5892] = {25000, 2472},
}
local pozycja = {x=1004, y=983, z=7} -- Pozycja, na jakiej jest u?ywany item.
function onUse(cid, item, fromPosition, itemEx, toPosition)
local skin = SKINS[itemEx.itemid]
if(fromPosition.x == pozycja.x and fromPosition.y == pozycja.y and fromPosition.z == pozycja.z) then
if(skin == nil) then
doPlayerSendCancel(cid, "To jest niemozliwe.")
return TRUE
end
local random = math.random(1, 5)
if random == 1 then
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, skin[2], 1)
doPlayerSendTextMessage(cid, 22, "Swietnie, wlasnie wykules przedmiot")
elseif(skin[3] and random >= skin[3]) then
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, skin[4], 1)
doPlayerSendTextMessage(cid, 22, "Swietnie, wlasnie wykules przedmiot")
else
doSendMagicEffect(toPosition, CONST_ME_POFF)
doPlayerSendTextMessage(cid, 22, "Nie udalo sie.")
end
doTransformItem(itemEx.uid, 2223)
else
doPlayerSendCancel(cid,"Mozesz to zrobic tylko na kowadle.")
end
return TRUE
end
@Wontek
Du?o trzeba by edytowa? w tym, ?eby wy?wietla?o. Najlepiej, jakby? ustawi? typ ?wiata pvp. Wtedy b?dzie nalicza? normalnie fragi. Jak przez komend? fragi b?d? dzia?a?y, to napisz na gg/pw to powiem Ci gdzie co doda?.
http://tibia.net.pl/pomoc-z-ot/108898-czar-explosion-z-wodbo.html
Kiedy bedzie moje zamowienie?1.Rodzaj: actions moventes spells chyba
Name: Transformation rune
tibia: 8.40
opis:Mam rune o id 2296 i mam monstra o nazwie Mialga biore use na mialge runa i znika mialga i pojawia sie dialga
Dziex z gory Czekam juz na skripta:up:
@2x up
Znalaz?em ten skrypt na innym forum (zmie? sobie kolor wiadomo?ci)
data/creaturescripts/scripts/monster_counter.lua
data/creaturescripts/creaturescripts.xmlKod:local monsters = { --name = storage ["rat"] = 35001, ["troll"] = 35002, ["rotworm"] = 35003, ["dragon"] = 35004, ["dragon lord"] = 35005, ["demon"] = 35006, } function onKill(cid, target) local ja = getCreatureName(cid) if(isPlayer(target) ~= TRUE) then local name = getCreatureName(target) local monster = monsters[string.lower(name)] if(monster) then local killedMonsters = getPlayerStorageValue(cid, monster) if(killedMonsters == -1) then killedMonsters = 1 end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "" ..ja.. " killed " .. killedMonsters .. " " .. name .. "'s.") setPlayerStorageValue(cid, monster, killedMonsters + 1) end end return TRUE end
* TFS 0.2
* TFS 0.3 (RC2+)Kod:<event type="kill" name="KilledMonstersCounter" script="monster_counter.lua"/>
3. Dodaj to co login.lua przed return TRUEKod:<event type="kill" name="KilledMonstersCounter" event="script" value="monster_counter.lua"/>
Kod:registerCreatureEvent(cid, "KilledMonstersCounter")
<script><event name="KilledMonstersCounter"/></script>
--[[ Transformation system by Piotrek1447 ]]--
local config =
{
neededLevel = 50,
requiredVocation = {0,1,2,3,4,5,6},
changeVocation = "yes",
newVocation = 2,
changeOutfit = "yes",
newOutfit = 37,
removeSoulPoints = "no",
removeSoulPointsCount = 0
}
local VOCATION_STORAGE = 10000
local outfit = {lookType = config.newOutfit, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
function onSay(cid, words, param)
if(getPlayerLevel(cid) <= config.neededLevel) then
doPlayerSendCancel(cid, "Sorry, you don\'t have required level.")
return TRUE
end
if(isInArray(config.requiredVocation, getPlayerVocation(cid)) ~= TRUE) then
doPlayerSendCancel(cid, "Sorry, you don\'t have required vocation.")
return TRUE
end
setPlayerStorageValue(cid, VOCATION_STORAGE, getPlayerVocation(cid))
if(config.changeVocation == "yes") then
doPlayerSetVocation(cid, config.newVocation)
end
if(config.changeOutfit == "yes") then
doSetCreatureOutfit(cid, outfit, -1)
end
if(config.removeSoulPoints == "yes") then
if(getPlayerSoul(cid) >= config.removeSoulPointsCount) then
doPlayerAddSoul(cid, - config.removeSoulPointsCount)
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required count of soul points.")
end
end
addEvent(removeMana, 100, cid)
return TRUE
end
function removeMana(cid)
doCreatureAddMana(cid, -1)
if(getCreatureMana(cid) > 0) then
addEvent(removeMana, 100, cid)
else
doRemoveCondition(cid, CONDITION_OUTFIT)
transformBack(cid)
end
return TRUE
end
function transformBack(cid)
doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE))
setPlayerStorageValue(cid, VOCATION_STORAGE, 0)
return TRUE
end
setPlayerStorageValue(cid, VOCATION_STORAGE, getPlayerVocation(cid))
if(config.changeVocation == "yes") then
doPlayerSetVocation(cid, config.newVocation)