• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

you can only use this rune on creatures - OTCV8 Client

dropz

Member
Joined
May 4, 2022
Messages
40
Reaction score
17
hello everyone!

i came here to ask you guys some help about this issue
i spent a few days fixing some stuffs inside the data/modules of OTCV8 to put him to work in my private server..

u guys probably will came with some questions like:

why u using OTCV8 if they dont share the src code letting you stucked in some problems?

well, i choose him cuz was the mostly simple mode that i found to hide/encrypt the data/module and other files of the client cuz im not expert one in encryption stuffs so i though to choose this road to dont spend more good days needing study encryption and how to hide files.. not cuz im lazy but cuz im without time to get focused in whole stuffs that need learn to get succeed into encryption also had searched about encryption and otclient-edubart and don't find too much contents.
so explaining this to try be clear heres my question..

someone know how to fix this problem when running and using runes in the battle against monsters came a poof and appears "You can only use this rune on creatures"?

have something that i can do in modules of the client to fix it? or is better i just giveup of this client and start focus on encryption and use otclient - edubart for my goal? or another one if u guys have some tips i will be glad.

thank you in advance.

note: if i reach how to fix it probably the client will be ready to use but i have a almost certain about probably this is unfixable just using the modules :/
Post automatically merged:

up?
 
Last edited:
OP
OP
dropz

dropz

Member
Joined
May 4, 2022
Messages
40
Reaction score
17
BUMP


heres some threads that i found with the same issue and as i can see without solution (yet :D)




c'mon duds i know u "hidding the game"
 

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,776
Solutions
91
Reaction score
2,813
Location
Poland
GitHub
gesior
What Tibia protocol version do you use?
Shoting to creatures by battle window is available from some version of Tibia [7.8]. If you are running some old protocol (ex. 7.72), OTC works like bots did on these protocol. It uses packet 'shot rune on position', if creature is moving very fast and you got some ping (ex. 30-50 ms), it may shot to tile on which creature was 1 step ago, so server return that there is no monster on position.

FIX

