Ir para conteúdo
Entre para seguir isso  
pcnaddeo

Algumas talkactions xD

Recommended Posts

pcnaddeo    0
pcnaddeo

Gente primeiramente se alguem postou isso ante ou em outro forum e eu n pus creditos me desculpam mais isso ta no meu pc a tempos e vou postar :D

 

ta ai

 

!down e !up por Talkactions

 

quando voce diz !up, vai para cima/ e quando diz !down vai pra baixo

 

 

teleport.lua

function onSay(cid, words, param)
-- Made By [b]Xikez[/b]

   local pos = getPlayerPosition(cid)
   local newpos = pos
   local access = getPlayerAccess(cid)
   if access >= 3 then
 if words == "!down" then
     newpos.z = newpos.z + 1
 elseif words == "!up" then
     newpos.z = newpos.z - 1    
 end  
   doPlayerSendTextMessage(cid, 25, words)
   doTeleportThing(cid, newpos)
   doSendMagicEffect(newpos,10)
   return 0
   end
   return 1    
end

 

talkactions.xml

<talkaction words="!down" script="teleport.lua" />
<talkaction words="!up" script="teleport.lua" />

 

--------------------------------------------------------

!exp por TalkActions

 

Exemplo: 19:38 Level 8 requires 4200 experience to achieve.

 

 

expcalculator.lua

function onSay(cid, words, param)
-- Made by [b]Xikez[/b]
   local futurelevel = getPlayerLevel(cid) + 1
   local lv = getPlayerLevel(cid)

   if lv > 1 then
 equation = (50 * (lv) * (lv) * (lv) - 150 * (lv) * (lv) + 400 * (lv)) / 3
 msg = "Level ".. futurelevel .." requires ".. equation .." experience to achieve."
   else
 msg = "Level 2 requires 100 experience to achieve."
   end
   doPlayerSendTextMessage(cid, 24, msg)
   doPlayerSendTextMessage(cid, 25, words)
   return 0    
end

 

talkactions.xml

<talkaction words="!exp" script="expcalculator.lua" />

 

--------------------------------------------------------

!pos por TalkActions

 

Exemplo: 19:38 X: [260] Y: [643] Z: [7]

 

 

getpos.lua

function onSay(cid, words, param)
-- Made By [b]Xikez[/b]

   local pos = getPlayerPosition(cid)
   local access = getPlayerAccess(cid)
   if access >= 3 then
 doPlayerSendTextMessage(cid, 24, "X: [".. pos.x .."] Y: [".. pos.y .."] Z: [".. pos.z .."]")
 doPlayerSendTextMessage(cid, 25, words)
 doTeleportThing(cid, newpos)
 return 0
   end
   return 1
end

 

talkactions.xml

<talkaction words="!pos" script="getpos.lua" />

 

--------------------------------------------------------

!online

 

Exemplo:

19:38 There is currently 38 players online.

19:38 There is currently 2618 creatures spawned.

19:38 There is currently 68 NPCs online.

19:38 Overall, There is only 2724 creatures, npcs, and players online

 

 

getonline.lua

function onSay(cid, words, param)

   local players = getWorldCreatures(0)
   local creatures = getWorldCreatures(1)
   local npcs = getWorldCreatures(2) 
   local all = getWorldCreatures(3)

   if players > 1 then
 playersmsg = "There is currently ".. players .." players online."
   else
 playersmsg = "You are the only player online."    
   end
   if creatures > 1 then
 creaturesmsg = "There is currently ".. creatures .." creatures spawned."
   elseif creatures == 1 then
 creaturesmsg = "There is currently 1 creature spawned."
   else
 creaturesmsg = "There are no creatures spawned."
   end
   if npcs > 1 then
 npcsmsg = "There is currently ".. npcs .." NPCs online."
   elseif npcs == 1 then
 npcsmsg = "There is currently only 1 NPC online."
   else
 npcsmsg = "There is no NPCs online."
   end
   if all > 1 then
 allmsg = "Overall, There is only ".. all .." creatures, npcs, and players online."
   else
 allmsg = "Overall, You are the only player online. No creatures, NPCs or any other players."
   end

   doPlayerSendTextMessage(cid, 24, playersmsg)
   doPlayerSendTextMessage(cid, 24, creaturesmsg)
   doPlayerSendTextMessage(cid, 24, npcsmsg)
   doPlayerSendTextMessage(cid, 24, allmsg)
   doPlayerSendTextMessage(cid, 25, words)
   return 0    
end

 

talkactions.xml

<talkaction words="!online" script="getonline.lua" />

 

