Histórico de Curtidas
-
MauroelBrizola recebeu reputação de higorsantos em (Resolvido)[PEDIDO] MUSIC BOX [MONTARIAS] TFS 1.0Esta ai... adaptei o script postado para funcionar como Music Box, doma todos os que estão configurados.
Se precisar de ajuda para configurar alguma outra mount ( O script suporta domar itens, monstros e até NPCs... ) só pedir.
No arquivo actions.xml adicione a seguinte tag:
<action itemid="18511" script="musicbox.lua"/> Crie o arquivo musicbox.lua em otserver/data/actions/scripts e coloque nele:
local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4 local TYPE_MONSTER, TYPE_NPC, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4 local config = { ["Gnarlhound"] = {NAME = 'Gnarlhound', ID = 32, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The gnarlhound ran away."}, {2, "Oh no! The golem Wrench broke."}, {3, "The gnarlhound has fled."} }, SUCCESS_MSG = "You have tamed the gnarlhound."}, ["Magma Crawler"] = {NAME = 'Magma Crawler', ID = 30, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The magma crawler ran away."}, {2, "Oh no! The glow wine broke."}, {3, "The magma crawler has fled."} }, SUCCESS_MSG = "You have tamed the magma crawler."}, ["Dragonling"] = {NAME = 'Dragonling', ID = 31, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The dragonling ran away."}, {2, "Oh no! The decorative ribbon broke."}, {3, "The dragonling has fled."} }, SUCCESS_MSG = "You have tamed the dragonling."}, ["Ironblight"] = {NAME = 'Ironblight', ID = 29, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ironblight ran away."}, {2, "Oh no! iron loadstone broke."}, {3, "The ironblight has fled."} }, SUCCESS_MSG = "You have tamed the ironblight."}, ["Shock Head"] = {NAME = 'Shock Head', ID = 42, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The shock head ran away."}, {2, "Oh no! The nightmare horn broke."}, {3, "The shock head has fled."} }, SUCCESS_MSG = "You have tamed the shock head."}, ["Bear"] = {NAME = 'Bear', ID = 3, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bear ran away."}, {2, "Oh no! The slingshot broke."}, {3, "The bear is trying to hit you with its claws."} }, SUCCESS_MSG = "You have tamed the bear."}, ["Black Sheep"] = {NAME = 'Black Sheep', ID = 4, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The black sheep ran away."}, {2, "Oh no! The reins were torn."}, {3, "The black sheep is trying to run away."} }, SUCCESS_MSG = "You have tamed the sheep."}, ["Midnight Panther"] = {NAME = 'Midnight Panther', ID = 5, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The panther has escaped."}, {2, "The whip broke."} }, SUCCESS_MSG = "You have tamed the panther."}, ["Terror Bird"] = {NAME = 'Terror Bird', ID = 2, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bird ran away."}, {3, "The terror bird is pecking you."} }, SUCCESS_MSG = "You have tamed the bird."}, ["Boar"] = {NAME = 'Boar', ID = 10, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The boar has run away"}, {3, "The boar attacks you."} }, SUCCESS_MSG = "You have tamed the boar."}, ["Crustacea Gigantica"] = {NAME = 'Crustacea Gigantica', ID = 7, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The crustacea has run away."}, {2, "The crustacea ate the shrimp."} }, SUCCESS_MSG = "You have tamed the crustacea."}, ["Undead Cavebear"] = {NAME = 'Undead Cavebear', ID = 12, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The undead bear has run away."} }, SUCCESS_MSG = "You have tamed the skeleton."}, ["Wailing Widow"] = {NAME = 'Wailing Widow', ID = 1, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The widow has run away."}, {2, "The widow has eaten the sweet bait."} }, SUCCESS_MSG = "You have tamed the widow."}, ["inoperative tin lizzard"] = {NAME = 'inoperative tin lizzard', ID = 8, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The key broke inside."} }, SUCCESS_MSG = "You have started the Tin Lizzard!"}, ["Draptor"] = {NAME = 'Draptor', ID = 6, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The draptor has run away."}, {3, "The draptor has fled."} }, SUCCESS_MSG = "You have tamed the draptor."}, ["Crystal Wolf"] = {NAME = 'Crystal Wolf', ID = 16, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The wolf has run away."} }, SUCCESS_MSG = "You have tamed the wolf."}, ["Enraged White Deer"] = {NAME = 'Enraged White Deer', ID = 18, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {2, "The cone broke."}, {3, "The deer has fled in fear."} }, SUCCESS_MSG = "You have tamed the deer."}, ["Panda"] = {NAME = 'Panda', ID = 19, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {4, "Panda ate the leaves and ran away."} }, SUCCESS_MSG = "You have tamed the panda."}, ["Dromedary"] = {NAME = 'Dromedary', ID = 20, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "Dromedary has run away."} }, SUCCESS_MSG = "You have tamed the dromedary."}, ["Sandstone Scorpion"] = {NAME = 'Sandstone Scorpion', ID = 21, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The scorpion has vanished."}, {2, "Scorpion broken the sceptre."} }, SUCCESS_MSG = "You have tamed the scorpion"}, ["Donkey"] = {NAME = 'Donkey', ID = 13, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The witch has escaped!"} }, SUCCESS_MSG = "You have tamed the mule."}, ["inoperative uniwheel"] = {NAME = 'inoperative uniwheel', ID = 15, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The oil is having no effect."} }, SUCCESS_MSG = "You have found an Uniwheel."}, ["Slug"] = {NAME = 'Slug', ID = 14, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The slug has run away."}, {3, "The drug had no effect."} }, SUCCESS_MSG = "You have tamed the slug."}, ["Wild Horse"] = {NAME = 'Wild Horse', ID = 17, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The horse runs away."}, {2, "The horse ate the oats."} }, SUCCESS_MSG = "You have tamed the horse."}, ["Manta Ray"] = {NAME = 'Manta Ray', ID = 28, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The manta ray fled."}, {3, "The manta ray is trying to escape."} }, SUCCESS_MSG = "You have tamed the manta ray."}, ["Lady Bug"] = {NAME = 'Lady Bug', ID = 27, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ladybug got scared and ran away."}, {3, "The ladybug is trying to nibble."} }, SUCCESS_MSG = "You tame a ladybug."}, ["Water Buffalo"] = {NAME = 'Water Buffalo', ID = 35, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The water buffalo got scared and ran away."}, {3, "The water buffalo is trying to nibble."} }, SUCCESS_MSG = "You tamed a water buffalo."} } local function doFailAction(cid, mount, pos, item, itemEx) local action, effect = mount.FAIL_MSG[math.random(1, table.maxn(mount.FAIL_MSG))], CONST_ME_POFF if(action[1] == ACTION_RUN) then Creature(itemEx.uid):remove() elseif(action[1] == ACTION_BREAK) then effect = CONST_ME_BLOCKHIT Item(item.uid):remove(1) elseif(action[1] == ACTION_ALL) then Creature(itemEx.uid):remove() Item(item.uid):remove(1) end Position(pos):sendMagicEffect(effect) Player(cid):say(action[2], TALKTYPE_ORANGE_1) return action end function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if not Monster(itemEx.uid) then return true end local monster = Monster(itemEx.uid) local npc = Npc(itemEx.uid) local targetitem = Item(itemEx.uid) local mount = config[monster:getName()] if mount == nil then return false end if player:hasMount(mount.ID) then player:say("You already own this mount!", TALKTYPE_ORANGE_1) return false end local rand = math.random(1, 100) --Monster Mount if monster ~= nil and mount.TYPE == TYPE_MONSTER then if Creature(itemEx.uid):getMaster() then player:say("You cant tame a summon!", TALKTYPE_ORANGE_1) return true end if mount.NAME == monster:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) monster:remove() toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true else toPosition:sendMagicEffect(CONST_ME_POFF) end --NPC Mount elseif npc ~= nil and mount.TYPE == TYPE_NPC then if mount.NAME == npc:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Item Mount elseif targetitem ~= nil and mount.TYPE == TYPE_ITEM then if mount.NAME == targetitem:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Action Mount elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then if(mount.NAME == itemEx.actionid) then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Unique Mount elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then if mount.NAME == itemEx.uid then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end end return false end -
MauroelBrizola recebeu reputação de chriscarp em (Resolvido)[PEDIDO] MUSIC BOX [MONTARIAS] TFS 1.0Esta ai... adaptei o script postado para funcionar como Music Box, doma todos os que estão configurados.
Se precisar de ajuda para configurar alguma outra mount ( O script suporta domar itens, monstros e até NPCs... ) só pedir.
No arquivo actions.xml adicione a seguinte tag:
<action itemid="18511" script="musicbox.lua"/> Crie o arquivo musicbox.lua em otserver/data/actions/scripts e coloque nele:
local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4 local TYPE_MONSTER, TYPE_NPC, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4 local config = { ["Gnarlhound"] = {NAME = 'Gnarlhound', ID = 32, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The gnarlhound ran away."}, {2, "Oh no! The golem Wrench broke."}, {3, "The gnarlhound has fled."} }, SUCCESS_MSG = "You have tamed the gnarlhound."}, ["Magma Crawler"] = {NAME = 'Magma Crawler', ID = 30, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The magma crawler ran away."}, {2, "Oh no! The glow wine broke."}, {3, "The magma crawler has fled."} }, SUCCESS_MSG = "You have tamed the magma crawler."}, ["Dragonling"] = {NAME = 'Dragonling', ID = 31, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The dragonling ran away."}, {2, "Oh no! The decorative ribbon broke."}, {3, "The dragonling has fled."} }, SUCCESS_MSG = "You have tamed the dragonling."}, ["Ironblight"] = {NAME = 'Ironblight', ID = 29, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ironblight ran away."}, {2, "Oh no! iron loadstone broke."}, {3, "The ironblight has fled."} }, SUCCESS_MSG = "You have tamed the ironblight."}, ["Shock Head"] = {NAME = 'Shock Head', ID = 42, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The shock head ran away."}, {2, "Oh no! The nightmare horn broke."}, {3, "The shock head has fled."} }, SUCCESS_MSG = "You have tamed the shock head."}, ["Bear"] = {NAME = 'Bear', ID = 3, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bear ran away."}, {2, "Oh no! The slingshot broke."}, {3, "The bear is trying to hit you with its claws."} }, SUCCESS_MSG = "You have tamed the bear."}, ["Black Sheep"] = {NAME = 'Black Sheep', ID = 4, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The black sheep ran away."}, {2, "Oh no! The reins were torn."}, {3, "The black sheep is trying to run away."} }, SUCCESS_MSG = "You have tamed the sheep."}, ["Midnight Panther"] = {NAME = 'Midnight Panther', ID = 5, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The panther has escaped."}, {2, "The whip broke."} }, SUCCESS_MSG = "You have tamed the panther."}, ["Terror Bird"] = {NAME = 'Terror Bird', ID = 2, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bird ran away."}, {3, "The terror bird is pecking you."} }, SUCCESS_MSG = "You have tamed the bird."}, ["Boar"] = {NAME = 'Boar', ID = 10, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The boar has run away"}, {3, "The boar attacks you."} }, SUCCESS_MSG = "You have tamed the boar."}, ["Crustacea Gigantica"] = {NAME = 'Crustacea Gigantica', ID = 7, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The crustacea has run away."}, {2, "The crustacea ate the shrimp."} }, SUCCESS_MSG = "You have tamed the crustacea."}, ["Undead Cavebear"] = {NAME = 'Undead Cavebear', ID = 12, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The undead bear has run away."} }, SUCCESS_MSG = "You have tamed the skeleton."}, ["Wailing Widow"] = {NAME = 'Wailing Widow', ID = 1, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The widow has run away."}, {2, "The widow has eaten the sweet bait."} }, SUCCESS_MSG = "You have tamed the widow."}, ["inoperative tin lizzard"] = {NAME = 'inoperative tin lizzard', ID = 8, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The key broke inside."} }, SUCCESS_MSG = "You have started the Tin Lizzard!"}, ["Draptor"] = {NAME = 'Draptor', ID = 6, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The draptor has run away."}, {3, "The draptor has fled."} }, SUCCESS_MSG = "You have tamed the draptor."}, ["Crystal Wolf"] = {NAME = 'Crystal Wolf', ID = 16, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The wolf has run away."} }, SUCCESS_MSG = "You have tamed the wolf."}, ["Enraged White Deer"] = {NAME = 'Enraged White Deer', ID = 18, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {2, "The cone broke."}, {3, "The deer has fled in fear."} }, SUCCESS_MSG = "You have tamed the deer."}, ["Panda"] = {NAME = 'Panda', ID = 19, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {4, "Panda ate the leaves and ran away."} }, SUCCESS_MSG = "You have tamed the panda."}, ["Dromedary"] = {NAME = 'Dromedary', ID = 20, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "Dromedary has run away."} }, SUCCESS_MSG = "You have tamed the dromedary."}, ["Sandstone Scorpion"] = {NAME = 'Sandstone Scorpion', ID = 21, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The scorpion has vanished."}, {2, "Scorpion broken the sceptre."} }, SUCCESS_MSG = "You have tamed the scorpion"}, ["Donkey"] = {NAME = 'Donkey', ID = 13, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The witch has escaped!"} }, SUCCESS_MSG = "You have tamed the mule."}, ["inoperative uniwheel"] = {NAME = 'inoperative uniwheel', ID = 15, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The oil is having no effect."} }, SUCCESS_MSG = "You have found an Uniwheel."}, ["Slug"] = {NAME = 'Slug', ID = 14, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The slug has run away."}, {3, "The drug had no effect."} }, SUCCESS_MSG = "You have tamed the slug."}, ["Wild Horse"] = {NAME = 'Wild Horse', ID = 17, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The horse runs away."}, {2, "The horse ate the oats."} }, SUCCESS_MSG = "You have tamed the horse."}, ["Manta Ray"] = {NAME = 'Manta Ray', ID = 28, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The manta ray fled."}, {3, "The manta ray is trying to escape."} }, SUCCESS_MSG = "You have tamed the manta ray."}, ["Lady Bug"] = {NAME = 'Lady Bug', ID = 27, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ladybug got scared and ran away."}, {3, "The ladybug is trying to nibble."} }, SUCCESS_MSG = "You tame a ladybug."}, ["Water Buffalo"] = {NAME = 'Water Buffalo', ID = 35, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The water buffalo got scared and ran away."}, {3, "The water buffalo is trying to nibble."} }, SUCCESS_MSG = "You tamed a water buffalo."} } local function doFailAction(cid, mount, pos, item, itemEx) local action, effect = mount.FAIL_MSG[math.random(1, table.maxn(mount.FAIL_MSG))], CONST_ME_POFF if(action[1] == ACTION_RUN) then Creature(itemEx.uid):remove() elseif(action[1] == ACTION_BREAK) then effect = CONST_ME_BLOCKHIT Item(item.uid):remove(1) elseif(action[1] == ACTION_ALL) then Creature(itemEx.uid):remove() Item(item.uid):remove(1) end Position(pos):sendMagicEffect(effect) Player(cid):say(action[2], TALKTYPE_ORANGE_1) return action end function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if not Monster(itemEx.uid) then return true end local monster = Monster(itemEx.uid) local npc = Npc(itemEx.uid) local targetitem = Item(itemEx.uid) local mount = config[monster:getName()] if mount == nil then return false end if player:hasMount(mount.ID) then player:say("You already own this mount!", TALKTYPE_ORANGE_1) return false end local rand = math.random(1, 100) --Monster Mount if monster ~= nil and mount.TYPE == TYPE_MONSTER then if Creature(itemEx.uid):getMaster() then player:say("You cant tame a summon!", TALKTYPE_ORANGE_1) return true end if mount.NAME == monster:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) monster:remove() toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true else toPosition:sendMagicEffect(CONST_ME_POFF) end --NPC Mount elseif npc ~= nil and mount.TYPE == TYPE_NPC then if mount.NAME == npc:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Item Mount elseif targetitem ~= nil and mount.TYPE == TYPE_ITEM then if mount.NAME == targetitem:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Action Mount elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then if(mount.NAME == itemEx.actionid) then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Unique Mount elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then if mount.NAME == itemEx.uid then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end end return false end -
MauroelBrizola recebeu reputação de VitorNM em (Resolvido)[PEDIDO] MUSIC BOX [MONTARIAS] TFS 1.0Esta ai... adaptei o script postado para funcionar como Music Box, doma todos os que estão configurados.
Se precisar de ajuda para configurar alguma outra mount ( O script suporta domar itens, monstros e até NPCs... ) só pedir.
No arquivo actions.xml adicione a seguinte tag:
<action itemid="18511" script="musicbox.lua"/> Crie o arquivo musicbox.lua em otserver/data/actions/scripts e coloque nele:
local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4 local TYPE_MONSTER, TYPE_NPC, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4 local config = { ["Gnarlhound"] = {NAME = 'Gnarlhound', ID = 32, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The gnarlhound ran away."}, {2, "Oh no! The golem Wrench broke."}, {3, "The gnarlhound has fled."} }, SUCCESS_MSG = "You have tamed the gnarlhound."}, ["Magma Crawler"] = {NAME = 'Magma Crawler', ID = 30, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The magma crawler ran away."}, {2, "Oh no! The glow wine broke."}, {3, "The magma crawler has fled."} }, SUCCESS_MSG = "You have tamed the magma crawler."}, ["Dragonling"] = {NAME = 'Dragonling', ID = 31, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The dragonling ran away."}, {2, "Oh no! The decorative ribbon broke."}, {3, "The dragonling has fled."} }, SUCCESS_MSG = "You have tamed the dragonling."}, ["Ironblight"] = {NAME = 'Ironblight', ID = 29, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ironblight ran away."}, {2, "Oh no! iron loadstone broke."}, {3, "The ironblight has fled."} }, SUCCESS_MSG = "You have tamed the ironblight."}, ["Shock Head"] = {NAME = 'Shock Head', ID = 42, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The shock head ran away."}, {2, "Oh no! The nightmare horn broke."}, {3, "The shock head has fled."} }, SUCCESS_MSG = "You have tamed the shock head."}, ["Bear"] = {NAME = 'Bear', ID = 3, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bear ran away."}, {2, "Oh no! The slingshot broke."}, {3, "The bear is trying to hit you with its claws."} }, SUCCESS_MSG = "You have tamed the bear."}, ["Black Sheep"] = {NAME = 'Black Sheep', ID = 4, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The black sheep ran away."}, {2, "Oh no! The reins were torn."}, {3, "The black sheep is trying to run away."} }, SUCCESS_MSG = "You have tamed the sheep."}, ["Midnight Panther"] = {NAME = 'Midnight Panther', ID = 5, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The panther has escaped."}, {2, "The whip broke."} }, SUCCESS_MSG = "You have tamed the panther."}, ["Terror Bird"] = {NAME = 'Terror Bird', ID = 2, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bird ran away."}, {3, "The terror bird is pecking you."} }, SUCCESS_MSG = "You have tamed the bird."}, ["Boar"] = {NAME = 'Boar', ID = 10, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The boar has run away"}, {3, "The boar attacks you."} }, SUCCESS_MSG = "You have tamed the boar."}, ["Crustacea Gigantica"] = {NAME = 'Crustacea Gigantica', ID = 7, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The crustacea has run away."}, {2, "The crustacea ate the shrimp."} }, SUCCESS_MSG = "You have tamed the crustacea."}, ["Undead Cavebear"] = {NAME = 'Undead Cavebear', ID = 12, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The undead bear has run away."} }, SUCCESS_MSG = "You have tamed the skeleton."}, ["Wailing Widow"] = {NAME = 'Wailing Widow', ID = 1, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The widow has run away."}, {2, "The widow has eaten the sweet bait."} }, SUCCESS_MSG = "You have tamed the widow."}, ["inoperative tin lizzard"] = {NAME = 'inoperative tin lizzard', ID = 8, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The key broke inside."} }, SUCCESS_MSG = "You have started the Tin Lizzard!"}, ["Draptor"] = {NAME = 'Draptor', ID = 6, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The draptor has run away."}, {3, "The draptor has fled."} }, SUCCESS_MSG = "You have tamed the draptor."}, ["Crystal Wolf"] = {NAME = 'Crystal Wolf', ID = 16, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The wolf has run away."} }, SUCCESS_MSG = "You have tamed the wolf."}, ["Enraged White Deer"] = {NAME = 'Enraged White Deer', ID = 18, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {2, "The cone broke."}, {3, "The deer has fled in fear."} }, SUCCESS_MSG = "You have tamed the deer."}, ["Panda"] = {NAME = 'Panda', ID = 19, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {4, "Panda ate the leaves and ran away."} }, SUCCESS_MSG = "You have tamed the panda."}, ["Dromedary"] = {NAME = 'Dromedary', ID = 20, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "Dromedary has run away."} }, SUCCESS_MSG = "You have tamed the dromedary."}, ["Sandstone Scorpion"] = {NAME = 'Sandstone Scorpion', ID = 21, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The scorpion has vanished."}, {2, "Scorpion broken the sceptre."} }, SUCCESS_MSG = "You have tamed the scorpion"}, ["Donkey"] = {NAME = 'Donkey', ID = 13, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The witch has escaped!"} }, SUCCESS_MSG = "You have tamed the mule."}, ["inoperative uniwheel"] = {NAME = 'inoperative uniwheel', ID = 15, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The oil is having no effect."} }, SUCCESS_MSG = "You have found an Uniwheel."}, ["Slug"] = {NAME = 'Slug', ID = 14, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The slug has run away."}, {3, "The drug had no effect."} }, SUCCESS_MSG = "You have tamed the slug."}, ["Wild Horse"] = {NAME = 'Wild Horse', ID = 17, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The horse runs away."}, {2, "The horse ate the oats."} }, SUCCESS_MSG = "You have tamed the horse."}, ["Manta Ray"] = {NAME = 'Manta Ray', ID = 28, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The manta ray fled."}, {3, "The manta ray is trying to escape."} }, SUCCESS_MSG = "You have tamed the manta ray."}, ["Lady Bug"] = {NAME = 'Lady Bug', ID = 27, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ladybug got scared and ran away."}, {3, "The ladybug is trying to nibble."} }, SUCCESS_MSG = "You tame a ladybug."}, ["Water Buffalo"] = {NAME = 'Water Buffalo', ID = 35, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The water buffalo got scared and ran away."}, {3, "The water buffalo is trying to nibble."} }, SUCCESS_MSG = "You tamed a water buffalo."} } local function doFailAction(cid, mount, pos, item, itemEx) local action, effect = mount.FAIL_MSG[math.random(1, table.maxn(mount.FAIL_MSG))], CONST_ME_POFF if(action[1] == ACTION_RUN) then Creature(itemEx.uid):remove() elseif(action[1] == ACTION_BREAK) then effect = CONST_ME_BLOCKHIT Item(item.uid):remove(1) elseif(action[1] == ACTION_ALL) then Creature(itemEx.uid):remove() Item(item.uid):remove(1) end Position(pos):sendMagicEffect(effect) Player(cid):say(action[2], TALKTYPE_ORANGE_1) return action end function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if not Monster(itemEx.uid) then return true end local monster = Monster(itemEx.uid) local npc = Npc(itemEx.uid) local targetitem = Item(itemEx.uid) local mount = config[monster:getName()] if mount == nil then return false end if player:hasMount(mount.ID) then player:say("You already own this mount!", TALKTYPE_ORANGE_1) return false end local rand = math.random(1, 100) --Monster Mount if monster ~= nil and mount.TYPE == TYPE_MONSTER then if Creature(itemEx.uid):getMaster() then player:say("You cant tame a summon!", TALKTYPE_ORANGE_1) return true end if mount.NAME == monster:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) monster:remove() toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true else toPosition:sendMagicEffect(CONST_ME_POFF) end --NPC Mount elseif npc ~= nil and mount.TYPE == TYPE_NPC then if mount.NAME == npc:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Item Mount elseif targetitem ~= nil and mount.TYPE == TYPE_ITEM then if mount.NAME == targetitem:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Action Mount elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then if(mount.NAME == itemEx.actionid) then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Unique Mount elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then if mount.NAME == itemEx.uid then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end end return false end -
MauroelBrizola recebeu reputação de acesso123 em (Resolvido)[PEDIDO] MUSIC BOX [MONTARIAS] TFS 1.0Esta ai... adaptei o script postado para funcionar como Music Box, doma todos os que estão configurados.
Se precisar de ajuda para configurar alguma outra mount ( O script suporta domar itens, monstros e até NPCs... ) só pedir.
No arquivo actions.xml adicione a seguinte tag:
<action itemid="18511" script="musicbox.lua"/> Crie o arquivo musicbox.lua em otserver/data/actions/scripts e coloque nele:
local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4 local TYPE_MONSTER, TYPE_NPC, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4 local config = { ["Gnarlhound"] = {NAME = 'Gnarlhound', ID = 32, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The gnarlhound ran away."}, {2, "Oh no! The golem Wrench broke."}, {3, "The gnarlhound has fled."} }, SUCCESS_MSG = "You have tamed the gnarlhound."}, ["Magma Crawler"] = {NAME = 'Magma Crawler', ID = 30, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The magma crawler ran away."}, {2, "Oh no! The glow wine broke."}, {3, "The magma crawler has fled."} }, SUCCESS_MSG = "You have tamed the magma crawler."}, ["Dragonling"] = {NAME = 'Dragonling', ID = 31, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The dragonling ran away."}, {2, "Oh no! The decorative ribbon broke."}, {3, "The dragonling has fled."} }, SUCCESS_MSG = "You have tamed the dragonling."}, ["Ironblight"] = {NAME = 'Ironblight', ID = 29, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ironblight ran away."}, {2, "Oh no! iron loadstone broke."}, {3, "The ironblight has fled."} }, SUCCESS_MSG = "You have tamed the ironblight."}, ["Shock Head"] = {NAME = 'Shock Head', ID = 42, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The shock head ran away."}, {2, "Oh no! The nightmare horn broke."}, {3, "The shock head has fled."} }, SUCCESS_MSG = "You have tamed the shock head."}, ["Bear"] = {NAME = 'Bear', ID = 3, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bear ran away."}, {2, "Oh no! The slingshot broke."}, {3, "The bear is trying to hit you with its claws."} }, SUCCESS_MSG = "You have tamed the bear."}, ["Black Sheep"] = {NAME = 'Black Sheep', ID = 4, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The black sheep ran away."}, {2, "Oh no! The reins were torn."}, {3, "The black sheep is trying to run away."} }, SUCCESS_MSG = "You have tamed the sheep."}, ["Midnight Panther"] = {NAME = 'Midnight Panther', ID = 5, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The panther has escaped."}, {2, "The whip broke."} }, SUCCESS_MSG = "You have tamed the panther."}, ["Terror Bird"] = {NAME = 'Terror Bird', ID = 2, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bird ran away."}, {3, "The terror bird is pecking you."} }, SUCCESS_MSG = "You have tamed the bird."}, ["Boar"] = {NAME = 'Boar', ID = 10, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The boar has run away"}, {3, "The boar attacks you."} }, SUCCESS_MSG = "You have tamed the boar."}, ["Crustacea Gigantica"] = {NAME = 'Crustacea Gigantica', ID = 7, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The crustacea has run away."}, {2, "The crustacea ate the shrimp."} }, SUCCESS_MSG = "You have tamed the crustacea."}, ["Undead Cavebear"] = {NAME = 'Undead Cavebear', ID = 12, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The undead bear has run away."} }, SUCCESS_MSG = "You have tamed the skeleton."}, ["Wailing Widow"] = {NAME = 'Wailing Widow', ID = 1, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The widow has run away."}, {2, "The widow has eaten the sweet bait."} }, SUCCESS_MSG = "You have tamed the widow."}, ["inoperative tin lizzard"] = {NAME = 'inoperative tin lizzard', ID = 8, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The key broke inside."} }, SUCCESS_MSG = "You have started the Tin Lizzard!"}, ["Draptor"] = {NAME = 'Draptor', ID = 6, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The draptor has run away."}, {3, "The draptor has fled."} }, SUCCESS_MSG = "You have tamed the draptor."}, ["Crystal Wolf"] = {NAME = 'Crystal Wolf', ID = 16, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The wolf has run away."} }, SUCCESS_MSG = "You have tamed the wolf."}, ["Enraged White Deer"] = {NAME = 'Enraged White Deer', ID = 18, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {2, "The cone broke."}, {3, "The deer has fled in fear."} }, SUCCESS_MSG = "You have tamed the deer."}, ["Panda"] = {NAME = 'Panda', ID = 19, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {4, "Panda ate the leaves and ran away."} }, SUCCESS_MSG = "You have tamed the panda."}, ["Dromedary"] = {NAME = 'Dromedary', ID = 20, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "Dromedary has run away."} }, SUCCESS_MSG = "You have tamed the dromedary."}, ["Sandstone Scorpion"] = {NAME = 'Sandstone Scorpion', ID = 21, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The scorpion has vanished."}, {2, "Scorpion broken the sceptre."} }, SUCCESS_MSG = "You have tamed the scorpion"}, ["Donkey"] = {NAME = 'Donkey', ID = 13, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The witch has escaped!"} }, SUCCESS_MSG = "You have tamed the mule."}, ["inoperative uniwheel"] = {NAME = 'inoperative uniwheel', ID = 15, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The oil is having no effect."} }, SUCCESS_MSG = "You have found an Uniwheel."}, ["Slug"] = {NAME = 'Slug', ID = 14, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The slug has run away."}, {3, "The drug had no effect."} }, SUCCESS_MSG = "You have tamed the slug."}, ["Wild Horse"] = {NAME = 'Wild Horse', ID = 17, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The horse runs away."}, {2, "The horse ate the oats."} }, SUCCESS_MSG = "You have tamed the horse."}, ["Manta Ray"] = {NAME = 'Manta Ray', ID = 28, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The manta ray fled."}, {3, "The manta ray is trying to escape."} }, SUCCESS_MSG = "You have tamed the manta ray."}, ["Lady Bug"] = {NAME = 'Lady Bug', ID = 27, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ladybug got scared and ran away."}, {3, "The ladybug is trying to nibble."} }, SUCCESS_MSG = "You tame a ladybug."}, ["Water Buffalo"] = {NAME = 'Water Buffalo', ID = 35, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The water buffalo got scared and ran away."}, {3, "The water buffalo is trying to nibble."} }, SUCCESS_MSG = "You tamed a water buffalo."} } local function doFailAction(cid, mount, pos, item, itemEx) local action, effect = mount.FAIL_MSG[math.random(1, table.maxn(mount.FAIL_MSG))], CONST_ME_POFF if(action[1] == ACTION_RUN) then Creature(itemEx.uid):remove() elseif(action[1] == ACTION_BREAK) then effect = CONST_ME_BLOCKHIT Item(item.uid):remove(1) elseif(action[1] == ACTION_ALL) then Creature(itemEx.uid):remove() Item(item.uid):remove(1) end Position(pos):sendMagicEffect(effect) Player(cid):say(action[2], TALKTYPE_ORANGE_1) return action end function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if not Monster(itemEx.uid) then return true end local monster = Monster(itemEx.uid) local npc = Npc(itemEx.uid) local targetitem = Item(itemEx.uid) local mount = config[monster:getName()] if mount == nil then return false end if player:hasMount(mount.ID) then player:say("You already own this mount!", TALKTYPE_ORANGE_1) return false end local rand = math.random(1, 100) --Monster Mount if monster ~= nil and mount.TYPE == TYPE_MONSTER then if Creature(itemEx.uid):getMaster() then player:say("You cant tame a summon!", TALKTYPE_ORANGE_1) return true end if mount.NAME == monster:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) monster:remove() toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true else toPosition:sendMagicEffect(CONST_ME_POFF) end --NPC Mount elseif npc ~= nil and mount.TYPE == TYPE_NPC then if mount.NAME == npc:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Item Mount elseif targetitem ~= nil and mount.TYPE == TYPE_ITEM then if mount.NAME == targetitem:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Action Mount elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then if(mount.NAME == itemEx.actionid) then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Unique Mount elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then if mount.NAME == itemEx.uid then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end end return false end -
MauroelBrizola recebeu reputação de Jack Zika em (Resolvido)[PEDIDO] MUSIC BOX [MONTARIAS] TFS 1.0Esta ai... adaptei o script postado para funcionar como Music Box, doma todos os que estão configurados.
Se precisar de ajuda para configurar alguma outra mount ( O script suporta domar itens, monstros e até NPCs... ) só pedir.
No arquivo actions.xml adicione a seguinte tag:
<action itemid="18511" script="musicbox.lua"/> Crie o arquivo musicbox.lua em otserver/data/actions/scripts e coloque nele:
local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4 local TYPE_MONSTER, TYPE_NPC, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4 local config = { ["Gnarlhound"] = {NAME = 'Gnarlhound', ID = 32, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The gnarlhound ran away."}, {2, "Oh no! The golem Wrench broke."}, {3, "The gnarlhound has fled."} }, SUCCESS_MSG = "You have tamed the gnarlhound."}, ["Magma Crawler"] = {NAME = 'Magma Crawler', ID = 30, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The magma crawler ran away."}, {2, "Oh no! The glow wine broke."}, {3, "The magma crawler has fled."} }, SUCCESS_MSG = "You have tamed the magma crawler."}, ["Dragonling"] = {NAME = 'Dragonling', ID = 31, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The dragonling ran away."}, {2, "Oh no! The decorative ribbon broke."}, {3, "The dragonling has fled."} }, SUCCESS_MSG = "You have tamed the dragonling."}, ["Ironblight"] = {NAME = 'Ironblight', ID = 29, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ironblight ran away."}, {2, "Oh no! iron loadstone broke."}, {3, "The ironblight has fled."} }, SUCCESS_MSG = "You have tamed the ironblight."}, ["Shock Head"] = {NAME = 'Shock Head', ID = 42, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The shock head ran away."}, {2, "Oh no! The nightmare horn broke."}, {3, "The shock head has fled."} }, SUCCESS_MSG = "You have tamed the shock head."}, ["Bear"] = {NAME = 'Bear', ID = 3, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bear ran away."}, {2, "Oh no! The slingshot broke."}, {3, "The bear is trying to hit you with its claws."} }, SUCCESS_MSG = "You have tamed the bear."}, ["Black Sheep"] = {NAME = 'Black Sheep', ID = 4, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The black sheep ran away."}, {2, "Oh no! The reins were torn."}, {3, "The black sheep is trying to run away."} }, SUCCESS_MSG = "You have tamed the sheep."}, ["Midnight Panther"] = {NAME = 'Midnight Panther', ID = 5, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The panther has escaped."}, {2, "The whip broke."} }, SUCCESS_MSG = "You have tamed the panther."}, ["Terror Bird"] = {NAME = 'Terror Bird', ID = 2, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The bird ran away."}, {3, "The terror bird is pecking you."} }, SUCCESS_MSG = "You have tamed the bird."}, ["Boar"] = {NAME = 'Boar', ID = 10, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The boar has run away"}, {3, "The boar attacks you."} }, SUCCESS_MSG = "You have tamed the boar."}, ["Crustacea Gigantica"] = {NAME = 'Crustacea Gigantica', ID = 7, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The crustacea has run away."}, {2, "The crustacea ate the shrimp."} }, SUCCESS_MSG = "You have tamed the crustacea."}, ["Undead Cavebear"] = {NAME = 'Undead Cavebear', ID = 12, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The undead bear has run away."} }, SUCCESS_MSG = "You have tamed the skeleton."}, ["Wailing Widow"] = {NAME = 'Wailing Widow', ID = 1, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The widow has run away."}, {2, "The widow has eaten the sweet bait."} }, SUCCESS_MSG = "You have tamed the widow."}, ["inoperative tin lizzard"] = {NAME = 'inoperative tin lizzard', ID = 8, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The key broke inside."} }, SUCCESS_MSG = "You have started the Tin Lizzard!"}, ["Draptor"] = {NAME = 'Draptor', ID = 6, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The draptor has run away."}, {3, "The draptor has fled."} }, SUCCESS_MSG = "You have tamed the draptor."}, ["Crystal Wolf"] = {NAME = 'Crystal Wolf', ID = 16, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The wolf has run away."} }, SUCCESS_MSG = "You have tamed the wolf."}, ["Enraged White Deer"] = {NAME = 'Enraged White Deer', ID = 18, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {2, "The cone broke."}, {3, "The deer has fled in fear."} }, SUCCESS_MSG = "You have tamed the deer."}, ["Panda"] = {NAME = 'Panda', ID = 19, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {4, "Panda ate the leaves and ran away."} }, SUCCESS_MSG = "You have tamed the panda."}, ["Dromedary"] = {NAME = 'Dromedary', ID = 20, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "Dromedary has run away."} }, SUCCESS_MSG = "You have tamed the dromedary."}, ["Sandstone Scorpion"] = {NAME = 'Sandstone Scorpion', ID = 21, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The scorpion has vanished."}, {2, "Scorpion broken the sceptre."} }, SUCCESS_MSG = "You have tamed the scorpion"}, ["Donkey"] = {NAME = 'Donkey', ID = 13, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The witch has escaped!"} }, SUCCESS_MSG = "You have tamed the mule."}, ["inoperative uniwheel"] = {NAME = 'inoperative uniwheel', ID = 15, TYPE = TYPE_ITEM, CHANCE = 100, FAIL_MSG = { {2, "The oil is having no effect."} }, SUCCESS_MSG = "You have found an Uniwheel."}, ["Slug"] = {NAME = 'Slug', ID = 14, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The slug has run away."}, {3, "The drug had no effect."} }, SUCCESS_MSG = "You have tamed the slug."}, ["Wild Horse"] = {NAME = 'Wild Horse', ID = 17, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The horse runs away."}, {2, "The horse ate the oats."} }, SUCCESS_MSG = "You have tamed the horse."}, ["Manta Ray"] = {NAME = 'Manta Ray', ID = 28, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The manta ray fled."}, {3, "The manta ray is trying to escape."} }, SUCCESS_MSG = "You have tamed the manta ray."}, ["Lady Bug"] = {NAME = 'Lady Bug', ID = 27, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The ladybug got scared and ran away."}, {3, "The ladybug is trying to nibble."} }, SUCCESS_MSG = "You tame a ladybug."}, ["Water Buffalo"] = {NAME = 'Water Buffalo', ID = 35, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { {1, "The water buffalo got scared and ran away."}, {3, "The water buffalo is trying to nibble."} }, SUCCESS_MSG = "You tamed a water buffalo."} } local function doFailAction(cid, mount, pos, item, itemEx) local action, effect = mount.FAIL_MSG[math.random(1, table.maxn(mount.FAIL_MSG))], CONST_ME_POFF if(action[1] == ACTION_RUN) then Creature(itemEx.uid):remove() elseif(action[1] == ACTION_BREAK) then effect = CONST_ME_BLOCKHIT Item(item.uid):remove(1) elseif(action[1] == ACTION_ALL) then Creature(itemEx.uid):remove() Item(item.uid):remove(1) end Position(pos):sendMagicEffect(effect) Player(cid):say(action[2], TALKTYPE_ORANGE_1) return action end function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if not Monster(itemEx.uid) then return true end local monster = Monster(itemEx.uid) local npc = Npc(itemEx.uid) local targetitem = Item(itemEx.uid) local mount = config[monster:getName()] if mount == nil then return false end if player:hasMount(mount.ID) then player:say("You already own this mount!", TALKTYPE_ORANGE_1) return false end local rand = math.random(1, 100) --Monster Mount if monster ~= nil and mount.TYPE == TYPE_MONSTER then if Creature(itemEx.uid):getMaster() then player:say("You cant tame a summon!", TALKTYPE_ORANGE_1) return true end if mount.NAME == monster:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) monster:remove() toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true else toPosition:sendMagicEffect(CONST_ME_POFF) end --NPC Mount elseif npc ~= nil and mount.TYPE == TYPE_NPC then if mount.NAME == npc:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Item Mount elseif targetitem ~= nil and mount.TYPE == TYPE_ITEM then if mount.NAME == targetitem:getName() then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Action Mount elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then if(mount.NAME == itemEx.actionid) then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end --Unique Mount elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then if mount.NAME == itemEx.uid then if rand > mount.CHANCE then doFailAction(cid, mount, toPosition, item, itemEx) return true end player:addMount(mount.ID) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG) player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1) toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end end return false end -
MauroelBrizola deu reputação a Absolute em [WarInvite] /war invite TFS 1.0Fala galera do TK, vi em alguns servidores grandes 10.x+ o comando de /war invite, ou seja todos os servidores que baixamos não contém este sistema, então resolvi pegar o script original como base e adapta-lo para tfs 1.0, trocando as funções e tudo mais.
Sem mimimi vamos ao que interessa:
Em data/talkactions/scripts crie um arquivo chamado: gwarabsolute.lua e dentro adicione o seguinte conteúdo:
function onSay(cid, words, param) local player = Player(cid) local guild = player:getGuild() if(guild == nil) then player:sendCancelMessage("You need to be in a guild in order to execute this talkaction.") return false end local guild = getPlayerGuildId(cid) if not guild or (player:getGuildLevel() < GUILDLEVEL_LEADER) then player:sendCancelMessage("You cannot execute this talkaction.") return false end local t = string.split(param, ",") if(not t[2]) then player:sendChannelMessage("", "Not enough param(s).", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end local enemy = getGuildId(t[2]) if(not enemy) then player:sendChannelMessage("", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end if(enemy == guild) then player:sendChannelMessage("", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end local enemyName, tmp = "", db.storeQuery("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if tmp ~= false then enemyName = result.getDataString(tmp, "name") result.free(tmp) end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild1` = " .. enemy .. " AND `guild2` = " .. guild if(t[1] == "cancel") then query = "`guild1` = " .. guild .. " AND `guild2` = " .. enemy end tmp = db.storeQuery("SELECT `id`, `started`, `ended`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp == false) then player:sendChannelMessage("", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end if(t[1] == "accept") then local _tmp = db.storeQuery("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = result.getDataInt(_tmp, "balance") < result.getDataInt(tmp, "payment") result.free(_tmp) if(state) then player:sendChannelMessage("", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. result.getDataInt(tmp, "payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`ended` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`ended` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`started` = " .. os.time() .. ", `ended` = " .. (result.getDataInt(tmp, "ended") > 0 and (os.time() + ((result.getDataInt(tmp, "started") - result.getDataInt(tmp, "ended")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. result.getDataInt(tmp, "id") result.free(tmp) db.query(query) broadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return false end if(t[1] == "invite") then local str = "" tmp = db.storeQuery("SELECT `guild1`, `status` FROM `guild_wars` WHERE `guild1` IN (" .. guild .. "," .. enemy .. ") AND `guild2` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp ~= false) then if(result.getDataInt(tmp, "status") == 0) then if(result.getDataInt(tmp, "guild1") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end result.free(tmp) end if(str ~= "") then player:sendChannelMessage("", str, TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.floor(payment)+1000 tmp = db.storeQuery("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = result.getDataInt(tmp, "balance") < payment result.free(tmp) if(state) then player:sendChannelMessage("", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.query("INSERT INTO `guild_wars` (`guild1`, `guild2`, `started`, `ended`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") broadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return false end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.storeQuery("SELECT `id` FROM `guild_wars` WHERE `guild1` = " .. guild .. " AND `guild2` = " .. enemy .. " AND `status` = " .. status) if(tmp ~= false) then local query = "UPDATE `guild_wars` SET `ended` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. result.getDataInt(tmp, "id") result.free(tmp) db.query(query) broadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return false end if(status == 4) then player:sendChannelMessage("", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end tmp = db.storeQuery("SELECT `id`, `ended` FROM `guild_wars` WHERE `guild1` = " .. enemy .. " AND `guild2` = " .. guild .. " AND `status` = 1") if(tmp ~= false) then if(result.getDataInt(tmp, "ended") > 0) then result.free(tmp) player:sendChannelMessage("", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end local query = "UPDATE `guild_wars` SET `status` = 4, `ended` = " .. os.time() .. " WHERE `id` = " .. result.getDataInt(tmp, "id") result.free(tmp) db.query(query) broadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return false end player:sendChannelMessage("", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end
Ainda em data/talkactions/scripts crie um arquivo com nome de absolutebalance.lua e dentro adicione:
local function isValidMoney(value) if(value == nil) then return false end return (value > 0 and value <= 99999999999999) end function onSay(cid, words, param) local player = Player(cid) local guild = player:getGuild():getId() if(guild == nil) then return true end local t = string.split(param, ' ', 1) if(player:getGuildLevel() == GUILDLEVEL_LEADER and isInArray({'pick'}, t[1])) then if(t[1] == 'pick') then local money = {tonumber(t[2])} if(not isValidMoney(money[1])) then player:sendChannelMessage('', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end local resultId = db.storeQuery("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) if resultId == false then return false end money[2] = result.getDataInt(resultId, "balance") result.free(resultId) if(money[1] > money[2]) then player:sendChannelMessage('', 'The balance is too low for such amount.', TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return false end if(not db.query('UPDATE `guilds` SET `balance` = `balance` - ' .. money[1] .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;')) then return false end doPlayerAddMoney(cid, money[1]) player:sendChannelMessage('', 'You have just picked ' .. money[1] .. ' money from your guild balance.', TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) else player:sendChannelMessage('', 'Invalid sub-command.', TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) end elseif(t[1] == 'donate') then local money = tonumber(t[2]) if(not isValidMoney(money)) then player:sendChannelMessage('', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return true end if(getPlayerMoney(cid) < money) then player:sendChannelMessage('', 'You don\'t have enough money.', TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) return true end if(not doPlayerRemoveMoney(cid, money)) then return false end db.query('UPDATE `guilds` SET `balance` = `balance` + ' .. money .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;') player:sendChannelMessage('', 'You have transfered ' .. money .. ' money to your guild balance.', TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) else local resultId = db.storeQuery('SELECT `name`, `balance` FROM `guilds` WHERE `id` = ' .. guild) if resultId == false then return false end player:sendChannelMessage('', 'Current balance of guild ' .. result.getDataString(resultId, "name") .. ' is: ' .. result.getDataInt(resultId, "balance") .. ' bronze coins.', TALKTYPE_CHANNEL_R1, CHANNEL_GUILD) result.free(resultId) end end Pós isto, abra seu talkactions.xml e dentro adicione:
<!--War System TALK by Absolute --> <talkaction words="/war" separator=" " script="gwarabsolute.lua" /> <talkaction words="/balance" separator=" " script="absolutebalance.lua" /> Nota: Você deve conter as colunas na database (Praticamente todas já possuem).
Tabela de comando in-game para players:
Observação Final: Você pode manter tanto a página quanto a talkaction para seu GuildWAR.
Este conteúdo é feito por mim e exclusivo ao fórum tibiaking.com, não autorizo cópias ou demais postagens.
Demais dúvidas utilize o fórum para perguntar.
Espero ter ajudado.
Absolute.