Tudo que Storm postou
-
Como fazer um baú de quest?
@powerryze local itemid, count = 2160, 100 -- ItemID, count local storage = 34166 function onUse(cid, item, fromPosition, itemEx, toPosition) if getCreatureStorage(cid, storage) == -1 then doPlayerSendTextMessage(cid, 27, "Parabéns por completar a quest") doPlayerAddItem(cid, itemid, count) doCreatureSetStorage(cid, storage, 1) return true else doPlayerSendTextMessage(cid, 27, "Você já completou essa quest.") return false end return true end Vai em actions.xml e cola essa tag <action actionid="47155" event="script" value="quest"/> Agora vai no seu mapEditor, seleciona o baú que dará o prêmio e coloque em actionID o mesmo ID que está na em actionid na actions.XML, no caso 47155.
-
Como adicionar effects em armas
@BangxD Você vai precisar fazer source editing
-
(Resolvido)[Erro] NPC ajudem please!!
@admelite local t = { ["local1"] = {{x=96, y=119, z=5}, 5000}, -- ["O que o player terá que digitar"] = {onde será levado, custo de money} ["local2"] = {{x=96, y=119, z=7}, 5000}, } function onSay(cid, words, param, channel) local exaust = 1 -- Minutos para usar o comando novamente local storage = 435569 local teleport = t[param] if os.time() - getPlayerStorageValue(cid, storage) <= exaust * 60 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O Comando está em exaustão") return true end if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o nome da quest que você quer") return true end if not teleport then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Local não encontrado.") return true end if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não pode estar em Battle") return true end if doPlayerRemoveMoney(cid, teleport[2]) then doPlayerSendTextMessage(cid, 25, "Teleportado") doTeleportThing(cid, teleport[1]) doSendMagicEffect(getCreaturePosition(cid), 2) setPlayerStorageValue(cid, storage, os.time()) return true else doPlayerSendTextMessage(cid, 27, "Voce nao tem dinheiro suficiente") doSendMagicEffect(getCreaturePosition(cid), 2) end return true end
-
[PeDiDo] Monstro não pode atacar player
@xMateuss Não se esqueça de registrar na XML do monstro e no creaturescripts.XML local t = { -- ["Monster name"] = Level minino(do player) para poder sofrer o ataque ["Cyclop"] = 50, ["Rat"] = 1 } function onCombat(cid, target) if not isMonster(cid) or not isPlayer(target) then return true end if t[getCreatureName(cid)] then if getPlayerLevel(target) <= t[getCreatureName(cid)] then return false end end return true end
-
Como adicionar effects em armas
@Jovim Na pasta da sua source, se você tiver é claro.
-
Como adicionar effects em armas
@Jovim Me envia sua tools.cpp
-
Como adicionar effects em armas
@Jovim <attribute key="weight" value="100" /> <attribute key="attack" value="1500" /> <attribute key="weaponType" value="distance" /> <attribute key="shootType" value="56" /> <attribute key="range" value="6" /> <attribute key="ammoAction" value="moveback" /> <attribute key="showattributes" value="1" /> <attribute key="skillDist" value="5" /> Se o efeito que você quiser for um número além do 41, vai precisar de source editing.
-
(Resolvido)[Erro] NPC ajudem please!!
@admelite Testei aqui e ta funcional, você está configurando errado.
-
(Resolvido)[Erro] NPC ajudem please!!
@admelite local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local moeda = 2160 -- ID do item que será a moeda -- ["name"] = {Quantidade da moeda, Onde será teleportado, Level, vip(true or false)} local t = { ["konoha"] = {1, {x = 1012, y = 905, z = 7}, 1, false}, } if (msgcontains(msg, 'viajar')) then local str = "" str = str .. "Eu posso lhe levar para esses lugares: " for name, pos, d, c in pairs(t) do str = str.." {"..name.."} por {"..pos[1].."} gold bars, " end str = str .. "." npcHandler:say(str, cid) elseif t[msg] then if t[msg][4] == true and not isPremium(cid) then npcHandler:say("Apenas Premium Players podem viajar à essa ilha, procure outra!!", cid) return false end if getPlayerLevel(cid) < t[msg][3] then npcHandler:say("Voce precisa ser level ".. tonumber(t[msg][3]) .." ou maior para viajar à essa ilha.", cid) return false end if getCreatureSkullType(cid) == 3 then npcHandler:say("PK's não podem viajar.", cid) return false end if doPlayerRemoveItem(cid, moeda, t[msg][1]) then doTeleportThing(cid, t[msg][2]) npcHandler:say("Obrigado! Espero que volte em breve.", cid) else npcHandler:say("Voce nao tem gold bars suficientes para viajar.", cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) XML <?xml version="1.0"?> <npc name="Minoru" script="data/npc/scripts/Minoru.lua" walkinterval="5000" floorchange="0"> <health now="100" max="100"/> <look type="407" head="95" body="116" legs="121" feet="115" addons="0"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Deseja {viajar} ??" /> </parameters> </npc>
-
Como pega Sources do otclient?
Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum! @PlaYerZ https://github.com/edubart/otclient
-
(Resolvido)Erro ao usar Spell de Buff
@Zyros Tirei a storage porque não é necessário, pense comigo, se você ja pode checar pela condition regeneration, pra que você ira utilizar uma storage se você já tem outro método de verificação que consome menos memória que a storage??? Para deixar o effect mais rápido, usa assim; local effsTortos = { --[eff] = {valores para corrigi-los}, [175] = {x= 1, y= 0}, --naruto } function repeatEff(cid, eff, tempo) if not isCreature(cid) or tempo == 0 then return end local p = getThingPos(cid) if effsTortos[eff] then p = {x= p.x+(effsTortos[eff].x), y= p.y+(effsTortos[eff].y), z= p.z} end doSendMagicEffect(p, eff) addEvent(repeatEff, 200, cid, eff, tempo - 0.2) end
-
(Resolvido)[DUVIDA] Teleport Falante laranja
@DigoleraBlow function onThink(interval, lastExecution) local name_of_monster = 'Trainer' --- here put monster name or any npc name local texts = { -- text pos effects ["Saida2"] = {{x=1404, y=1220, z=8}, 5, 23}, ["Saida"] = {{x=1404, y=1219, z=8}, 5, 23}, ["Mineração"] = {{x=1023, y=906, z=7}, 5, 23}, } for text, param in pairs(texts) do doCreatureSay(getCreatureByName(name_of_monster),text,TALKTYPE_ORANGE_1, false, 0,param[1]) doSendMagicEffect(param[1], param[2]) end return TRUE end
-
Bug no XP RING
@victor4312 Já é para 0.4 e 0.3.6
-
Erro AntiEntrosawar
@mullino Deixe vazia.
-
Error - TalkAction Interface rain_money
Procure por; if tonumber(param) > 0 then e acima dele, coloque: if not isNumber(param) then doPlayerSendTextMessage(cid, 27, "Incorrect param") return true end
-
Erro AntiEntrosawar
@mullino A tabela de storages está vazia, você se esqueceu de configurar: local storages = {}
-
(Resolvido)monstros que brilham
@Navegante Utilize flags: <flag lightlevel="0"/> -- Intensidade da luz da criatura (5/10) <flag lightcolor="0"/> -- Cor da luz da criatura
-
Bug no XP RING
@Mauricio lord function onEquip(cid, item, slot) if getPlayerLevel(cid) <= 200 then doPlayerSetExperienceRate(cid, 1.3) elseif getPlayerLevel(cid) > 200 and getPlayerLevel(cid) <= 280 then doPlayerSetExperienceRate(cid, 1.15) elseif getPlayerLevel(cid) > 280 then doPlayerSetExperienceRate(cid, 1.05) end doTransformItem(item.uid, 7697, 1) doPlayerSendTextMessage(cid, 22, "Sua experiencia foi aumentada!!") return TRUE end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 7708, 1) doPlayerSendTextMessage(cid, 22, "Sua experiencia esta de volta ao normal.") doPlayerSetExperienceRate(cid, 1.0) return TRUE end
-
(Resolvido)Erro ao usar Spell de Buff
@Zyros local tempo = 180 -- tempo em segundos. local efeito = 98 -- effect no player, caso queira apenas 1, basta remover os outros numeros. local ml = 40 -- quantos ira aumentar o skill de ML local skillfist = 0 -- quantos ira aumentar o skill de Fist local skillsword = 40 -- quantos ira aumentar o skill de Sword local skillaxe = 40 -- quantos ira aumentar o skill de Axe local skillclub = 40 -- quantos ira aumentar o skill de Club local skilldistance = 40 -- quantos ira aumentar o skill de Distance local skillshield = 0 -- quantos ira aumentar o skill de Shield local health = 350 -- A cada 1 segundo quantos aumentar de vida local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml) setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield) setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_SPEED, 250) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_REGENERATION) setConditionParam(condition, CONDITION_PARAM_SUBID, 1) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health) setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000) setCombatCondition(combat, condition) function onCastSpell(cid, var) if getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then doCombat(cid, combat, var) repeatEff(cid, efeito, tempo) doCreatureSay(cid, "FURIE", TALKTYPE_MONSTER) else doPlayerSendCancel(cid, "Sorry, you are transformed.") end end Depois, adicione na sua LIB: local effsTortos = { --[eff] = {valores para corrigi-los}, [175] = {x= 1, y= 0}, --naruto } function repeatEff(cid, eff, tempo) if not isCreature(cid) or tempo == 0 then return end local p = getThingPos(cid) if effsTortos[eff] then p = {x= p.x+(effsTortos[eff].x), y= p.y+(effsTortos[eff].y), z= p.z} end doSendMagicEffect(p, eff) addEvent(repeatEff, 500, cid, eff, tempo-1) end
-
(Resolvido)Comando de House (alana grav)
@WorkedBox <talkaction words="!sellhouse;/sellhouse" event="function" value="houseSell"/>
-
item X entregar pra X NPC é ganhar Epic Promotion
@ADM Mayk on BaiakME Não deu pra entender nada pelo tópico, então fiz essa gambiarra; NPCS XML <?xml version="1.0"?> <npc name="Promoter" script="data/npc/scripts/Promoter.lua" walkinterval="5000" floorchange="0"> <health now="100" max="100"/> <look type="12" head="95" body="116" legs="121" feet="115" addons="0"/> <parameters> <parameter key="message_greet" value="Hi |PLAYERNAME|. I carry out promotions. {promotion} {list}" /> </parameters> </npc> Script local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local config = { item = {{2155, 1}, {2160, 100}, {2150, 1}, {2349, 1}}, -- Lista de itens necessarios voc = 9, -- Vocation em q o player irá se transformar storage = 432211, storage2 = 43221, } if (msgcontains(msg, 'list')) then local str = "" str = str .. "Bring to me: " for name, pos in pairs(t) do str = str.." {".. pos[2] .."} {".. getItemInfo(pos[1]).name .."}," end str = str .. "." npcHandler:say(str, cid) end if (msgcontains(msg, 'promotion')) then if not isPremium(cid) then selfSay("Only premium account can do the promotion", cid) return true end if getPlayerVocation(cid) == config.voc then selfSay("You already held your promotion", cid) return true end for _, var in pairs(config.item) do if getPlayerItemCount(cid, var[1]) >= var[2] then if getCreatureStorage(cid, config.storage) == -1 then doCreatureSetStorage(cid, config.storage, 1) else doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage) + 1) end else doCreatureSetStorage(cid, config.storage, 0) selfSay("You do not have the necessary items, say {list} to know the required items", cid) return true end end if getCreatureStorage(cid, config.storage) > 0 and getCreatureStorage(cid, config.storage) < table.manx(config.item) then doCreatureSetStorage(cid, config.storage, 0) selfSay("You do not have the necessary items, say {list} to know the required items", cid) return true end if getCreatureStorage(cid, config.storage) >= table.maxn(config.item) then doCreatureSetStorage(cid, config.storage2, getPlayerVocation(cid)) doCreatureSetStorage(cid, config.storage, 0) for k, pid in pairs(config.item) do doPlayerRemoveItem(cid, pid[1], pid[2]) end doPlayerSetVocation(cid, config.voc) selfSay("Congratulations!! You have realized your promotion !!", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) CreatureScripts/scripts/Login.lua local config_promot = { promotion_vocs = {9, 10, 11, 12}, -- Vocaçoes de promotion PREMIUM storage2 = 43221 } if not isPremium(cid) and isInArray(config_promot.promotion_vocs, getPlayerVocation(cid)) then doPlayerSetVocation(cid, getCreatureStorage(cid, config_promot.storage2)) doPlayerSendTextMessage(cid, 27, "Sua P.A acabou e sua promotion também!!") end
-
(Resolvido)Por hp e mp por porcentagem % para OTX
@fr4nc1sc0 void ProtocolGame::AddPlayerStats(OutputMessage_ptr msg) { msg->put<char>(0xA0); if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0) { msg->put<uint16_t>(uint16_t(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH))); msg->put<uint16_t>(100); } else { msg->put<uint16_t>(0); msg->put<uint16_t>(0); } msg->put<uint32_t>(uint32_t(player->getFreeCapacity() * 100)); uint64_t experience = player->getExperience(); if(experience > 0x7FFFFFFF) // client debugs after 2,147,483,647 exp msg->put<uint32_t>(0x7FFFFFFF); else msg->put<uint32_t>(experience); msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT)); if (player->getPlayerInfo(PLAYERINFO_MAXMANA) > 0) { msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MANA) * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA)); msg->put<uint16_t>(100); } else { msg->put<uint16_t>(0); msg->put<uint16_t>(0); } msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_SOUL)); msg->put<uint16_t>(player->getStaminaMinutes()); }
-
[Erro] Limite de Sprites
@samuelbs Basta compilar o client no modo extendido, mas para isso terá que utilizar o OtClient ou usar a DLL que estende as Sprites Você pode baixar a DLL nesse LINK
-
(Resolvido)Comando de House (alana grav)
@WorkedBox <talkaction words="alana grav;!sell house" filter="word-spaced" event="function" value="houseSell"/>
-
[HELP] Cliente distorcido
Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!