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

Nostalrius 7.7

That one is, just saying if you use rand(), like rand()%10, its not inclusive. Programming is fun (Y)

Heres my Orc Spearman now.

Before uniform_random(1, spellBlock.chance) == 1
spearman1.gif


After uniform_random(1, spellBlock.chance) == 1
spearman2.gif



A Demon vs Hydra.

Before uniform_random(1, spellBlock.chance) == 1
demon1.gif


After uniform_random(1, spellBlock.chance) == 1
demon2.gif

A lot more agressive with spells and healing.
I don't know but I have an issue related to this. Ranged spells from monsters, are extremely fast, and my engine has this improvement... what is happening?


Code:
void Monster::doAttacking(uint32_t)
{
    if (!attackedCreature || (isSummon() && attackedCreature == this)) {
        return;
    }

    const Position& myPos = getPosition();
    const Position& targetPos = attackedCreature->getPosition();

    bool updateLook = false;

    if (OTSYS_TIME() >= earliestAttackTime && !isFleeing()) {
        updateLook = true;
        if (Combat::closeAttack(this, attackedCreature, FIGHTMODE_BALANCED)) {
            egibleToDance = true;
            earliestAttackTime = OTSYS_TIME() + 2000;
            removeCondition(CONDITION_AGGRESSIVE, true);
        }
    }

    for (spellBlock_t& spellBlock : mType->info.attackSpells) {
        if (spellBlock.range != 0 && std::max<uint32_t>(Position::getDistanceX(myPos, targetPos), Position::getDistanceY(myPos, targetPos)) <= spellBlock.range) {
            if (uniform_random(0, spellBlock.chance) == 0 && (master || health > mType->info.runAwayHealth || uniform_random(1, 3) == 1)) {
                updateLookDirection();

                minCombatValue = spellBlock.minCombatValue;
                maxCombatValue = spellBlock.maxCombatValue;

                spellBlock.spell->castSpell(this, attackedCreature);
                egibleToDance = true;
            }
        }
    }

    if (updateLook) {
        updateLookDirection();
    }
}
 
I don't know but I have an issue related to this. Ranged spells from monsters, are extremely fast, and my engine has this improvement... what is happening?


Code:
void Monster::doAttacking(uint32_t)
{
    if (!attackedCreature || (isSummon() && attackedCreature == this)) {
        return;
    }

    const Position& myPos = getPosition();
    const Position& targetPos = attackedCreature->getPosition();

    bool updateLook = false;

    if (OTSYS_TIME() >= earliestAttackTime && !isFleeing()) {
        updateLook = true;
        if (Combat::closeAttack(this, attackedCreature, FIGHTMODE_BALANCED)) {
            egibleToDance = true;
            earliestAttackTime = OTSYS_TIME() + 2000;
            removeCondition(CONDITION_AGGRESSIVE, true);
        }
    }

    for (spellBlock_t& spellBlock : mType->info.attackSpells) {
        if (spellBlock.range != 0 && std::max<uint32_t>(Position::getDistanceX(myPos, targetPos), Position::getDistanceY(myPos, targetPos)) <= spellBlock.range) {
            if (uniform_random(0, spellBlock.chance) == 0 && (master || health > mType->info.runAwayHealth || uniform_random(1, 3) == 1)) {
                updateLookDirection();

                minCombatValue = spellBlock.minCombatValue;
                maxCombatValue = spellBlock.maxCombatValue;

                spellBlock.spell->castSpell(this, attackedCreature);
                egibleToDance = true;
            }
        }
    }

    if (updateLook) {
        updateLookDirection();
    }
}
the uniform attack formula is the closest I think to a true 7.x time attack

if it doesn't suit your requirements, reduce the monster intervals separately
 
the uniform attack formula is the closest I think to a true 7.x time attack

if it doesn't suit your requirements, reduce the monster intervals separately
oh, I'll try to do a video about my case... I mean, my distanced spell mobs are bug
Post automatically merged:

oh, I'll try to do a video about my case... I mean, my distanced spell mobs are bug
OTChile - Antonio The Demon 2022-11-25 21-56-58.gif the "hmm" of the warlock goes to fast
OTChile - Antonio The Demon 2022-11-25 22-02-15.gifhunters doesn't attack that fast
 
