Nostalrius 7.7

armyman

Intermediate OT User
Joined
Feb 15, 2014
Messages
316
Reaction score
12
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
712
Reaction score
169
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
712
Reaction score
169
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,688
Reaction score
401
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
712
Reaction score
169
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_

New Member
Joined
May 7, 2019
Messages
11
Reaction score
17
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
712
Reaction score
169
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
712
Reaction score
169
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

Legendary OT User
Joined
Mar 24, 2008
Messages
2,683
Reaction score
405
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
712
Reaction score
169
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_

New Member
Joined
May 7, 2019
Messages
11
Reaction score
17
I found nostalrius sources with cast system here.

 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,260
Reaction score
764
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
712
Reaction score
169
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_

New Member
Joined
May 7, 2019
Messages
11
Reaction score
17
monsters are casting for e.g, wave over walls.
 

Nostalgian

Member
Joined
Mar 17, 2018
Messages
36
Reaction score
9
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
Reaction score
3
Location
Poland
Because the client works with ranges you must edit source for add new outfit.
 
Top