• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

otcv8 block player attack by battle windows, enable only creature

johnsamir

Advanced OT User
Joined
Oct 13, 2009
Messages
915
Solutions
6
Reaction score
155
Location
Nowhere
I'm "customizing" OTCV removing features that are not used in lower protocol. my questions is related to battle
how i can make player shoot via battle only creature but not players?
 
As I remember, shoting 'via battle' is called useWithCreature in OTS engine and it is executed in Game::playerUseWithCreature in game.cpp.
In that function under:
C++:
Creature* creature = getCreatureByID(creatureId);
if (!creature) {
   return;
}
add:
C++:
if (creature->getPlayer()) {
   return;
}
 
As I remember, shoting 'via battle' is called useWithCreature in OTS engine and it is executed in Game::playerUseWithCreature in game.cpp.
In that function under:
C++:
Creature* creature = getCreatureByID(creatureId);
if (!creature) {
   return;
}
add:
C++:
if (creature->getPlayer()) {
   return;
}
Hello, thank you by your help.I want to disabe that from client, im using nekiro 7.72
want to disable shoot battle player via battle windows
 
Hello, thank you by your help.I want to disabe that from client, im using nekiro 7.72
want to disable shoot battle player via battle windows
I don't know how to disable it from client side, but its more important to block it on server side. So even players with bot/custom client cant shot via battle.
 
I don't know how to disable it from client side, but its more important to block it on server side. So even players with bot/custom client cant shot via battle.
didn't knew about it thanks ! with this im going to still be able to shoot monster via battle atleast? (because if it's for that this is the solution because Shotting runes through battle thanks @Hover Design for the code too! disable monster a player shoot on battle

Lua:
local creature = clickedWidget:getCreature()
if creature then
   if creature:isMonster() then
      g_game.useWith(selectedThing, creature, selectedSubtype)
   else
      modules.game_textmessage.displayFailureMessage(tr("Sorry, you can't shoot players on the battle window."))
   end
end
 
There is a config.lua setting to handle it server side regarding what @Gesior.pl was talking about.
That blocks rune onnhotkey but doe not prevent player player shoot runes to other players via battle window, I need to prevent that, think that is OTC thing related because in tibia it does work good.
In there you can only shoot creature using battle window, not others players.. you only cab heal if I'm not wrong.. but certainly not shoot attack runes nvia battle windows
 
didn't knew about it thanks ! with this im going to still be able to shoot monster via battle atleast? (because if it's for that this is the solution because Shotting runes through battle thanks @Hover Design for the code too! disable monster a player shoot on battle

Lua:
local creature = clickedWidget:getCreature()
if creature then
   if creature:isMonster() then
      g_game.useWith(selectedThing, creature, selectedSubtype)
   else
      modules.game_textmessage.displayFailureMessage(tr("Sorry, you can't shoot players on the battle window."))
   end
end
where does this code go? I am also trying to prevent players from being attacked by battle...
 
Back
Top