--------------------------------------------------------

!uptime

 

Exemplo: The server has been online for 1 month, 4 days, 21 hours, 32 minutes, and 5 seconds.

 

 

uptime.lua

function onSay(cid, words, param)
-- Made By [b]Xikez[/b]

   local uptime = getWorldUpTime()
   local second = 0
   local minute = 0
   local hour = 0
   local day = 0
   local month = 0
   local monthstarted = 0
   local daystarted = 0
   local hourstarted = 0
   local minutestarted = 0
   local monthmsg = ""
   local daymsg = ""
   local hourmsg = ""
   local minutemsg = ""
   local secondmsg = ""

   --- Count Time
 while uptime >= 2592000 do
     month = month + 1
     uptime = uptime - 2592000
 end
 while uptime >= 86400 do
     day = day + 1
     uptime = uptime - 86400
 end
 while uptime >= 3600 do
     hour = hour + 1
     uptime = uptime - 3600
 end
 while uptime >= 60 do
     minute = minute + 1
     uptime = uptime - 60
 end
 while uptime >= 1 do
     second = second + 1
     uptime = uptime - 1
 end
   -- Stop Counting.
   -- Create Msg.
 if month ~= 0 then
     if month > 1 then
   monthmsg = "".. month .." months"
     elseif month == 1 then
   monthmsg = "1 month"
     end
     if month ~= 1 then
   monthmsg = "".. monthmsg .. "s"
     end    
     monthstarted = 1
 end    

 if day ~= 0 then    
     if monthstarted > 0 then
   daymsg = ", ".. day .." day"
     else
   daymsg = "".. day .." day"
     end    
     if day ~= 1 then
   daymsg = "".. daymsg .. "s"
     end    
     daystarted = 1  
 end

 if hour ~= 0 then
     if daystarted > 0 or monthstarted > 0 then
   hourmsg = ", ".. hour .." hour"
     else
   hourmsg = "".. hour .." hour"  
     end  
     if hour ~= 1 then
   hourmsg = "".. hourmsg .. "s"
     end    
     hourstarted = 1
 end

 if minute ~= 0 then
     if hourstarted > 0 or daystarted > 0 or monthstarted > 0 then
   minutemsg = ", ".. minute .." minute"  
     else
   minutemsg = "".. minute .." minute"
     end
     if minute ~= 1 then
   minutemsg = "".. minutemsg .. "s"
     end    
     minutestarted = 1  
 end

 if second > 1 then
     if minutestarted > 0 or hourstarted > 0 or daystarted > 0 or monthstarted > 0 then
   secondmsg = ", and ".. second .." second"
     else
   secondmsg = "".. second .." second"
     end    
     if second ~= 1 then
   secondmsg = "".. secondmsg .. "s"
     end    
 end
   -- Send msg to player.
   doPlayerSendTextMessage(cid, 24, "This server has been online for ".. monthmsg .."".. daymsg .."".. hourmsg .."".. minutemsg .."".. secondmsg ..".")
   -- send !uptime to player so it seems as if its a command
   doPlayerSendTextMessage(cid, 25, words)
   return uptime
end

 

talkactions.xml

<talkaction words="!uptime" script="uptime.lua" />

 

--------------------------------------------------------

!pvp

 

Exemplo: World-Type is currently set to PVP-Enforced.

 

 

getworldtype.lua

function onSay(cid, words, param)
-- Made By [b]Xikez[/b]
   local worldtype = getWorldType()
   local pvpmsg = ""

   if worldtype == 1 then
 pvpmsg = "Non-PVP"
   elseif worldtype == 2 then
 pvpmsg = "PVP"
   elseif worldtype == 3 then
 pvpmsg = "PVP-Enforced"
   else
 return 1
   end

   doPlayerSendTextMessage(cid, 24, "World-Type is currently set to ".. pvpmsg ..".")
   doPlayerSendTextMessage(cid, 25, words)
   return 0    
end

 

talkactions.xml

<talkaction words="!pvp" script="getworldtype.lua" />

 

--------------------------------------------------------

!buyhouse

 

Nota: O preço da casa é igual para todos, esse comando não checa o tamanho da casa.

 

 

buyhouse.lua

