• Congratulations to the OTLand January Mapping Competition Winner! The grand prize of Otland Premium goes to Andréew.
  • Sign up for February Mapping Competition! The prize includes Otland Premium time.
  • 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

armyman

Member
Joined
Feb 15, 2014
Messages
317
Best answers
0
Reaction score
13
Anyone can reproduce that?


So it's a 500 items limit when you trade with any npc?
to prevent people from abusing npc by buying millions of items at once...

but u can change this if u want

open behaviourdatabase.cpp

look for function searchDigit

C++:
if (value > 500) {
        value = 500;
    }
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
714
Best answers
0
Reaction score
173
to prevent people from abusing npc by buying millions of items at once...

but u can change this if u want

open behaviourdatabase.cpp

look for function searchDigit

C++:
if (value > 500) {
        value = 500;
    }
Ok, I got it
How can I get rid off that limit only on bank npc?
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
714
Best answers
0
Reaction score
173
You're quoting the answer to that question...
I mean if it's another way to manage that instead of using %1 to change more than 500 coins at a time, but keeping the npc limit on 500 items to trade.
Code:
Topic=91,%1,0<%1 -> Amount=%1*100, Price=%1, "So I should change %A of your gold coins to %P platinum coins for you?", Topic=96
BTW, how it can be abused if I delete or comment those lines?:
Code:
if (value > 500) {
        value = 500;
    }
 
Last edited:
OP
Ezzz

Ezzz

Developer
Joined
Feb 26, 2010
Messages
1,701
Best answers
2
Reaction score
418
Location
Quito, Ecuador
I mean if it's another way to manage that instead of using %1 to change more than 500 coins at a time, but keeping the npc limit on 500 items to trade.
Code:
Topic=91,%1,0<%1 -> Amount=%1*100, Price=%1, "So I should change %A of your gold coins to %P platinum coins for you?", Topic=96
BTW, how it can be abused if I delete or comment those lines?:
Code:
if (value > 500) {
        value = 500;
    }
The server would collapse, there are many items worth nothing, and lets say a player with 1kk or more and buys something from the NPC, the server freezes for over 1 minute, that's why CipSoft has this limit.
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
714
Best answers
0
Reaction score
173
The server would collapse, there are many items worth nothing, and lets say a player with 1kk or more and buys something from the NPC, the server freezes for over 1 minute, that's why CipSoft has this limit.
I want to keep the npc trade limit on 500 items, I only ask for another method to change more than 500 gold on bank npc.
 

Jhon_

Active Member
Joined
May 7, 2019
Messages
35
Best answers
0
Reaction score
47
I want to keep the npc trade limit on 500 items, I only ask for another method to change more than 500 gold on bank npc.
Code:
Player: hi
19:37 Rokyn: Hiho, Hiho, Player! What can I do for you?
Player: change gold
19:37 Rokyn: How many platinum coins do you want to get?
Player: 6
19:37 Rokyn: So I should change 600 of your gold coins to 6 platinum coins for you?
Player: yes
19:38 Rokyn: Here you are.
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
714
Best answers
0
Reaction score
173
Code:
Player: hi
19:37 Rokyn: Hiho, Hiho, Player! What can I do for you?
Player: change gold
19:37 Rokyn: How many platinum coins do you want to get?
Player: 6
19:37 Rokyn: So I should change 600 of your gold coins to 6 platinum coins for you?
Player: yes
19:38 Rokyn: Here you are.


I'm working on bank system too and now you can't deposit or withdraw more than 500 gold at a time with that limit.
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
714
Best answers
0
Reaction score
173
Maybe you can simply check if count > 500 but is not currency?
Nostalrius is not TFS in this case, there is a behaviourdatabase.cpp to manage that:
Code:
int32_t BehaviourDatabase::searchDigit(const std::string& message)
{
    int32_t start = -1;
    int32_t end = -1;
    int32_t value = 0;
    int32_t i = -1;

    for (char c : message) {
        i++;
        if (start == -1 && IsDigit(c)) {
            start = i;
        }
        else if (start != -1 && !IsDigit(c)) {
            end = i;
            break;
        }
    }

    try {
        value = std::stoi(message.substr(start, end).c_str());
    }
    catch (std::invalid_argument) {
        return 0;
    }
    catch (std::out_of_range) {
        return 0;
    }

    if (value > 500) {
        value = 500;
    }

    return value;
}
 

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,717
Best answers
22
Reaction score
439
Location
Sweden
Oh I see.

Probably not the best solution, but maybe you could remove the statement checking if value is above 500 from searchDigit function, then use standard library to check max value every time that function is called with exception for currency items (when you can fetch these item ids). Something like: std::max<uint64_t>(searchDigit(parameter), 500)
 
Last edited:

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
714
Best answers
0
Reaction score
173
Oh I see.

Probably not the best solution, but maybe you could remove the statement checking if value is above 500 from searchDigit function, then use standard library to check max value every time that function is called with exception for currency items (when you can fetch these item ids). Something like: std::max<uint64_t>(searchDigit(parameter), 500)
The problem itself it's the dialog, you can't check for currency when you talk to npc like that:

The only workaround I can imagine is to use something different on bank npc than %1:
Code:
Topic=91,%1,0<%1 -> Amount=%1*100, Price=%1, "So I should change %A of your gold coins to %P platinum coins for you?", Topic=96
But I'm stucked now.
 

Jhon_

Active Member
Joined
May 7, 2019
Messages
35
Best answers
0
Reaction score
47
I found nostalrius sources with cast system here.

 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,367
Best answers
36
Reaction score
870
Location
Arica - Chile
The problem itself it's the dialog, you can't check for currency when you talk to npc like that:

The only workaround I can imagine is to use something different on bank npc than %1:
Code:
Topic=91,%1,0<%1 -> Amount=%1*100, Price=%1, "So I should change %A of your gold coins to %P platinum coins for you?", Topic=96
But I'm stucked now.
you can maybe try to edit how db behaviour read the message just for this bank boys
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
714
Best answers
0
Reaction score
173
you can maybe try to edit how db behaviour read the message just for this bank boys
Exactly, but I still haven't found a way to do that.
All of the bank code is on a single file: gen-bank.ndb
 

Jhon_

Active Member
Joined
May 7, 2019
Messages
35
Best answers
0
Reaction score
47
monsters are casting for e.g, wave over walls.
 

Nostalgian

Member
Joined
Mar 17, 2018
Messages
63
Best answers
0
Reaction score
12
Would it be a big deal to change this so that you can actually easily modify outfits?

How big a deal is it to re-implement the outfits.xml?

Why remove that in the first place exactly?
 

0lo

7.6 <3
Joined
Oct 10, 2010
Messages
21
Best answers
0
Reaction score
3
Location
Poland
Because the client works with ranges you must edit source for add new outfit.
 

pink_panther

Active Member
Joined
Sep 10, 2016
Messages
157
Best answers
1
Reaction score
43
Would it be a big deal to change this so that you can actually easily modify outfits?

How big a deal is it to re-implement the outfits.xml?

Why remove that in the first place exactly?
A big one, because of the outfit selector in 7.7
 
Top