ae vod coloca string.lower pra n te que escrve o nome do bixo certinho
- Fórum
- OTServ
- Recursos
- Scripting
- Globalevents e Spells
- Matar Monstro Abrir Tp, Remover Parede, Ganhar Storage
Matar Monstro Abrir Tp, Remover Parede, Ganhar Storage
Por Vodkart, 13 de jun. de 2010 em Globalevents e Spells
info
Grupo: Conde
Registrado: 30/10/11
Posts: 625
Reputação: +101
Gênero: Masculino

Editado Outubro 1 por Fillzy
info
Grupo: Campones
Registrado: 02/11/10
Posts: 23
Reputação: 0
Char no Tibia: Calango Pally

ae Vodkart, tem como vc fazer pra quando Matar monstro abrir Teleport, e só dá pra entrar nesse teleport com storage ? Plis
info
Grupo: Campones
Registrado: 19/05/13
Posts: 14
Reputação: 0
Char no Tibia: ReBorner

info
Grupo: Campones
Registrado: 20/01/11
Posts: 80
Reputação: +44
Gênero: Masculino
Char no Tibia: Trikar Oxyshia

function onDeath(cid, corpse, killer)
local monstName = "Demon" -- nome do monstro
local Storage = 11543 -- storage que o jogador ira ganhar
if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(monstName) then
doCreatureSay(cid, "Você ganhou acesso para uma Secret Quest.", TALKTYPE_ORANGE_1)
if isInParty(killer[1]) == TRUE then
local players = getPartyMembers(getPartyLeader(killer[1]))
for i, k in ipairs(players) do
setPlayerStorageValue(k, Storage, 1)
end
else
setPlayerStorageValue(killer[1], Storage, 1)
end
end
return TRUE
end
Eu estou usando este teu script, entretanto eu gostaria de saber como posso fazer para ele só ser ativado no caso de eu possuir tal storage, ou seja, fazê-lo ser válido somente se eu possuir X storage.
Obrigado, amigo.
info
Grupo: Campones
Registrado: 15/03/14
Posts: 1
Reputação: 0