function onSay(cid, words, param)
-- Made By [b]Xikez[/b]


   --/////////         Things to Edit             //////////
   local numberOfHouse = 91 -- How many houses does your server have? Tip: You can use the map editor for this.
   local money = 50000 -- Cost of 1 house.
   local canOwnHouse = 2 -- How many houses can a  player buy?
   --/////////////////////////////////////////

   local pos = getPlayerPosition(cid)
   local hasCheckedLeft = 0
   local hasCheckedRight = 0
   local hasCheckedUp = 0
   local hasCheckedDown = 0
   local msgto = ""
   local houseId = 0
   local hasHouse = getPlayerPosition(cid)
   local checkedHowMany = 0
   local ownsHouse = 0
   local housePosFirst = 0
   local newOwner = getPlayerGUID(cid)

   housePosFirst = {x=getPlayerPosition(cid).x-1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
   if getTileHouseInfo(housePosFirst) ~= 0 then
   hasCheckedLeft = getTileHouseInfo(housePosFirst)
   end
   housePosFirst = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
   if getTileHouseInfo(housePosFirst) ~= 0 then
   hasCheckedRight = getTileHouseInfo(housePosFirst)
   end
   housePosFirst = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y+1, z=getPlayerPosition(cid).z}
   if getTileHouseInfo(housePosFirst) ~= 0 then
   hasCheckedDown = getTileHouseInfo(housePosFirst)
   end
   housePosFirst = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y-1, z=getPlayerPosition(cid).z}
   if getTileHouseInfo(housePosFirst) ~= 0 then
   hasCheckedUp = getTileHouseInfo(housePosFirst)
   end

   if hasCheckedUp ~= 0 or hasCheckedDown ~= 0 or hasCheckedRight ~= 0 or hasCheckedLeft ~= 0 then
 if hasCheckedUp ~= 0 then
     houseId = hasCheckedUp
 elseif hasCheckedDown ~= 0 then
     houseId = hasCheckedDown
 elseif hasCheckedRight ~= 0 then
     houseId = hasCheckedRight    
 elseif hasCheckedLeft ~= 0 then
     houseId = hasCheckedLeft
 end
 if getHouseOwner(houseId) ~= 0 then
     if getHouseOwner(houseId) == newOwner then
   msgto = "You already own this house."
     else
   msgto = "The house already has a owner."
     end
 else

 while checkedHowMany < numberOfHouse do
     checkedHowMany = checkedHowMany + 1
     if getHouseOwner(checkedHowMany) == newOwner then
   ownsHouse = ownsHouse + 1
     end
 end    
 if ownsHouse < canOwnHouse then
 --TODO: Count how much money to be paid, it cannot be accurate though.
     if doPlayerRemoveMoney(cid, money) == 1 then
   setHouseOwner(houseId, newOwner)
   msgto = "Congratz! You are now the owner of the house."
     else
   msgto = "You don\'t have enough money"
     end    
 else
     msgto = "You can\'t buy more houses."
 end    
 --
 end    
   else
 msgto = "There is no house around you. Make sure you are facing the house door."
   end


   doPlayerSendTextMessage(cid, 24, msgto)
   doPlayerSendTextMessage(cid, 25, words)
   return 0    
end

 

talkactions.xml

<talkaction words="!buyhouse" script="buyhouse.lua" />

 

--------------------------------------------------------

!leavehouse

 

leavehouse.lua

function onSay(cid, words, param)
-- Made By [b]Xikez[/b]
--setHouseOwner
   local pos = getPlayerPosition(cid)
   local claimsOwner = getPlayerGUID(cid)
   local isHouse = getTileHouseInfo(pos)
   local houseOwner = 0
   local msgto = ""
   local none = 0
   local moneyRewarded = 10000
   local itemsToDepot = "If you had any items in your house, they have been sent to depot."

 if isHouse ~= 0 then
     houseOwner = getHouseOwner(isHouse)
     if houseOwner == claimsOwner then
   setHouseOwner(isHouse, none)
   msgto = "You have left your house."
   doPlayerSendTextMessage(cid, 24, itemsToDepot)
   addMoney(cid, moneyRewarded)
     else
   msgto = "You are not the owner."
     end  
 else
     msgto = "You are not inside a house."
 end

 doPlayerSendTextMessage(cid, 24, msgto)
 doPlayerSendTextMessage(cid, 25, words)

   return 0    
end

