[Talkaction] Comando Attr

lucasatak
em Actions e Talkactions

lucasatak

Egoísmo?... Nunca!
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 07/05/08Posts: 120

Vi muitos pedidos e duvidas sobre o comando attr.

 

um dia tava rodando a net e achei um script ai,que faz todas funçoes do attr e mais algumas,

só que todos sabem que em ot nao vem esse script do attr,e agora eu trouxe aqui.

 

porque ele nao liga a nenhum script no caso {<talkaction log="yes" words="/attr" access="5" function="changeThingProporties"/>}

 

agora,vamos ao script:

 

em data/talkactions/scripts copie qualquer arquivo renomeio para attr e cole isto:

 

local itemFuncs =

{

["attackspeed"] = setItemAttackSpeed,

["name"] = setItemName,

["plural"] = setItemPluralName,

["attack"] = setItemAttack,

["extraattack"] = setItemExtraAttack,

["defense"] = setItemDefense,

["armor"] = setItemArmor,

["extradefense"] = setItemExtraDefense,

["hitchance"] = setItemHitChance,

["range"] = setItemShootRange,

["actionid"] = doSetItemActionId,

["action"] = doSetItemActionId,

["aid"] = doSetItemActionId,

["description"] = doSetItemSpecialDescription,

["desc"] = doSetItemSpecialDescription,

["protection"] = doSetItemProtection,

["charges"] = doChangeTypeItem,

["count"] = doChangeTypeItem

}

 

local creatureFuncs =

{

["health"] = doCreatureAddHealth,

["maxhealth"]= setCreatureMaxHealth,

["mana"] = doCreatureAddMana,

["maxmana"] = setCreatureMaxMana,

["speed"] = doChangeSpeed,

["droploot"] = doCreatureSetDropLoot,

["cannotmove"] = doCreatureSetNoMove,

["skull"] = doCreatureSetSkullType,

["redskull"] = doPlayerSetRedSkullTicks

}

 

local playerFuncs =

{

["fyi"] = doPlayerPopupFYI,

["tutorial"] = doPlayerSendTutorial,

["guildrank"] = doPlayerSetGuildRank,

["guildnick"] = doPlayerSetGuildNick,

["group"] = doPlayerSetGroupId,

["vocation"] = doPlayerSetVocation,

["promotion"] = setPlayerPromotionLevel,

["stamina"] = doPlayerAddStamina,

["town"] = doPlayerSetTown,

["balance"] = doPlayerDepositMoney

}

 

 

function onSay(cid, words, param, channel)

if(param == "") then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")

return TRUE

end

 

local pos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z, stackpos=1}

if getCreatureLookDirection(cid) == SOUTH then

pos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z, stackpos=255}

elseif getCreatureLookDirection(cid) == NORTH then

pos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z, stackpos=255}

elseif getCreatureLookDirection(cid) == EAST then

pos = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z, stackpos=255}

elseif getCreatureLookDirection(cid) == WEST then

pos = {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z, stackpos=255}

end

 

local t = string.explode(param, ",")

 

 

local getThing = getThingFromPos(pos)

 

if itemFuncs[t[1]] then

if getThing.itemid > 0 then

if itemFuncs[t[1]](getThing.uid, t[2]) then

doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)

return TRUE

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this item.")

return TRUE

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item not found.")

return TRUE

end

elseif creatureFuncs[t[1]] then

if isCreature(getThing.uid) then

if creatureFuncs[t[1]](getThing.uid, t[2]) then

doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)

return TRUE

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this creature.")

return TRUE

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")

return TRUE

end

elseif playerFuncs[t[1]] then

if isPlayer(getThing.uid) then

if playerFuncs[t[1]](getThing.uid, t[2]) then

doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)

return TRUE

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this player.")

return TRUE

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.")

return TRUE

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unknow attribute.")

return TRUE

end

return TRUE

end

 

em talkactions.xml cole isto:

 

<talkaction log="yes" access="5" words="/attr" script="attr.lua"/>

 

acho que é isso,qualquer erro edito depois,bom uso.

 

OBS:NAO ENCONTREI NO FORUM!

 

creditos Otal.

porco.gif

 

 

voltando aos poucos.

 

 

hsb.gif

 

É CAMPEÃO CARIOCA 2010 PORRA !

capeta22

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/05/10Posts: 7Char no Tibia: 198

mano coloquei aqui e nao funciono.

mesmo assim vlw por te postado ela.

duda611

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/08/09Posts: 18

Bom, aqui foi tranquilo... mas se não for pedir muito, coloca as funçoes listadas e o que elas fazem, porque algumas eu não encontrei o que queria.

 

@Edited...

 

Tem de Retirar o comando antigo do talkaction.xml, pois se não fica repetido e não vai pegar mesmo.

dudadeecsaro.jpg

 

Cronus OT (COT) = http://cronusotserv.no-ip.org:8090/

 

 

952581.png

Osama11

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 21/01/12Posts: 20Char no Tibia: Osama

ae mano como funciona esse negocio ae.. tipo fiz tudo certo i tall's ai fui no ot e escrevi /attr attackspeed 10 e apareceu isso aq Following action was invalid: attackspeed, () alguem ajuda eu ae :D

SkyLigh

User X
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 23/07/12Posts: 2183Char no Tibia: Kissy

Este script ja vem em todos os servidores acho que nao e necessário este tópico

 

@FECHADO

Att,
Kissy

Rasinsk

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/10/12Posts: 58

O script é bom mas pq será q não funciona 100% na maioria das vezes? =/

Lendreo

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 22/07/12Posts: 298Char no Tibia: Lendreo

Ai é com vc, eu n testei aki, se o script não funciona manda uma msg pro proprietário [ se ele aidna é ativo ].