• 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!

OTHire 0.0.3 Casting spell and moving

Malek

Member
Joined
Dec 25, 2009
Messages
99
Reaction score
5
I'm using OTHire 0.0.3, I want the player to be able to move while casting spells (right now if I'm attacking a monster, and keep holding the same arrow key or numpad the character will stop the moment the spell hotkey is used, then ill have to keep spamming the arrow key and the spell key same time, so what I need is to be able to cast spells without the need of spamming the arrow/numpad keys)

Basically, I need to disable the thing that stops me from doing more than one action at a time. (Moving and spell casting)

 
action.cpp

Lua:
bool Actions::useItemEx(Player* player, const Position& fromPos, const Position& toPos,
    uint8_t toStackPos, Item* item, uint32_t creatureId/* = 0*/)
{
    if(!player->canDoAction())
        return false;

    player->setNextActionTask(NULL);
    player->stopWalk();
    player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::EX_ACTIONS_DELAY_INTERVAL) - 10);

change to
Code:
bool Actions::useItemEx(Player* player, const Position& fromPos, const Position& toPos,
    uint8_t toStackPos, Item* item, uint32_t creatureId/* = 0*/)
{
    if(!player->canDoAction())
        return false;

    player->setNextActionTask(NULL);
    //player->stopWalk();
    player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::EX_ACTIONS_DELAY_INTERVAL) - 10);
 
its my line from actions.cpp


C++:
bool Actions::useItemEx(Player* player, const Position& fromPos, const Position& toPos,
    uint8_t toStackPos, Item* item, uint32_t creatureId/* = 0*/)
{
    if(!player->canDoAction()){
        return false;
    }

    player->setNextActionTask(NULL);

    int32_t fromStackPos = item->getParent()->__getIndexOfThing(item);
    PositionEx fromPosEx(fromPos, fromStackPos);
    PositionEx toPosEx(toPos, toStackPos);
    ReturnValue ret = RET_NOERROR;
    bool isSuccess = false;

    player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::MIN_ACTIONEXTIME) + SCHEDULER_MINTICKS);
    ret = internalUseItemEx(player, fromPosEx, toPosEx, item, creatureId, isSuccess);

    if(ret != RET_NOERROR){
        player->sendCancelMessage(ret);
        return false;
    }

    return true;
 
Last edited:
Back
Top