mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-21 00:18:43 +00:00
Fixed: NPC merchants with type 'sale'
This commit is contained in:
parent
026657b28c
commit
d6ba3db1ad
1 changed files with 16 additions and 2 deletions
|
@ -517,28 +517,42 @@ bool CNpcChatProfileImp::parseChatArgs(CAIInstance *aiInstance, const std::strin
|
||||||
sale.setSheetId(CSheetId(parts[i]+".sitem"));
|
sale.setSheetId(CSheetId(parts[i]+".sitem"));
|
||||||
if (sale.getSheetId() == CSheetId::Unknown)
|
if (sale.getSheetId() == CSheetId::Unknown)
|
||||||
return false;
|
return false;
|
||||||
|
break;
|
||||||
case RYMSG::TExplicitSaleType::est_named_item:
|
case RYMSG::TExplicitSaleType::est_named_item:
|
||||||
sale.setNamed(parts[i]);
|
sale.setNamed(parts[i]);
|
||||||
if (sale.getNamed().empty())
|
if (sale.getNamed().empty())
|
||||||
return false;
|
return false;
|
||||||
|
break;
|
||||||
case RYMSG::TExplicitSaleType::est_brick:
|
case RYMSG::TExplicitSaleType::est_brick:
|
||||||
sale.setSheetId(CSheetId(parts[i]+".sbrick"));
|
sale.setSheetId(CSheetId(parts[i]+".sbrick"));
|
||||||
if (sale.getSheetId() == CSheetId::Unknown)
|
if (sale.getSheetId() == CSheetId::Unknown)
|
||||||
return false;
|
return false;
|
||||||
|
break;
|
||||||
case RYMSG::TExplicitSaleType::est_phrase:
|
case RYMSG::TExplicitSaleType::est_phrase:
|
||||||
sale.setSheetId(CSheetId(parts[i]+".sphrase"));
|
sale.setSheetId(CSheetId(parts[i]+".sphrase"));
|
||||||
if (sale.getSheetId() == CSheetId::Unknown)
|
if (sale.getSheetId() == CSheetId::Unknown)
|
||||||
return false;
|
return false;
|
||||||
|
break;
|
||||||
case RYMSG::TExplicitSaleType::est_dappers:
|
case RYMSG::TExplicitSaleType::est_dappers:
|
||||||
|
{
|
||||||
// read the amount of dapper
|
// read the amount of dapper
|
||||||
sale.setQuantity(atoi(parts[i].c_str()));
|
uint32 quantity;
|
||||||
|
NLMISC::fromString(parts[i], quantity),
|
||||||
|
sale.setQuantity(quantity);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
STOP("Unsupported sale type "<<sale.getSaleType().toString());
|
STOP("Unsupported sale type "<<sale.getSaleType().toString());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
{
|
||||||
// read the quality
|
// read the quality
|
||||||
sale.setQuality(atoi(parts[i].c_str()));
|
uint32 quality;
|
||||||
|
NLMISC::fromString(parts[i], quality);
|
||||||
|
sale.setQuality(quality);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 4:
|
case 4:
|
||||||
// read the money (may be more than one)
|
// read the money (may be more than one)
|
||||||
if (!parts[i].empty())
|
if (!parts[i].empty())
|
||||||
|
|
Loading…
Reference in a new issue