Ai mano, o storage é tipo acesso a porta né, tipo a blue legs quest?
Em 13/06/2010 em 08:33, Vodkart disse:Creditos:
Vodkart
Kydrai
fala galerinha resolvi posta alguns script que acontece quando o player mata algum monstro ...
o primeiro é o script que acontece quando voce mata um Monstro abre o teleport.
o segundo é matar o monstro e sumir a parede por algum tempo.
Obs: o Nome do monstro deve ser colocado com Letra Maiuscula.
[ Matar monstro e abrir Teleport ]
creaturescript\script
tp.lua
local tpId = 1387 local tps = { ["Orshabaal"] = {pos = {x=761, y=57, z=7}, toPos = {x=767, y=52, z=7}, time = 30}, } function removeTp(tp) local t = getTileItemById(tp.pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos, CONST_ME_POFF) end end function onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.time*1000, tp) end return TRUE end
explicação:
["Orshabaal"] --------- Nome do monstro
pos = {x=761, y=57, z=7} ----------- onde o Teleport irá abrir
toPos = {x=767, y=52, z=7} ------- onde o teleport vai leva eles
time = 30 ------------ tempo em segundos que o teleport ficará aberto
em creaturescript adicione:
<event type="death" name="tp" event="script" value="tp.lua"/>
no arquivo.xml do seu monstro adicione:
<script> <event name="tp"/> </script>
[ Matar Monstro e parede sumir por determinado tempo ]
creaturescript\script
removewall.lua
function onDeath(cid, corpse, killer) local M ={ ["rat"] = {Pos = {x=177,y=40,z=7},id= 1058 ,time = 20}, ["necromancer"] = {Pos = {x=173, y=40, z=7},id= 10196 ,time = 10}, } local x = M[getCreatureName(cid)] function criar() local parede = getTileItemById(x.Pos, x.id) doCreateItem(x.id, 1, x.Pos) end if x then local parede = getTileItemById(x.Pos, x.id) if parede then doRemoveItem(parede.uid, 1) doCreatureSay(cid, "A parede Será criada Novamente em "..x.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(criar, x.time*1000) end end return TRUE end
em creaturescript.xml adicione a tag:
<event type="death" name="removeall" event="script" value="removeall.lua"/>
No arquivo Xml do seu monstro adicione
<script> <event name="removeall"/> </script>
[ Matar Monstro e ser teleportado ]
teleportmon.lua
[/b][b]function onDeath(cid, corpse, killer)[/b] [b]local Ppos = {x = 160, y = 54, z = 7} -- posicao para onde ele vai ir local monstName = "Rat" -- nome do monstro if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(monstName) then if isInParty(killer[1]) == TRUE then local players = getPartyMembers(getPartyLeader(killer[1])) for i, k in ipairs(players) do doTeleportThing(k, Ppos) end else doTeleportThing(killer[1], Ppos) end end return TRUE end
em creaturescript.xml adicione a tag:
<event type="death" name="TelePort" event="script" value="teleportmon.lua"/>
No arquivo Xml do seu monstro adicione
<script> <event name="TelePort"/> </script>
[ Matar Monstro e Ganhar Storage ]
StorageMonster.lua
function onDeath(cid, corpse, killer) local monstName = "Demon" -- nome do monstro local Storage = 11543 -- storage que o jogador ira ganhar if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(monstName) then doCreatureSay(cid, "Você ganhou acesso para uma Secret Quest.", TALKTYPE_ORANGE_1) if isInParty(killer[1]) == TRUE then local players = getPartyMembers(getPartyLeader(killer[1])) for i, k in ipairs(players) do setPlayerStorageValue(k, Storage, 1) end else setPlayerStorageValue(killer[1], Storage, 1) end end return TRUE end
em creaturescript.xml adicione a tag:
<event type="death" name="StoraGe" event="script" value="StorageMonster.lua"/>
No arquivo Xml do seu monstro adicione
<script> <event name="StoraGe"/> </script>
algem ajuda aqui?
[10/05/2020 23:33:29] [Warning - Event::loadScript] Event onStepIn not found (data/movements/scripts/Clone Revive.lua)
[10/05/2020 23:33:30] [Warning - Event::loadScript] Event matou not found (data/creaturescripts/scripts/PokeLegendarios/Zapdos.lua)
[10/05/2020 23:33:30] [Warning - Event::loadScript] Event matou not found (data/creaturescripts/scripts/PokeLegendarios/Moltres.lua)
[10/05/2020 23:33:30] [Warning - Event::loadScript] Event matou not found (data/creaturescripts/scripts/PokeLegendarios/Articuno.lua)
[10/05/2020 23:33:30] [Warning - Event::loadScript] Event matou not found (data/creaturescripts/scripts/Remover Paret/Entei.lua)
[10/05/2020 23:33:30] [Warning - Event::loadScript] Event matou not found (data/creaturescripts/scripts/Remover Paret/Suicune.lua)
[10/05/2020 23:35:37] [Error - CreatureScript Interface]
[10/05/2020 23:35:37] data/creaturescripts/scripts/player/pokeDeath.lua:matou
[10/05/2020 23:35:38] Description:
[10/05/2020 23:35:38] (luaDoCreateItem) Item not found
[10/05/2020 23:35:38] [Error - CreatureScript Interface]
[10/05/2020 23:35:38] data/creaturescripts/scripts/player/pokeDeath.lua:matou
[10/05/2020 23:35:38] Description:
[10/05/2020 23:35:38] (luaDoItemSetAttribute) Item not found
[10/05/2020 23:35:38] [Error - CreatureScript Interface]
[10/05/2020 23:35:38] data/creaturescripts/scripts/player/pokeDeath.lua:matou
[10/05/2020 23:35:38] Description:
[10/05/2020 23:35:38] (luaDoDecayItem) Item not found
[10/05/2020 23:35:38] [Error - CreatureScript Interface]
[10/05/2020 23:35:38] data/creaturescripts/scripts/player/pokeDeath.lua:matou
[10/05/2020 23:35:38] Description:
[10/05/2020 23:35:38] (luaDoItemSetAttribute) Item not found





info
Grupo: Campones
Registrado: 03/07/11
Posts: 23
Reputação: 0
Char no Tibia: Senhor Feudal
ae vodkart , meu serve é 7.92 e não tem creaturescripts , onde eu coloco ? :S