OTCv8 source ( otcv8-dev/game.cpp at master · OTCv8/otcv8-dev (https://github.com/OTCv8/otcv8-dev/blob/master/src/client/game.cpp#L872-L887) ):
Code:
void Game::useWith(const ItemPtr& item, const ThingPtr& toThing, int subType)
{
    if(!canPerformGameAction() || !item || !toThing)
        return;

    Position pos = item->getPosition();
    if(!pos.isValid()) // virtual item
        pos = Position(0xFFFF, 0, 0); // means that is an item in inventory

    if(toThing->isCreature() && (g_game.getProtocolVersion() >= 780 || g_game.getFeature(Otc::GameForceAllowItemHotkeys)))
        m_protocolGame->sendUseOnCreature(pos, item->getId(), subType ? subType : item->getStackPos(), toThing->getId());
    else
        m_protocolGame->sendUseItemWith(pos, item->getId(), subType ? subType : item->getStackPos(), toThing->getPosition(), toThing->getId(), toThing->getStackPos());

    g_lua.callGlobalField("g_game", "onUseWith", pos, item->getId(), toThing, subType);
}
It checks if protocol is >= 780, if you want to make it work on 7.72, you need to enable OTCv8 feature g_game.getFeature(Otc::GameForceAllowItemHotkeys)
If you are using Nostalrius, packet [that handle 'useWithCreature'] from 7.80+ is still there:
so it should work without changes on server side.

This OTCv8 feature you can enable by adding:
Code:
g_game.enableFeature(GameForceAllowItemHotkeys)
in this line:
 
OP
OP
dropz

dropz

Member
Joined
May 4, 2022
Messages
40
Reaction score
17
What Tibia protocol version do you use?
Shoting to creatures by battle window is available from some version of Tibia [7.8]. If you are running some old protocol (ex. 7.72), OTC works like bots did on these protocol. It uses packet 'shot rune on position', if creature is moving very fast and you got some ping (ex. 30-50 ms), it may shot to tile on which creature was 1 step ago, so server return that there is no monster on position.

FIX

OTCv8 source ( otcv8-dev/game.cpp at master · OTCv8/otcv8-dev (https://github.com/OTCv8/otcv8-dev/blob/master/src/client/game.cpp#L872-L887) ):
Code:
void Game::useWith(const ItemPtr& item, const ThingPtr& toThing, int subType)
{
    if(!canPerformGameAction() || !item || !toThing)
        return;

    Position pos = item->getPosition();
    if(!pos.isValid()) // virtual item
        pos = Position(0xFFFF, 0, 0); // means that is an item in inventory

    if(toThing->isCreature() && (g_game.getProtocolVersion() >= 780 || g_game.getFeature(Otc::GameForceAllowItemHotkeys)))
        m_protocolGame->sendUseOnCreature(pos, item->getId(), subType ? subType : item->getStackPos(), toThing->getId());
    else
        m_protocolGame->sendUseItemWith(pos, item->getId(), subType ? subType : item->getStackPos(), toThing->getPosition(), toThing->getId(), toThing->getStackPos());

    g_lua.callGlobalField("g_game", "onUseWith", pos, item->getId(), toThing, subType);
}
It checks if protocol is >= 780, if you want to make it work on 7.72, you need to enable OTCv8 feature g_game.getFeature(Otc::GameForceAllowItemHotkeys)
If you are using Nostalrius, packet [that handle 'useWithCreature'] from 7.80+ is still there:
so it should work without changes on server side.

This OTCv8 feature you can enable by adding:
Code:
g_game.enableFeature(GameForceAllowItemHotkeys)
in this line:
awesome!!!

adding the:
g_game.enableFeature(GameForceAllowItemHotkeys)

on the feature module as you told the poofs and msgs of "you can only shoot this rune on creatures" gone when running and shooting runes on creatures using the battlelist!!


buut for now im having a new issue in the client that doenst allow me use runes/fluids on myself now appearing the msg "you are not allowed to shoot directly on players", probably enabling this feature in the module create a conflict with another feature that have for use the runes and now i need discover how to solve it.

if i understood u told to add the g_game.getFeature(Otc::GameForceAllowItemHotkeys) in source code files of OTCV8-dev but as i can see the dev version of OTCV8 has some impeditives to use the executable with all the features like optimization and cant running it for more than 1hour so i didnt made this change... is it the reason why now appearing this new issue? cuz i dont think the dev version can be useful with this impeditives even doing this changes and if them worths properly how im gonna made useful this version?

anyway thank you very much @Gesior.pl! you are rox <3

gif-1.gif
note: if i keep trying use uh/hmm/fluids on myself sometimes them works(?) but at the mostly times that i try the error came. (strange behavior)


and thats how my function of onUseWith is in /modules/gameinterface/gameinterface.lua:
Lua:
function onUseWith(clickedWidget, mousePosition)
  if clickedWidget:getClassName() == 'UIGameMap' then
    local tile = clickedWidget:getTile(mousePosition)
    if tile then
      if selectedThing:isFluidContainer() or selectedThing:isMultiUse() then
        g_game.useWith(selectedThing, tile:getTopMultiUseThing())
      else
        g_game.useWith(selectedThing, tile:getTopUseThing())
      end
    end
  elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then
    g_game.useWith(selectedThing, clickedWidget:getItem())
  elseif clickedWidget:getClassName() == 'UICreatureButton' then
    local creature = clickedWidget:getCreature()
    if creature then
      if creature:isPlayer() then
        g_game.useInventoryItemWith(selectedThing:getId(), creature)
      else
        g_game.useWith(selectedThing, creature)
      end
    end
  end
end

can i do something in this function to make it works properly?
 
Last edited:

kay

Legendary OT User
Joined
Apr 23, 2013
Messages
1,066
Solutions
11
Reaction score
1,506
Location
32316,31942,7
YouTube
TibiantisOnline
What Tibia protocol version do you use?
Shoting to creatures by battle window is available from some version of Tibia [7.8]. If you are running some old protocol (ex. 7.72), OTC works like bots did on these protocol. It uses packet 'shot rune on position', if creature is moving very fast and you got some ping (ex. 30-50 ms), it may shot to tile on which creature was 1 step ago, so server return that there is no monster on position.
What? Using runes on monsters had always been possible in battle window. Version 7.8 only allowed using them on players also (plus hotkeys).
And if that's how it works in otc, then it's simply wrong, because it didn't use "shoot on position" function and in fact you never could miss via battle window - not in 7.8 and not any time earlier.
 

Source

Intermediate OT User
Joined
May 31, 2020
Messages
141
Reaction score
132
Location
OpenTibia .dev
GitHub
source61
What? Using runes on monsters had always been possible in battle window. Version 7.8 only allowed using them on players also (plus hotkeys).
And if that's how it works in otc, then it's simply wrong, because it didn't use "shoot on position" function and in fact you never could miss via battle window - not in 7.8 and not any time earlier.
Yeah, I think he's just (over)simplifying, trying to say that the protocol code for using items/runes on player is different from other creatures prior to 7.8 including cipserver, in fact it completely ignores "shoot on cid" if the cid is a player id.
Poorly worded, but I get what he means.
 
Top