-
Total de itens
631 -
Registro em
-
Última visita
-
Dias Ganhos
13
Tudo que jhon992 postou
-
Creio que assim funcionara: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BOLT) local attackmin, attackmax = 100, 300 -- attack minimo, attack maximo function onCastSpell(cid, var) target = getCreatureTarget(cid) hit = (math.random(attackmin,attackmax) + getPlayerSkillLevel(cid, SKILL_DISTANCE) / 3) doCreatureAddHealth(target, -hit) return doCombat(cid, combat, var) end
-
Em data/creaturescripts/scripts, duplique um arquivo e nomeia para "out_kill" sem as aspas e nele cole: local KILL_TRANSFORM = { [20] = 100, -- [numero de mortes] = looktype [50] = 120, [100] = 130, [200] = 150, [400] = 190, [600] = 210 } function onKill(cid, target, lastHit) if (isPlayer(target) == true) then setPlayerStorageValue(cid, 102089, getPlayerStorageValue(cid, 102089)+1) doSendAnimatedText(getThingPos(cid), 'Frag+', 144) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você recebeu 1 frag por matar "..getCreatureName(target)..".") end local outfit = {lookType = KILL_TRANSFORM[getPlayerStorageValue(cid, 102089)]} if (outfit.lookType > 0) then doSetCreatureOutfit(cid, outfit, -1) end return TRUE end Agora em creaturescripts.xml cole a tag: <event type="kill" name="Out_Kill" event="script" value="out_kill.lua"/> E em data/creaturescripts/scripts/login.lua, antes do último "return true" coloque isso: if (getPlayerStorageValue(cid, 102091) ~= 1) then setPlayerStorageValue(cid, 102091, 1) setPlayerStorageValue(cid, 102089, 0) end registerCreatureEvent(cid, "Out_Kill")
-
Em data/creaturescripts/scripts, duplica um arquivo e nomeia para "vocations_gain" sem as aspas e nele cole: local vocationsItem = { [1] = 1234, -- sorcerer, troque os 1234 pelo id do item. [2] = 1234, -- druid [3] = 1234, -- paladin [4] = 1234 -- knight } local lvlGain = 20 -- lvl para ganhar function onAdvance(cid, skill, oldLevel, newLevel) if (getPlayerLevel(cid) == lvlGain and getPlayerStorageValue(cid, 403245) ~= 1) then doPlayerAddItem(cid, vocationsItem[getPlayerVocation(cid)]) setPlayerStorageValue(cid, 403245, 1) end return true end Agora em creaturescripts.xml cole a tag: <event type="advance" name="VocationsGain" event="script" value="vocations_gain.lua"/> E por último em data/creaturescripts/scripts/login.lua, cole a tag antes do último "return true": registerCreatureEvent(cid, "VocationsGain")
-
function onUse(cid, item, item2, frompos, topos, pos) local config = { ["Magic Plate Armor"] = {t1=2476,t2=2464,t3=2472}, -- t1 = ID do ITEM 1 |---| t2 = ID do ITEM 2 |---| t3 = ID do ITEM a ser FORJADO -- ["Dragon Scale Mail"] = {t1=2489,t2=2487,t3=2492}, } local r1 = {x = 222, y = 217, z = 7, stackpos= 2} -- Posição 1 ( NÃO MEXA NO stackpos= 2 ) local r2 = {x = 224, y = 217, z = 7, stackpos= 2} -- Posição 2 ( NÃO MEXA NO stackpos= 2 ) local r3 = {x = 223, y = 217, z = 7} -- Posição do Item a Ser Criado local chance = 60 -- chance de funcionar local q1 = getThingfromPos(r1) local q2 = getThingfromPos(r2) for i, x in pairs(config) do if (q1.itemid == x.t1 and q2.itemid == x.t2) or (q1.itemid == x.t2 and q2.itemid == x.t1) then doRemoveItem(q1.uid, 1) doRemoveItem(q2.uid, 1) if (math.random(0,100) > chance) then doPlayerSendTextMessage(cid, 22, "Você não conseguiu forjar!") return true end addEvent(doCreateItem, 1000, x.t3, 1, r3) doSendMagicEffect(r3, 47) addEvent(doSendMagicEffect, 900, r3, 39) doPlayerSendTextMessage(cid, 22, "Parabéns, Você Forjou Um " .. i .. ".") break end end return TRUE end
- 1 resposta
-
- edita aqui para mim
- otserv
-
(e 1 mais)
Tags:
-
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) function onCastSpell(cid, var) doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) - getCreatureHealth(cid))/2) return doCombat(cid, combat, var) end
-
[Duvida] Por Server Pvp Enforced ! (Rep+)
tópico respondeu ao Blinkrox de jhon992 em Lixeira Pública
Apareceu algum erro na distro ou algo desse tipo? Tenta por o wordtype = "pvp", então e mudar só rateExperienceFromPlayers, como foi sugerido nesse link: http://www.xtibia.co...-matar-players/ -
[Duvida] Por Server Pvp Enforced ! (Rep+)
tópico respondeu ao Blinkrox de jhon992 em Lixeira Pública
Vai no seu config.lua e procure por: worldType = "pvp" Troque por: worldType = "pvp-enforced" Agora procura por: rateExperienceFromPlayers = 0 E coloque a exp desejada. -
Tenta assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) function onCastSpell(cid, var) if (getPlayerStorageValue(cid, 103010) <= 0) then doCreatureAddHealth(cid, 100) setPlayerStorageValue(cid, 103010, 1) addEvent(testSto1, 15000, cid) elseif (getPlayerStorageValue(cid, 103010) == 1) then doCreatureAddHealth(cid, 200) setPlayerStorageValue(cid, 103010, 2) addEvent(testSto2, 15000, cid) else setPlayerStorageValue(cid, 103010, 0) doCreatureAddHealth(cid, 300) end return doCombat(cid, combat, var) end function testSto1(cid) if (isPlayer(cid)) then if (getPlayerStorageValue(cid, 103010) == 1) then setPlayerStorageValue(cid, 103010, 0) end end end function testSto2(cid) if (isPlayer(cid)) then if (getPlayerStorageValue(cid, 103010) == 2) then setPlayerStorageValue(cid, 103010, 0) end end end
-
Acho que assim vai funcionar: Vai em data/actions/actions.xml e poem a tag: <action actionid="2015" event="script" value="doorguild.lua"/> Agora em data/actions/scripts, duplica um arquivo e nomeia pra "doorguild" sem as aspas e cole: function onUse(cid, item, fromPosition, itemEx, toPosition) if (db.getResult("SELECT * FROM `guilds` WHERE `id` = " .. getPlayerGuildId(cid) .. " AND `acesso` > " .. os.time() .. ";"):getID() ~= -1) then doTeleportThing(cid, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não pode entrar nessa porta.") end return true end Por último poem o actionid na porta do seu ot pelo mapa editor!
-
Relacionado ao seu pedido, achei esse topico respondido pelo @Demonbh. http://www.xtibia.com/forum/topic/167039-pedido-urgentesistema-de-durabilidade/
-
oque esse script deve fazer? explica melhor para min poder ajudar.
-
fiz um diferente aqui pra ficar melhor de adicionar os monstros, function removeMonster(pid) if (isMonster(pid) == true) then doRemoveCreature(pid) end end function onThink(interval, lastExecution, thinkInterval) local toPos = {x=2489, y=2388, z=7} -- Canto superior esquerdo do mapa, da area que criara os monstros local fromPos = {x=2506, y=2399, z=7} -- Canto inferior direito do mapa, da area que criara os monstros local monsters = {"Demon", "Morgaroth", "Hydra", "Dragon"} -- Monstros que criara local tempo = 60000 * 1 -- troque apenas o numero 10, que será o minuto para o monstro sumir doBroadcastMessage("Invação de Monstros Poderosos ao leste da cidade!") for i=1, #monsters do pid = doCreateMonster(monsters[i], {x=math.random(toPos.x,fromPos.x), y=math.random(toPos.y,fromPos.y), z=math.random(toPos.z,fromPos.z)}) addEvent(removeMonster, tempo, pid) end return true end Ele criara os monstros dentro da area que tu determinar. Obs: Não testei, qualquer erro me fala.
-
Assm vai criar 2: function removeMonster(pid) if (isMonster(pid) == true) then doRemoveCreature(pid) end end function onThink(interval, lastExecution, thinkInterval) local pos = {x=2456, y=2462, z=7} -- Posição que monstro vai nascer local monster = "Morgaroth" -- Boss que é pra criar local tempo = 60000 * 10 -- troque apenas o numero 10, que será o minuto para o monstro sumir doBroadcastMessage("Invação de Morgaroth ao leste da cidade!") pid = doCreateMonster(monster, pos) addEvent(removeMonster, 6000, pid) pid = doCreateMonster(monster, pos) addEvent(removeMonster, 6000, pid) return true end
-
Esse problema começou do nada ou fisese algo e ocorreu? tenta verificar o seu arquivo "forgottenserver.s3db", pelo visto parece que sua database não possui o account manager, faça um backup e depois substitua o arquivo pelo de outro otserv.
- 4 respostas
-
- [pedido] ajuda acc manager
- 8.54
- (e 3 mais)
-
Fais como o último post meu nesse link: http://www.xtibia.com/forum/topic/174122-raid-system-resolvido/page__p__1143951__hl__+raid%20+jhon992__fromsearch__1#entry1143951
-
Tenta assim: local spellConfig = { {effect = 49, area = createCombatArea({ {1, 1, 1}, {1, 2, 1}, {1, 1, 1}}) }, {effect = 21, area = createCombatArea({ {1, 1, 0, 1, 1}, {1, 1, 1, 1, 1}, {0, 1, 2, 1, 0}, {1, 1, 1, 1, 1}, {1, 1, 0, 1, 1}}) }, {effect = 31, area = createCombatArea({ {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 2, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}}) }, {effect = 39, area = createCombatArea({ {1, 0, 1, 0, 1}, {0, 1, 1, 1, 0}, {0, 1, 2, 1, 0}, {0, 1, 1, 1, 0}, {1, 0, 1, 0, 1}}) }, {effect = 31, area = createCombatArea({ {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 2, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}}) }, {effect = 49, area = createCombatArea({ {1, 1, 0, 1, 1}, {1, 1, 1, 1, 1}, {0, 1, 2, 1, 0}, {1, 1, 1, 1, 1}, {1, 1, 0, 1, 1}}) } } local combats = {} for k, config in ipairs(spellConfig) do combats[k] = createCombatObject() onTargetTile = function(cid, pos) local basePos = getThingPosition(cid) local fromPos = {x=basePos.x-6, y=basePos.y-8, z=basePos.z} doSendDistanceShoot(fromPos, pos, 30) end setCombatCallback(combats[k], CALLBACK_PARAM_TARGETTILE, "onTargetTile") setCombatParam(combats[k], COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combats[k], COMBAT_PARAM_EFFECT, config.effect) setCombatFormula(combats[k], COMBAT_FORMULA_LEVELMAGIC, -0.250, -650, -0.250, -650) setCombatArea(combats[k], config.area) end local function castingSpellTime(p) if(isCreature(p[1]) == TRUE) then doCombat(unpack(p)) end end function onCastSpell(cid, var) if vip.hasVip(cid) == FALSE then doPlayerSendCancel(cid, "Desculpe,Só jogadores vips usam está magia.") return false else for k, combat in ipairs(combats) do addEvent(castingSpellTime, (100*k), {cid, combat, var}) end end return true end
-
, desculpa aew to errando umas coisinha boba. agora acho que foi!
-
ta arrumado la em cima.
-
Duplica um arquivo no data/talkaction/scripts e nomeia para "itemunban" sem as aspas e nele cole: function onSay(cid, words, param, channel) local itemid = 2345 -- id do item que ira remover local j = 0 if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if (getPlayerItemCount(cid, itemid) <= 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You no have item.") return true end local account, tmp = getAccountIdByName(param), true if(account == 0) then account = getAccountIdByAccount(param) if(account == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player or account '" .. param .. "' does not exists.") return true end tmp = false end local ban = getBanData(account, BAN_ACCOUNT) if(ban and doRemoveAccountBanishment(account)) then local name = param if(tmp) then name = account end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, name .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".") end if(not tmp) then return true end tmp = getIpByName(param) if(isIpBanished(tmp) and doRemoveIpBanishment(tmp)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "IP Banishment on " .. doConvertIntegerToIp(ip) .. " has been lifted.") end local guid = getPlayerGUIDByName(param, true) if(guid == nil) then return true end ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_LOCK) if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_LOCK)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Namelock from " .. param .. " has been removed.") doPlayerRemoveItem(cid, itemid, 1) j = 1 end ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_BANISHMENT) if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_BANISHMENT)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".") if (j ~= 1) then doPlayerRemoveItem(cid, itemid, 1) end end return true end Em talkactions.xml cole a tag: <talkaction words="/unban" event="script" value="itemunban.lua"/> Prontinho, sóh tira a outra tag no talkactions.xml que tem o comando /unban.
-
Então fisese algo errado no arquivo Monsterout Seller.xml
-
Para ser o msm item só adicionar a tag da speed no script. Ex: function onEquip(cid, item, slot) local outfit = {lookType = 4} -- looktype doSetCreatureOutfit(cid, outfit, -1) doChangeSpeed(cid, 500) -- speed almenta em 500 doSendMagicEffect(getPlayerPosition(cid),67) -- effect return TRUE end function onDeEquip(cid, item, slot) doRemoveCondition(cid, CONDITION_OUTFIT) doChangeSpeed(cid, -500) -- speed volta ao normal doSendMagicEffect(getPlayerPosition(cid),67) -- effect return TRUE end
-
Vlw aew pelos coments! Espero ter ajudado quem ta começando na area e espero ajudar muito mais.
- 16 respostas
-
- creaturescripts tutorial
- otserv
- (e 2 mais)
-
Falar Coisa "x" Receber Item "x" (Pode Fazer Isso Apenas Uma Vez)
tópico respondeu ao Pexezenho de jhon992 em Lixeira Pública
Esse script vai funcionar da seguinte maneira, quando o player falar: Jezeli nie mozesz uruchomic Ele recebera 1kk e pode ser falado apenas uma vez por conta, pelo que entendi era isso que vc queria. Vai em data/talkactions/script, duplica um arquivo e nomeia para "say_gain" sem as aspas e nele cole: function onSay(cid, words, param, channel) if (param == "nie mozesz uruchomic" and getPlayerStorageValue(cid, 302099+getAccountByName(getCreatureName(cid))) ~= 1) then doPlayerAddItem(cid, 2160, 100) -- troque o 2160 pelo id do item, e o 100 pela quantidade. setPlayerStorageValue(cid, 302099+getAccountByName(getCreatureName(cid)), 1) doSendMagicEffect(getCreaturePosition(cid), 30) -- troque o 30 pelo effect de sua preferencia. return true end return true end Agora em talkactions.xml cole a tag: <talkaction words="Jezeli" event="script" value="say_gain.lua"> </talkaction> -
sóh pra testar o script, com o gm fais o comando "/n Monsterout Seller" sem as aspas.
-
Primeiro implementa o sistema de owner do @Mateus. Depois troca esse seu código por este: -- FIXED BY Cybermaster && Kekox © OTLand.net -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param3")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param1")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(container_id, itemtogive_count) if isItemRune(container_id) == TRUE then full_weight = getItemWeightById(container_id, 1) else full_weight = getItemWeightById(container_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(container_id, itemtogive_count) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then setItemOwner(received_item, cid) doPlayerSave(cid, true) doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from Shop.') db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Prison Break Shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Spider shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE en Fais um backup antes, pq eu não testei.
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.