Last edited:
First of all in monster xml, where will be what should he act
Monsters in Nostalrius don't have intervals in the xml files ,because 7.x monstesr didnt have individual intervals.

All spell casts are in sources onAttacking. They all already attack on the 1second interval unless in melee rannge, and its 2second.

Idk about Nekiros downgrade, its basd of f TFS 1,4 isnt it? Might be quite diference from these soruces.
 
All spell casts are in sources onAttacking. They all already attack on the 1second interval unless in melee rannge, and its 2second.
i thought that "chance" is like sort of interval here...
like from hunter
XML:
    <attacks attack="13" skill="18">
        <attack name="physical" min="-50" max="-100" range="7" [B]chance[/B]="2">
            <attribute key="shootEffect" value="arrow" />
        </attack>

thanks @pink_panther for explain ;)
 
Monsters in Nostalrius don't have intervals in the xml files ,because 7.x monstesr didnt have individual intervals.

All spell casts are in sources onAttacking. They all already attack on the 1second interval unless in melee rannge, and its 2second.

Idk about Nekiros downgrade, its basd of f TFS 1,4 isnt it? Might be quite diference from these soruces.
Thanks panther on attacking and where else?
 
has anyone implemented bank transfer system yet for npcs or got some experience to help me finish it?
gen-bank.ndb
Code:
"transfer" -> "How much do you want to transfer?", Topic=104

Topic=104,%1,0<%1,Balance>=%1 -> Price=%1, "Who exactly you want to transfer your %P gold to?", Topic=105

Topic=105,PlayerExist(String)=1 -> Name=String, "So you want to transfer %P gold to %NS?", Topic=106
Topic=105 -> "Sorry, that player does not exist."

Topic=106,"yes" -> "%NS has recieved %P gold!", Transfer(Name, Price)

not sure how to implement these yet
Code:
PlayerExist(String)=1 // check to see that player actually exists
Name=String // set the variable to be able to use it inside transfer function later
%NS // string response

Transfer(Name, Price) action:
BehaviourDatabase::loadActions
C++:
else if (identifier == "transfer") {
                action->type = BEHAVIOUR_TYPE_TRANSFER;
                searchType = BEHAVIOUR_PARAMETER_TWO;
            }
BehaviourDatabase::checkAction
C++:
case BEHAVIOUR_TYPE_TRANSFER: {
        Player* target = g_game.getPlayerByName(action->expression->string);
        if (!target) {
            break;
        }

        int32_t money = evaluate(action->expression2, player, message);
        if (money > 0) {
            player->setBankBalance(player->getBankBalance() - money);
            target->setBankBalance(target->getBankBalance() + money);
        }
        break;
    }
 
I was just boring and added some interesting:
As you can see, if player has not money in him, he can travel with bank balance money.
Way to insert, set all captain cities to:
thais topic=1
carlin topic=2
ab'dendriel...3
edron...4
venore...5
darashia...6
ankrahmun...7
port hope...8
then copy paste the code... its a little lazy, but its a cool improve :), hope you enjoy.

Code:
#thais
Topic=1,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32313,32212,7), EffectOpp(11)
Topic=1,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32313,32212,7), EffectOpp(11)
Topic=1,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#carlin
Topic=2,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32388,31821,7), EffectOpp(11)
Topic=2,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32388,31821,7), EffectOpp(11)
Topic=2,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#ab'dendriel
Topic=3,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32733,31664,7 ), EffectOpp(11)
Topic=3,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32733,31664,7 ), EffectOpp(11)
Topic=3,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#edron
Topic=4,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(33182,31764,7), EffectOpp(11)
Topic=4,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33182,31764,7), EffectOpp(11)
Topic=4,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#venore
Topic=5,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32956,32023,7), EffectOpp(11)
Topic=5,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32956,32023,7), EffectOpp(11)
Topic=5,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#darashia
Topic=6,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(33293,32481,7), EffectOpp(11)
Topic=6,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33293,32481,7), EffectOpp(11)
Topic=6,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#ankrahmun
Topic=7,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(33092,32882,7), EffectOpp(11)
Topic=7,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33092,32882,7), EffectOpp(11)
Topic=7,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."
#port hope
Topic=8,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(32527,32784,6), EffectOpp(11)
Topic=8,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32527,32784,6), EffectOpp(11)
Topic=8,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."