function addMoney(cid, money)
-- Made by Ispiro
   local gpsrewarded = money
   local crystalcoins = 0
   local platinumcoins = 0
   local goldcoins = 0    

 while gpsrewarded >= 10000 do -- Count how many crystal coins should be rewarded
 crystalcoins = crystalcoins + 1 -- Set the number of crystal coins to be rewarded
 gpsrewarded = gpsrewarded - 10000 -- lower the number of gps left to be rewarded.
 end
 while gpsrewarded >= 100 do -- Count how many platinum coins should be rewarded
 platinumcoins = platinumcoins + 1 -- Set the number of platinum coins to be rewarded
 gpsrewarded = gpsrewarded - 100 -- lower the number of gps left to be rewarded.
 end
 while gpsrewarded >= 1 do -- Count how many gold coins should be rewarded
 goldcoins = goldcoins + 1 -- Set the number of gold coins to be rewarded
 gpsrewarded = gpsrewarded - 1 -- lower the number of gps left to be rewarded.
 end

 doPlayerAddItem(cid, 2148, goldcoins) -- give the player the gold coins
 doPlayerAddItem(cid, 2152, platinumcoins) -- give the player the platinum coins
 doPlayerAddItem(cid, 2160, crystalcoins) -- give the player the crystal coins
end

 

talkactions.xml

<talkaction words="!leavehouse" script="leavehouse.lua" />

Compartilhar este post


Link para o post
Dark    3
Dark

Aprovado

 

Movido

(Scripting DownloadsActions e Talkactions)

Compartilhar este post


Link para o post
medel    0
medel

Legal esses comandos por Talkactions, Testado e aprovado!

\FuiZz

Compartilhar este post


Link para o post
Addicted    1
Addicted

Legal d+ :D

Compartilhar este post


Link para o post
GOD Sero    0
GOD Sero

massinha i ####

Compartilhar este post


Link para o post
Dark    3
Dark

@ GOD Sero

 

Já vi varios posts seus com flood, se eu pegar você fazendo flood mais uma vez você será Alertado. Está avisado

Compartilhar este post


Link para o post
plomentes    0
plomentes

Cara parabéns haha tem umas ae que normalmente ja vem no OT mais tdo bem tenta criar talkactions mais criativas seila para fika umas 2 oras pensando hehhehehe vo te doar 1 OT$ pelas talkactions =P

Compartilhar este post


Link para o post
pcnaddeo    0
pcnaddeo

hehe obrigado pelos elogios e criticas mesmo tendo poucos ^^

Compartilhar este post


Link para o post
Zugo    0
Zugo

muito bom!!! concerteza seram muito util, a !online com tanta informaçao ta rox ;D

Compartilhar este post


Link para o post
henrique_ms    0
henrique_ms

vlw ^^

 

turinandglaurungwf7.jpg

Compartilhar este post


Link para o post
Drop    0
Drop

a maioria ja vem com eses comando não todos mas vem =P

gostei do getonline que foi bem util ^^

soq não gostei de !pos acho que é meio inutil ... seria melhor se mostrase a cidade, para onde fika o dp, templo , barco etc

ex: Você esta na cidade [nome da cidade] O templo esta para [posição do templo (leste oeste etc)] , o DP esta para [posição do dp (leste oeste, etc)] o barco esta para [posiçaõ do barco em oeste, lest etc]

Compartilhar este post


Link para o post
Nord    2
Nord

Parabéns, nunca tinha visto tanta talkaction na minha vida.

 

!online - Bem melhor que nos OTs, mostra a quantidade junto.

Compartilhar este post


Link para o post
HeberPcL    3
HeberPcL

Parabens, Muito bom!!

 

=p

Compartilhar este post


Link para o post
grandeyang    0
grandeyang

Tava passeando pelo fórum e sem querer mesmo achei este tópico com o que eu queria!

 

!buyhouse e !sellhouse

 

Porque quero por premmy sem ser free no meu OT só que quero que free acc possa comprar casa ^^' daí usarei seu script só com o nome modificado pois já tem na source :P

 

E meus sinceros parabéns pela contribuição, tudo que não tem na source é interessante por no OT.

Compartilhar este post


Link para o post
Sweat Survivor    0
Sweat Survivor

Gosteo Lek Continie Assim

Compartilhar este post


Link para o post
skyline3005    0
skyline3005

Legal, mas esses comands quase sempre vem nos ots já.

 

~See ya!

Compartilhar este post


Link para o post
Sweat Survivor    0
Sweat Survivor

gostei vlw aprovado

Compartilhar este post


Link para o post
Sweat Survivor    0
Sweat Survivor

so nao intendi muito a da expe x.x

Compartilhar este post


Link para o post
Elys Zarox    0
Elys Zarox

=] legal mais tem algumas que ja vem na maioria dos ots

Compartilhar este post


Link para o post
GM_Elnight    0
GM_Elnight

parabens kra,fico muito bem esplicado.

mas acho que augumas dessas talkactions são inuteis,pq a maioria ja vem com o ot pronto e o resto´é inutil...

mas vlw o esforço por criar talkactions mais criativas...

Compartilhar este post


Link para o post
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×