Ir para conteúdo

Oneshot

Marquês
  • Total de itens

    1347
  • Registro em

  • Última visita

  • Dias Ganhos

    36

Tudo que Oneshot postou

  1. Não adianta nada usar doConvinceCreature e outras funções se o monstro que será sumonado não possui a flag convinceable igual a 1.
  2. Oneshot

    Porfavor.

    Sandwitch
  3. Oneshot

    Auto Loot

    Colega, De vez em quando é interessante você mesmo usar o recurso Pesquisar para encontrar o que você quer nos fóruns, antes de criar um tópico de pedido. Autoloot System por MatheusMkalo
  4. Olá Fiz uma fórmula definida por uma função f(x) com os dados que você definiu. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 61) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 61) function getCombatValues(cid, level, maglevel) local min, max = (maglevel * 30/9), (maglevel * 55/9) return -min, -max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatValues") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end Creio que, assim, os jogadores de maglevel 10 irão tirar danos flutuando entre 100 e 150 e jogadores de maglevel 100 irão causar danos flutuando de 400 a 700.
  5. Ou veja se os jogadores começam com capacidade suficiente para todos os itens
  6. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 local talkState = {} local config = { itemid = 2157, price = {[2] = 5, [3] = 10, [4] = 20}, promotions = {[2] = "second", [3] = "third", [4] = "fourth"} } function onCreatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = (NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid) local promotionLevel = getPlayerPromotionLevel(cid) if msgcontains(msg, "promotion") then if config.promotions[promotionLevel + 1] then selfSay("Do you want to buy the ".. config.promotions[promotionLevel + 1] .." promotion for ".. config.price[promotionLevel + 1] .." ".. getItemInfo(config.itemid).plural .."?", cid) talkState[talkUser] = 1 else selfSay("Sorry, but I can't promote you.", cid) end elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if doPlayerRemoveItem(cid, config.itemid, config.price[promotionLevel + 1]) then selfSay("Congratulations! You are now promoted.", cid) setPlayerPromotionLevel(cid, promotionLevel + 1) else selfSay("Sorry, but you don't have enough ".. getItemInfo(config.itemid).plural ..".", cid) end elseif msgcontains(msg, "no") and isInArray({1}, talkState[talkUser]) then selfSay("Alright then, come back when you are ready.") talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback) npcHandler:setMessage(MESSAGE_GREET, "Hello. I can promote you for ".. getItemInfo(config.itemid).plural ..".") npcHandler:addModule(FocusModule:new()) Creio que você sabe criar novos NPCs, então deixei apenas o script dele. Ele apenas promove jogadores com a primeira promotion em diante. O preço de cada promotion você pode configurar aqui: price = {[2] = 5, [3] = 10, [4] = 20} No caso, a segunda promotion custa 5 gold nuggets, a terceira 10 gold nuggets e quarta 20 gold nuggets.
  7. Oneshot

    Gender Vocation

    std::string Player::getDescription(int32_t lookDistance) const { std::stringstream s; if(lookDistance == -1) { s << "yourself."; if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation)) s << " You are " << group->getName(); else if(vocationId != 0) s << " You are " << vocation->getDescription(); else s << " You have no vocation"; } else { s << nameDescription; if(!hasCustomFlag(PlayerCustomFlag_HideLevel)) s << " (Level " << level << ")"; s << ". " << (sex % 2 ? "He" : "She"); if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation)) s << " is " << group->getName(); else if(vocationId != 0) s << " is " << vocation->getDescription(); else s << " has no vocation"; s << getSpecialDescription(); } std::string tmp; if(marriage && IOLoginData::getInstance()->getNameByGuid(marriage, tmp)) { s << ", "; if(vocationId == 0) { if(lookDistance == -1) s << "and you are"; else s << "and is"; s << " "; } s << (sex % 2 ? "husband" : "wife") << " of " << tmp; } s << "."; if(guildId) { if(lookDistance == -1) s << " You are "; else s << " " << (sex % 2 ? "He" : "She") << " is "; s << (rankName.empty() ? "a member" : rankName)<< " of the " << guildName; if(!guildNick.empty()) s << " (" << guildNick << ")"; s << "."; } return s.str(); } Você precisa editar várias funções nas sources. Creio que você teria que editar a função que passei acima e editar estes em vocation.h const std::string& getDescription() const {return description;} void setDescription(const std::string& v) {description = v;} Aconselho criar dois const, um para cada sexo. E então editar essa parte da Player::getDescription { s << nameDescription; if(!hasCustomFlag(PlayerCustomFlag_HideLevel)) s << " (Level " << level << ")"; s << ". " << (sex % 2 ? "He" : "She"); if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation)) s << " is " << group->getName(); else if(vocationId != 0) s << " is " << vocation->getDescription(); else s << " has no vocation"; s << getSpecialDescription(); } Por exemplo: { s << nameDescription; if(!hasCustomFlag(PlayerCustomFlag_HideLevel)) s << " (Level " << level << ")"; s << ". " << (sex % 2 ? "He" : "She"); if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation)) s << " is " << group->getName(); else if(vocationId != 0) s << " is " << (sex % 2 ? vocation->getMaleDescription() : vocation->getFemaleDescription); else s << " has no vocation"; s << getSpecialDescription(); } Enfim isso é só um rascunho. Um grande abraço.
  8. Tem como sim. Você vai precisar de uma ferramenta conhecida pelo nome OTItemEditor e com ela, você abrirá seu arquivo items.otb, criando um ID novo mas usando uma sprite id existente. Deixo para você o endereço de download hospedado no Sourceforge. http://sourceforge.net/projects/opentibia/files/opentibia%20tools/otitemeditor-0.3.9/
  9. Boas dicas, mas um pouco superficiais. Existem várias outras funções na biblioteca math e string. Existem também outros símbolos matemáticos como ^ e %. E um erro: Storages são armazenados no banco de dados como VARCHAR. ou seja, não podem armazenar tabelas.
  10. Compreendo. Você usa uma versão "antiga" adaptada. Se não me engano, de fato, a pasta lib não existe no seu caso. E sim existe um arquivo só chamado global.lua. Então façamos assim: 1 - Crie um arquivo chamado forgesystem.lua na pasta raiz do seu servidor, ou seja, onde ficam o executável e as DLLs. 2 - Adicione a seguinte linha no fim do arquivo global.lua: dofile("forgesystem.lua")
  11. getThingPosition(getCreatureTarget(cid)) ??
  12. Você tem que adicionar o parâmetro -m64 nas opções do seu aplicativo usado para compilar as sources do The Forgotten Server.
  13. Oneshot

    Daftpunk Sign

    Opa, Startix. Legal ver você por aqui. Sei que você é um excelente designer e seus trabalhos mostram isso. Abraços.
  14. caotic, O código está simples, mas contém vários pequenos erros. Porque você chama o arquivo cardsystem.lua uma vez em cada função? Isso é totalmente desnecessário. Simplesmente use dofile no começo da biblioteca.
  15. maiconskavurska, Os erros são devidos a vários fatores e são todos relacionados com a falta de informações em seu banco de dados. Postarei a seguir as querys para execução e criação das tabelas e colunas necessárias para que esses erros não ocorram mais. Error during getDataInt(vipdays) ALTER TABLE `players` ADD vipdays INT(15) NOT NULL DEFAULT 0; OTSYS_SQLITE_PREPARE(): SQLITE ERROR CREATE TABLE guild_wars ( id INT(3) PRIMARY KEY NOT NULL UNIQUE, guild_id INT(3) NOT NULL, enemy_id INT(3) NOT NULL, guild_score INT(5) NOT NULL DEFAULT 0, enemy_score INT(5) NOT NULL DEFAULT 0, date BIGINT(20) NOT NULL DEFAULT 0, winner INT(3) NOT NULL DEFAULT 0, status INT(1) NOT NULL DEFAULT 1 ); sqlite3_step() Este erro não é consertado através de querys. Quando um sistema acessa seu banco de dados através da função db.getResult(...), a função "trava" o banco de dados. Para evitar esse erro, seria necessário o uso da função Result:free() que muitas vezes não está presente nos sistemas. Favor reportar qualquer dúvida e/ou resultado.
  16. Tente agora. function onCastSpell(cid, var) local direction = getCreatureLookDirection(cid) local size = 3 local toPosition = getPositionByDirection(getThingPosition(cid), direction, size) if isWalkable(toPosition, cid) then doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) doTeleportThing(cid, toPosition) doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end return true end
  17. sarioyana, A solução deste seu problema depende muito do seu servidor. Alguns baseados nas revisões do The Forgotten Server possuem um atributo para itens programado em C++ chamado levelDoor. Logo, você poderia criar um gate of expertise ao seu gosto manipulando esse atributo. Tomaremos como exemplo básico um gate of expertise em items.xml: <item id="5130" article="a" name="gate of expertise"> <attribute key="type" value="door" /> <attribute key="levelDoor" value="1000" /> <attribute key="blockprojectile" value="1" /> </item> No sistema de Gates of Expertise programado em seu arquivo doors.lua localizado em /data/actions, ele faz o seguinte cálculo. item.actionid - getItemInfo(item.itemid).levelDoor Logo para a criação de um Gate of Expertise de level 2000, você precisaria fazer as seguintes mudanças. <item id="5130" article="a" name="gate of expertise"> <attribute key="type" value="door" /> <attribute key="levelDoor" value="3000" /> <attribute key="blockprojectile" value="1" /> </item> E colocar o actionid pelo Editor de Mapas de sua preferência como 5000. Assim sendo teremos o seguinte: 5000 - 3000 = 2000 Lembrando que essas edições podem ser feitas em qualquer porta de sua preferência, desde que ela possua o atributo levelDoor. Reporte aqui quaisquer resultados das instruções acima.
  18. Desculpe, foi um erro meu e este já foi consertado.
  19. sarioyana, Para correto funcionamento do código deste post, siga as instruções com exatidão, prestando atenção para salvar as extensões pedidas corretamente. - Abra o arquivo 050-function.lua com um Bloco de Notas em /data/lib e, no final, adicione o seguinte código: function isWalkable(position, cid) position.stackpos = 0 if getTileThingByPos(position).uid ~= 0 then local tile = getTileInfo(position) if tile.protection == false and tile.house == false and getTopCreature(position).uid == 0 and doTileQueryAdd(cid, position) == RETURNVALUE_NOERROR then return true end end return false end - Crie um novo arquivo chamado dash.lua em /data/spells/scripts e adicione o seguinte código function onCastSpell(cid, var) local direction = getCreatureLookDirection(cid) local size = 3 local toPosition = getPositionByDirection(getThingPosition(cid), direction, size) if isWalkable(toPosition, cid) then doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) doTeleportThing(cid, toPosition) doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end return true end - Abra o arquivo spells.xml e adicione a seguinte linha: <instant name="Dash" words="dash" lvl="20" mana="18" exhaustion="2000" needlearn="0" event="script" value="dash.lua"/> Antes de: </spells> Reporte no tópico quaisquer resultados.
  20. Obrigado, Gustavo. Me deixe a par desse projeto sim. Abraços.
  21. Oneshot

    Erro No Items.xml

    Vê se presta mais atenção na próxima vez que for editar seu arquivo items.xml. Download (Versão Corrigida): Speedy Share
  22. local experience = { [{1, 149}] = {600000, 700000}, [{150, 199}] = {800000, 900000}, [{200, 249}] = {1000000, 1100000}, [{250, 299}] = {1200000, 1300000}, [{300, 349}] = {1400000, 1500000}, [{350, 399}] = {1600000, 1700000}, [{400, 449}] = {1800000, 1900000}, [{450, 499}] = {2000000, 2100000}, [{500, 509}] = {2200000, 2300000} } function onUse(cid, item, fromPosition, itemEx, toPosition) local level, amount = getPlayerLevel(cid) if getPlayerSoul(cid) >= 250 then for k, v in pairs(experience) do if level >= k[1] and level <= k[2] then amount = math.random(unpack(v)) break end end if amount then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu ".. amount .." de experiência.") doSendAnimatedText(fromPosition, amount, COLOR_WHITE) doPlayerAddExperience(cid, amount) doPlayerAddSoul(cid, -250) doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "Você não pode usar mais esse item") end else doPlayerSendCancel(cid, "Você não tem almas suficientes.") end return true end
  23. <?xml version="1.0" encoding="UTF-8"?> <vocations> <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="10" gainmanaticks="6" gainmanaamount="10" manamultiplier="4.0" attackspeed="1000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="2.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.5"/> <skill id="1" multiplier="2.0"/> <skill id="2" multiplier="2.0"/> <skill id="3" multiplier="2.0"/> <skill id="4" multiplier="2.0"/> <skill id="5" multiplier="1.5"/> <skill id="6" multiplier="1.1"/> </vocation> <vocation id="1" name="Master Sorcerer" description="a master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="200" manamultiplier="1.1" attackspeed="600" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="10"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.5"/> <skill id="1" multiplier="2.0"/> <skill id="2" multiplier="2.0"/> <skill id="3" multiplier="2.0"/> <skill id="4" multiplier="2.0"/> <skill id="5" multiplier="1.5"/> <skill id="6" multiplier="1.1"/> </vocation> <vocation id="2" name="Elder Druid" description="an elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="100" gainmanaticks="2" gainmanaamount="200" manamultiplier="1.1" attackspeed="600" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="10"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.5"/> <skill id="1" multiplier="1.8"/> <skill id="2" multiplier="1.8"/> <skill id="3" multiplier="1.8"/> <skill id="4" multiplier="1.8"/> <skill id="5" multiplier="1.5"/> <skill id="6" multiplier="1.1"/> </vocation> <vocation id="3" name="Royal Paladin" description="a royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2" gainhpamount="150" gainmanaticks="2" gainmanaamount="150" manamultiplier="1.4" attackspeed="600" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="10"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.2"/> <skill id="1" multiplier="1.2"/> <skill id="2" multiplier="1.2"/> <skill id="3" multiplier="1.2"/> <skill id="4" multiplier="1.1"/> <skill id="5" multiplier="1.1"/> <skill id="6" multiplier="1.1"/> </vocation> <vocation id="4" name="Elite Knight" description="an elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="200" gainmanaticks="2" gainmanaamount="100" manamultiplier="3.0" attackspeed="600" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="10"> <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.1"/> <skill id="1" multiplier="1.1"/> <skill id="2" multiplier="1.1"/> <skill id="3" multiplier="1.1"/> <skill id="4" multiplier="1.4"/> <skill id="5" multiplier="1.1"/> <skill id="6" multiplier="1.1"/> </vocation> <vocation id="5" name="Master Sorcerer (VIP)" description="an master sorcerer (vip)" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="200" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="600" soulmax="299" gainsoulticks="15" fromvoc="1" lessloss="40"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.5"/> <skill id="1" multiplier="2.0"/> <skill id="2" multiplier="2.0"/> <skill id="3" multiplier="2.0"/> <skill id="4" multiplier="2.0"/> <skill id="5" multiplier="1.5"/> <skill id="6" multiplier="1.1"/> </vocation> <vocation id="6" name="Elder Druid (VIP)" description="an elder druid (vip)" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="200" gainmanaticks="2" gainmanaamount="300" manamultiplier="1.1" attackspeed="600" soulmax="299" gainsoulticks="15" fromvoc="2" lessloss="40"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.5"/> <skill id="1" multiplier="1.8"/> <skill id="2" multiplier="1.8"/> <skill id="3" multiplier="1.8"/> <skill id="4" multiplier="1.8"/> <skill id="5" multiplier="1.5"/> <skill id="6" multiplier="1.1"/> </vocation> <vocation id="7" name="Royal Paladin (VIP)" description="an royal paladin (vip)" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2" gainhpamount="250" gainmanaticks="2" gainmanaamount="250" manamultiplier="1.4" attackspeed="600" soulmax="299" gainsoulticks="15" fromvoc="3" lessloss="40"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.2"/> <skill id="1" multiplier="1.2"/> <skill id="2" multiplier="1.2"/> <skill id="3" multiplier="1.2"/> <skill id="4" multiplier="1.1"/> <skill id="5" multiplier="1.1"/> <skill id="6" multiplier="1.1"/> </vocation> <vocation id="8" name="Elite Knight (VIP)" description="an elite knight (vip)" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="300" gainmanaticks="2" gainmanaamount="200" manamultiplier="3.0" attackspeed="600" soulmax="299" gainsoulticks="15" fromvoc="4" lessloss="40"> <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.1"/> <skill id="1" multiplier="1.1"/> <skill id="2" multiplier="1.1"/> <skill id="3" multiplier="1.1"/> <skill id="4" multiplier="1.4"/> <skill id="5" multiplier="1.1"/> <skill id="6" multiplier="1.1"/> </vocation> </vocations> Abraços.
  24. Olá, klauguns. Poste a seguir o conteúdo do arquivo vocations.xml localizado, geralmente, em data/XML.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...