#cormaya
Topic=4,"yes",Premium,CountMoney>=Price -> "Set the sails!", DeleteMoney, Idle, EffectOpp(11), Teleport(33289,31956,6), EffectOpp(11)
Topic=4,"yes",Premium,CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33289,31956,6), EffectOpp(11)
Topic=4,"yes",Premium,CountMoney<Price,Balance<Price -> "You have not enough gold."

##carpets
#darashia
Topic=1,"yes",CountMoney>=Price                -> "Hold on!", DeleteMoney, Idle, EffectOpp(11), Teleport(33269,32441,6), EffectOpp(11)
Topic=1,"yes",CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33269,32441,6), EffectOpp(11)
Topic=1,"yes",CountMoney<Price,Balance<Price   -> "You have not enough gold."
#femor hills
Topic=2,"yes",CountMoney>=Price         -> "Hold on!", DeleteMoney, Idle, EffectOpp(11), Teleport(32535,31837,4), EffectOpp(11)
Topic=2,"yes",CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(32535,31837,4), EffectOpp(11)
Topic=2,"yes",CountMoney<Price,Balance<Price   -> "You have not enough gold."
#edron
Topic=3,"yes",CountMoney>=Price -> "Hold on!", DeleteMoney, Idle, EffectOpp(11), Teleport(33193,31784,3), EffectOpp(11)
Topic=3,"yes",CountMoney<Price,Balance>=Price  -> "Set the sails!", Withdraw(Price), Idle, EffectOpp(11), Teleport(33193,31784,3), EffectOpp(11)
Topic=3,"yes",CountMoney<Price,Balance<Price   -> "You have not enough gold."
Post automatically merged:

has anyone implemented bank transfer system yet for npcs or got some experience to help me finish it?
gen-bank.ndb
Code:
"transfer" -> "How much do you want to transfer?", Topic=104

Topic=104,%1,0<%1,Balance>=%1 -> Price=%1, "Who exactly you want to transfer your %P gold to?", Topic=105

Topic=105,PlayerExist(String)=1 -> Name=String, "So you want to transfer %P gold to %NS?", Topic=106
Topic=105 -> "Sorry, that player does not exist."

Topic=106,"yes" -> "%NS has recieved %P gold!", Transfer(Name, Price)

not sure how to implement these yet
Code:
PlayerExist(String)=1 // check to see that player actually exists
Name=String // set the variable to be able to use it inside transfer function later
%NS // string response

Transfer(Name, Price) action:
BehaviourDatabase::loadActions
C++:
else if (identifier == "transfer") {
                action->type = BEHAVIOUR_TYPE_TRANSFER;
                searchType = BEHAVIOUR_PARAMETER_TWO;
            }
BehaviourDatabase::checkAction
C++:
case BEHAVIOUR_TYPE_TRANSFER: {
        Player* target = g_game.getPlayerByName(action->expression->string);
        if (!target) {
            break;
        }

        int32_t money = evaluate(action->expression2, player, message);
        if (money > 0) {
            player->setBankBalance(player->getBankBalance() - money);
            target->setBankBalance(target->getBankBalance() + money);
        }
        break;
    }
i think there's a lot more we must add...
NODES and ACTIONS...

PlayerExists(true/false) i.e:
PlayerExsist=1 - if player exists continue with next topic
PlayerExsist=0 - if player doesnt exist, end of topic

GetString(to get target player name)

I know the "Transfer" action is there working (i believe) because when u use "Transfer(Amount)" funct, there are no errors at console.

is there someone that can help with this? I think there are a lot of user waiting for it.
 
Last edited:
@Ezzz
Someone checks the area effect of burst arrows, because i found it's going straight to the creature and not following the arrow.
And i downloaded another clean soucer from here and compiled the same thing.
I tried to fix combat.cpp only made it worse.
 
Last edited:
Sorted out update combat.cpp
after remove MissileEffect from burst arrow in items.srv
Your solution kinda worked for me, Thanks for that!
Just a small detail that i could not remove MissileEffect or my client would crash when shooting bursts.
And if i kept it in the Attributes, it was shooting 2 arrows.
So, instead i added a blank sprite to the client and used that MissileEffect ^^
 
I download It but i can't start the server to test. There isn't a .exe to execute and open it. Where can I find it?
 
Back
Top