jhon992 371 Posted September 6, 2011 Report Share Posted September 6, 2011 (edited) Esse sistema serve para que você possa usar duas weapons ao mesmo tempo uma em cada slot correspondente as mãos do personagem. Com ele você pode utilizar duas sword's, dois axe's, dois club's ou etc... Esse sistema simplismente soma o attack do item que estiver no slot esquerdo com o attack do item que estiver no slot esquerdo. Aew vai os code para inserir nas sources! Vá em player.ccp e procure por: ret = RET_CANONLYUSEONEWEAPON; Você ira encontrar dois "ret = RET_CANONLYUSEONEWEAPON;", substitua por: ret = RET_NOERROR; Após, localize weapons.h e procure por: const Weapon* getWeapon(const Item* item) const; Embaixo você coloca: static int32_t getAttackLeft; static int32_t getAttackRigth; static int32_t getLeftExtraAttack; static int32_t getRigthExtraAttack; Depois, localize weapons.ccp e procure por: int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const { int32_t attackSkill = player->getWeaponSkill(item); int32_t attackValue = std::max((int32_t)0, (int32_t(item->getAttack() + item->getExtraAttack()) - elementDamage)); float attackFactor = player->getAttackFactor(); Substitua por: int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const { int32_t getAttackLeft; int32_t getAttackRigth; int32_t getLeftExtraAttack; int32_t getRigthExtraAttack; getAttackLeft = 0; getAttackRigth = 0; getLeftExtraAttack = 0; getRigthExtraAttack = 0; if (getAttackLeft == 0) { if (player->getInventoryItem(SLOT_LEFT) != NULL) { getAttackLeft = player->getInventoryItem(SLOT_LEFT)->getAttack(); getLeftExtraAttack = player->getInventoryItem(SLOT_LEFT)->getExtraAttack(); } else if (player->getInventoryItem(SLOT_LEFT) == NULL) { getAttackLeft = 0; getLeftExtraAttack = 0; } } if (getAttackRigth == 0) { if (player->getInventoryItem(SLOT_RIGHT) != NULL) { getAttackRigth = player->getInventoryItem(SLOT_RIGHT)->getAttack(); getRigthExtraAttack = player->getInventoryItem(SLOT_RIGHT)->getExtraAttack(); } else if (player->getInventoryItem(SLOT_RIGHT) == NULL) { getAttackRigth = 0; getRigthExtraAttack = 0; } } int32_t attackValue = std::max((int32_t)0, (int32_t)((getAttackLeft + getLeftExtraAttack + getAttackRigth + getRigthExtraAttack) - elementDamage)); int32_t attackSkill = player->getWeaponSkill(item); float attackFactor = player->getAttackFactor(); Compile e pronto! Edited September 8, 2011 by Jhon992 Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/ Share on other sites More sharing options...
Leoprotons 35 Posted September 7, 2011 Report Share Posted September 7, 2011 Nossa bacana nunca tinha pensado numa coisa dessas. parabens. rep+ pra ti Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1098821 Share on other sites More sharing options...
Adriez 6 Posted September 14, 2011 Report Share Posted September 14, 2011 fmz manos ?? teria como eu fazer sword rancar igual a wand eu configurar de 1 milhao ate 5 milhao so q o atak bater normal melee msm sword ?? flws fmz Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1102488 Share on other sites More sharing options...
OcruxBiel 4 Posted September 15, 2011 Report Share Posted September 15, 2011 Cara eu nunca mexi em programação de tibia so mais um scripter intermediatio. Eu queria saber se você não explica melhor para mim, ou mande um tutorial de alguem. Obs:Entendo rapido :X Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1103003 Share on other sites More sharing options...
LukasScott 2 Posted September 15, 2011 Report Share Posted September 15, 2011 Vc poderia colokar isso como uma opção adcional a arma de sua escolha ao enves de poder utilizar qualquer arma em conjunto , seria só alterar em weapons.xml as armas que vc uzaria em conjuto tipo só poderá ser uzada 2 spike sword se eu tentar colokar 2 armas que não se possa uzar em conjunto eu num conseguiria. Acho que ficaria muito melhor assim. Obrigado por trazer conteudo pro xtibia Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1103012 Share on other sites More sharing options...
OcruxBiel 4 Posted September 15, 2011 Report Share Posted September 15, 2011 (edited) @LukasScott Também axo cara, Dai tipo podia deixar só com dagger da preferencia do dono do servidor.... [EX: 2 ASSASSIN DAGGER] Edit** Eu to aprendendo a mexe em programação do tibia só para mim coloca isso no meu serv... ali no "ret = RET_NOERROR;" isso coloca no 1 ou no segundo "ret = RET_CANONLYUSEONEWEAPON;"... Coloquei nos 2 e não deu certo :neutral: Edited September 15, 2011 by OcruxBiel Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1103015 Share on other sites More sharing options...
jhon992 371 Posted September 15, 2011 Author Report Share Posted September 15, 2011 (edited) OcruxBiel que tipo de erro ocorreu, foi na hora de compilar ou no proprio jogo? Me explica melhor que eu te ajudo, e acho dificil achar algum tutorial de alguem pois eu que criei esse sistema e esse é o unico tutorial. LukasScott, eu criei desse modo pois meu problema,objetivo foi implementar exatamente esse codigo para utilização no meu otserv. E assim foi um meio pelo qual eu consegui fazer isso. E resolvi disponibilizar pra enriqueser o conteudo do :XTibia_smile: com um novo sistema. :icon1: . Se quiser modificar fique a vontade :smile_positivo: Adriez, sua duvida não é relacionada a este topico. Mesmo assim irei sanar sua duvida! Na pasta do seu servidor entre em \weapons\scripts, copia algum arquivo e cole, renomei essa copia para 'sword' sem as aspas. E abra,cole o code e salve: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -1000000, 0, -5000000) function onUseWeapon(cid, var) return doCombat(cid, combat, var) end Agora na pasta \weapons\ , abra o arquivo weapons.xml, adicione a tag abaixo e salve: <melee id="id da espada" level="lvl para usar" script="sword.lua"> </melee> Pronto, esta aew sua sword hitando estilo wand! No arquivo sword você podera mudar '-1000000' e '-5000000' que será a variação de hits. Na linha 'id da espada' e 'lvl para usar' da nova tag você devera mudar conforme quiser. Edited September 16, 2011 by Jhon992 Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1103385 Share on other sites More sharing options...
LukasScott 2 Posted September 16, 2011 Report Share Posted September 16, 2011 @Jhon992 Você tem certeza que vc que criou esse cod?ou só está trazendo conteudo? Pois é simples fazer oq eu falei , se vc realmente fez esse cod sabe disso. Só não vou editalo pois estou ocupado desenvolvendo um novo client para o opentibia. Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1103522 Share on other sites More sharing options...
OcruxBiel 4 Posted September 16, 2011 Report Share Posted September 16, 2011 @Jhon992 O meu erro e na hora de copilar. NÃO LER O WEAPONS QUE VOCÊ MANDO EDITA :lamo: Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1103576 Share on other sites More sharing options...
jhon992 371 Posted September 16, 2011 Author Report Share Posted September 16, 2011 OcruxBiel, tenta refazer passo a passo desde o inicio do tutorial. Você deve ter errado algum passo ali no weapons.h ou no weapons.ccp. Depois de refazer, se continuar dando erro, copie e cole o console de erro aqui pra min dar uma olhada! :smile_positivo: Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1103657 Share on other sites More sharing options...
wesleykun 1 Posted September 24, 2011 Report Share Posted September 24, 2011 Muito Bom.Eu precisava disso para uma vocação só tem como ??? Se tiver REP+ Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1107512 Share on other sites More sharing options...
jhon992 371 Posted September 28, 2011 Author Report Share Posted September 28, 2011 (edited) LordXD2010, nem tenho tempo pra fazer isso desculpa aew. :confused: Edited September 28, 2011 by Jhon992 Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1108794 Share on other sites More sharing options...
paulgrande 23 Posted September 28, 2011 Report Share Posted September 28, 2011 isso é facil de fazer e so usar fazer uma checagem na hora de equipar pode fazer isso em lua com moveevents ou na source msm Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1108896 Share on other sites More sharing options...
pippen 0 Posted November 24, 2011 Report Share Posted November 24, 2011 Muito legal velho, nota 10 em criatividade e me ajudo muito em um projeto que estou criando =) . Rep+ pra ti Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1138342 Share on other sites More sharing options...
Kryzed 0 Posted December 18, 2011 Report Share Posted December 18, 2011 Dica: Após o cara estar portando 2 Weapons aumentar o Speed Attack. Link to comment https://xtibia.com/forum/topic/167172-two-weapons-system/#findComment-1155422 Share on other sites More sharing options...
Recommended Posts