punkndisaster 0 #1 Posted February 26, 2007 Sabe como funciona, só o char que tirou maior dano que consegue abrir e mover o loot e depois de 10s ele fica normal, podendo os outros abrirem e moverem. Vamos ao code: nessa função ReturnValue Actions::internalUseItem(Player* player, const Position& pos, uint8_t index, Item* item) procure por: if(item->isReadable()){ if(item->canWriteText()){ player->sendTextWindow(item, item->getMaxWriteLength(), true); } else{ player->sendTextWindow(item, 0, false); } return RET_NOERROR; } abaixo disso, adicione: #ifdef THIEF if(item->moveTicks > 0 && item->ownerBody != player->ownerBody && player->party == NULL) { player->sendCancelMessage(RET_NOTOWNER); return RET_NOTOWNER; } #endif agora procure por isso em configmanager.cpp m_confInteger[MAX_SUMMONS] = getGlobalNumber(L, "maxsummons", 2); acima disso, adicione: #ifdef THIEF m_confInteger[THIEF_TIME] = getGlobalNumber(L, "antithieftime", 30); #endif procure por isso em configmanager.h: #ifdef __JD_DEATH_LIST__ MAX_DEATH_ENTRIES, #endif acima disso, adicione: #ifdef THIEF THIEF_TIME, #endif em creature.cpp, procure por: blockTicks = 0; abaixo adicione: #ifdef THIEF ownerBody = 0; moveTicks = 0; #endif agora nessa função Item* Creature::getCorpse() procure por: Item* corpse = Item::CreateItem(getLookCorpse()); Acima adicione: #ifdef THIEF Creature* lastHitCreature = NULL; Creature* mostDamageCreature = NULL; #endif abaixo disso: Item* corpse = Item::CreateItem(getLookCorpse()); adicione: #ifdef THIEF if(getKillers(&lastHitCreature, &mostDamageCreature) && mostDamageCreature) { int32_t thief = g_config.getNumber(ConfigManager::THIEF_TIME); corpse->moveTicks = thief; corpse->ownerBody = (int)mostDamageCreature; mostDamageCreature->ownerBody = (int)mostDamageCreature; } #endif procure por: bool isInPz() const {return getTile()->hasProperty(PROTECTIONZONE);} abaixo adicione: #ifdef THIEF int ownerBody; int moveTicks; #endif em void Game::moveItem(Player* player, Cylinder* fromCylinder, Cylinder* toCylinder, int32_t index, Item* item, uint32_t count, uint16_t spriteId) procure por: ReturnValue ret = RET_NOERROR; if(!item->isPushable() || item->getUniqueId() != 0){ ret = RET_NOTMOVEABLE; } abaixo disso adicione: #ifdef THIEF else if(item->moveTicks > 0){ player->sendCancelMessage(RET_NOTMOVEABLE); return; } #endif procure por isso: for(DecayList::iterator it = decayItems.begin(); it != decayItems.end(){ item = *it; item->decreaseDuration(interval); abaixo adicione: #ifdef THIEF if (item->moveTicks > 0){ item->moveTicks -= 10; } if (item->moveTicks < 0){ item->moveTicks == 0; } #endif em Item::Item(const unsigned short _type, unsigned short _count /*= 0*/) : ItemAttributes() procure por: charges = it.charges; fluid = 0; abaixo adicione: #ifdef THIEF moveTicks = 0; ownerBody = 0; #endif agora em Item::Item(const Item &i) : ItemAttributes() procure por: id = i.id; count = i.count; charges = i.charges; fluid = i.fluid; abaixo adicione: #ifdef THIEF moveTicks = 0; ownerBody = 0; #endif procure por: void getLight(LightInfo& lightInfo); abaixo adicione: #ifdef THIEF int moveTicks; int ownerBody; #endif procure por: case RET_DIRECTPLAYERSHOOT: sendCancel("You are not allowed to shoot directly on players."); break; abaixo adicione: #ifdef THIEF case RET_NOTOWNER: sendCancel("You are not the owner."); break; #endif procure por: RET_YOUMUSTTURNSECUREMODEOFF = 45 substitua isso, por isso: RET_YOUMUSTTURNSECUREMODEOFF = 45, #ifdef THIEF RET_NOTOWNER = 46, #endif Aperte Alt+p -> Parameter -> C++ Compiler, e adicione isso: -DTHIEF em config.lua em qualquer lugar adicione: --time for open or move a dead monster anti thief system(1 = 1 second) antithieftime = 10 Agora dê Rebuild All (Ctrl+F11). É isso o code. :wink: Share this post Link to post
Mattewzao 0 #2 Posted February 26, 2007 Legal, vo testa se funciona eu edito aqui ;D mas ele evita ser roubado em que? Share this post Link to post
Jackson Zani 1 #3 Posted February 26, 2007 muito bom esse code parabens punkndisaster mais esse code poderia ser melhor deveria ser por exp e não por damage hehehe. abraços! Edite: Você não mostrou onde estão os codes que tem que visualizar! Asim ninguem consiguirá Arruma ai. Abraços! Share this post Link to post
punkndisaster 0 #4 Posted February 28, 2007 @jackson Agora entendi. :oops: Obrigado pela dica. vo mudar no main post.:wink: @Mattewzao Sabe o loot, que vc só abre se foi vc quem tiro maior dano da mosnter, que nem no tibia global. Vc tenta abrir o loot(roubar de quem realmente matou) e aparece a mensagem: You are not the Owner. Share this post Link to post
Jackson Zani 1 #5 Posted February 28, 2007 @punkndisaster ali tu diz em []bItem::Item(const unsigned short _type, unsigned short _count /*= 0*/) : ItemAttributes() procure por: Tu nem fala onde é pra add isso! Ex do lugar: game.cpp Não tem em nennhuma, dai fica dificil para novatos.. Share this post Link to post
Dr0p 0 #6 Posted March 3, 2007 Compiler: Default compiler Building Makefile: "C:\projetos\SVN_Sources_25_02_07\Makefile.win" Executing make clean rm -f account.o actions.o admin.o allocator.o ban.o baseevents.o chat.o combat.o commands.o condition.o configmanager.o container.o creature.o cylinder.o database.o databasemysql.o depot.o fileloader.o game.o house.o housetile.o ioaccount.o ioaccountsql.o ioaccountxml.o iomapotbm.o iomapserialize.o iomapserializesql.o iomapserializexml.o iomapxml.o ioplayer.o ioplayersql.o ioplayerxml.o item.o items.o logger.o luascript.o mailbox.o map.o md5.o monster.o monsters.o movement.o networkmessage.o npc.o otserv.o outfit.o player.o position.o protocol79.o raids.o rsa.o scriptmanager.o spawn.o spells.o status.o talkaction.o teleport.o thing.o tile.o tools.o trashholder.o vocation.o waitlist.o weapons.o exception.o quests.o beds.o Celestia_RPG_private.res "Celestia RPG.exe" g++.exe -c account.cpp -o account.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -DWIN32 -D__USE_MYSQL__ -D__COMBAT_ZONES__ -DTALA_QUESTLOG -DBEDS_SYSTEM__ -D__CRITICAL_HIT__ -D__BB_ANTI_LURE__ -DZORZIN_BUY_SELL -DKILL_GMLOOK -D__SKULLSYSTEM__ -DTHIEF g++.exe -c actions.cpp -o actions.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -DWIN32 -D__USE_MYSQL__ -D__COMBAT_ZONES__ -DTALA_QUESTLOG -DBEDS_SYSTEM__ -D__CRITICAL_HIT__ -D__BB_ANTI_LURE__ -DZORZIN_BUY_SELL -DKILL_GMLOOK -D__SKULLSYSTEM__ -DTHIEF In file included from cylinder.h:25, from tile.h:26, from creature.h:31, from player.h:25, from actions.cpp:24: thing.h:75: error: expected `}' before "RET_NOTOWNER" thing.h:75: error: invalid conversion from `int' to `ReturnValue' thing.h:77: error: expected unqualified-id before '}' token thing.h:77: error: expected `,' or `;' before '}' token thing.h:77: error: expected declaration before '}' token In file included from cylinder.h:25, from tile.h:26, from creature.h:31, from player.h:25, from actions.cpp:24: thing.h:21:1: unterminated #ifndef In file included from tile.h:26, from creature.h:31, from player.h:25, from actions.cpp:24: cylinder.h:21:1: unterminated #ifndef In file included from creature.h:31, from player.h:25, from actions.cpp:24: tile.h:23:1: unterminated #ifndef In file included from player.h:25, from actions.cpp:24: creature.h:22:1: unterminated #ifndef In file included from actions.cpp:24: player.h:21:1: unterminated #ifndef make.exe: *** [actions.o] Error 1 Execution terminated EDIT: erros corrigidos x) Share this post Link to post
Dark Mauri 0 #8 Posted March 14, 2007 donde podo encontrar esto? RET_YOUMUSTTURNSECUREMODEOFF = 45 ¿? trobado x) Share this post Link to post
punkndisaster 0 #9 Posted March 14, 2007 @Dark Mauri é em Thing.h Você adiciona depois do ultimo, por exemplo: se seu ultimo for: RET_YOUDONOTHAVEAPREMIUMACCOUNT = 46 aí vc adiona a vírgula no fim, ficando assim: RET_YOUDONOTHAVEAPREMIUMACCOUNT = 46, e em baixo coloca isso: RET_NOTOWNER = 47, entendeu?? Espero ter te ajudado, qualquer coisa só perguntar. :wink: Share this post Link to post
Seven 0 #10 Posted March 22, 2007 jackson se eh por damage eh claro q quem tira maior damage ganha mais xp otimo isso ae mt bom pros :twisted: UHUEHUE :wink: flws ae Share this post Link to post
Toninho 0 #11 Posted April 15, 2007 finalmente consegui coloca esse teu code em creature.cpp, procure por: Código: blockTicks = 0; isso que vc disse tem 2 no mesmo lugar eu dava ctrl+f e dava em 1 ai sempre dava bug hoje fui de novo e dei shift+alt+f ai deu 2 ai tentei no de baixo e deu certo bem legal mesmo edita isso ai fala mais informaçoes de qual blockticks usa vlw Share this post Link to post
Danilo RoxX 0 #12 Posted April 17, 2007 Bem Roxzim As Sugestões Tb =P ^^ Flws Share this post Link to post
Fusion 0 #13 Posted April 26, 2007 porra velho arruma issu ae pq u pessoal nab q nen eu nao sabe onde q tem q coloka as coisa ae neh Share this post Link to post
Fusion 0 #14 Posted April 26, 2007 porra velho arruma issu ae pq u pessoal nab q nen eu nao sabe onde q tem q coloka as coisa ae neh Share this post Link to post
Jackson Zani 1 #15 Posted April 26, 2007 @Fusion ehiaohoiea Isso é simples cara, vou lhe ensinar Lá em cima ele fala agora em Item::Item(const Item &i) : Mas ele não falou aonde colocar isso no .cpp ou .h certo? Muito bem, abra as sources aonde você quer adicionar o code, É muito facil achar isso. Inglês Você vái em Search(procurar) depois em Find in Files(Achar nas linhas) e digita lá Item::Item(const Item &i) : Se tiver esse code na source, não importa aonde esteja vai aparecer ali e é só você clicar PS: Para ir direto no Find in Files basta você fazer: Shift+Alt+F Espero ter te ajudado brow! abração! Share this post Link to post
Jackson Zani 1 #16 Posted April 26, 2007 @Fusion ehiaohoiea Isso é simples cara, vou lhe ensinar Lá em cima ele fala agora em Item::Item(const Item &i) : Mas ele não falou aonde colocar isso no .cpp ou .h certo? Muito bem, abra as sources aonde você quer adicionar o code, É muito facil achar isso. Inglês Você vái em Search(procurar) depois em Find in Files(Achar nas linhas) e digita lá Item::Item(const Item &i) : Se tiver esse code na source, não importa aonde esteja vai aparecer ali e é só você clicar PS: Para ir direto no Find in Files basta você fazer: Shift+Alt+F Espero ter te ajudado brow! abração! Share this post Link to post
RaFa 0 #20 Posted May 8, 2007 plz alguém pode editar para que não seja possível para players FORA DA PARTY roubar loot? ai facilita para quem caça em grupo, coisa comum em OT de exp baixa (é claro, num periodo de 10segundos ^^) Share this post Link to post