Only exchange bribe gold if the bribe was accepted

actorid
scrawl 11 years ago
parent 72df9e77c6
commit 5eeed03f5b

@ -500,7 +500,24 @@ namespace MWDialogue
mTemporaryDispositionChange = 100 - curDisp;
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWWorld::Class::get(player).skillUsageSucceeded(player, ESM::Skill::Speechcraft, success ? 0 : 1);
player.getClass().skillUsageSucceeded(player, ESM::Skill::Speechcraft, success ? 0 : 1);
if (success)
{
int gold=0;
if (type == MWBase::MechanicsManager::PT_Bribe10)
gold = 10;
else if (type == MWBase::MechanicsManager::PT_Bribe100)
gold = 100;
else if (type == MWBase::MechanicsManager::PT_Bribe1000)
gold = 1000;
if (gold)
{
player.getClass().getContainerStore(player).remove(MWWorld::ContainerStore::sGoldId, gold, player);
mActor.getClass().getContainerStore(mActor).add(MWWorld::ContainerStore::sGoldId, gold, mActor);
}
}
std::string text;

@ -56,29 +56,16 @@ namespace MWGui
void PersuasionDialog::onPersuade(MyGUI::Widget *sender)
{
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWBase::MechanicsManager::PersuasionType type;
if (sender == mAdmireButton) type = MWBase::MechanicsManager::PT_Admire;
else if (sender == mIntimidateButton) type = MWBase::MechanicsManager::PT_Intimidate;
else if (sender == mTauntButton) type = MWBase::MechanicsManager::PT_Taunt;
else if (sender == mBribe10Button)
{
player.getClass().getContainerStore(player).remove(MWWorld::ContainerStore::sGoldId, 10, player);
mReceiver.getClass().getContainerStore(mReceiver).add(MWWorld::ContainerStore::sGoldId, 10, mReceiver);
type = MWBase::MechanicsManager::PT_Bribe10;
}
else if (sender == mBribe100Button)
{
player.getClass().getContainerStore(player).remove(MWWorld::ContainerStore::sGoldId, 100, player);
mReceiver.getClass().getContainerStore(mReceiver).add(MWWorld::ContainerStore::sGoldId, 100, mReceiver);
type = MWBase::MechanicsManager::PT_Bribe100;
}
else /*if (sender == mBribe1000Button)*/
{
player.getClass().getContainerStore(player).remove(MWWorld::ContainerStore::sGoldId, 1000, player);
mReceiver.getClass().getContainerStore(mReceiver).add(MWWorld::ContainerStore::sGoldId, 1000, mReceiver);
type = MWBase::MechanicsManager::PT_Bribe1000;
}
MWBase::Environment::get().getDialogueManager()->persuade(type);
@ -100,12 +87,6 @@ namespace MWGui
mGoldLabel->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(playerGold));
}
// The receiver of the bribe
void PersuasionDialog::setReceiver(MWWorld::Ptr receiver)
{
mReceiver = receiver;
}
// --------------------------------------------------------------------------------------------------
Response::Response(const std::string &text, const std::string &title)
@ -380,7 +361,6 @@ namespace MWGui
mPtr = actor;
mTopicsList->setEnabled(true);
setTitle(npcName);
mPersuasionDialog.setReceiver(mPtr);
mTopicsList->clear();

@ -35,9 +35,6 @@ namespace MWGui
virtual void open();
// The receiver of the bribe
void setReceiver(MWWorld::Ptr receiver);
private:
MyGUI::Button* mCancelButton;
MyGUI::Button* mAdmireButton;
@ -50,9 +47,6 @@ namespace MWGui
void onCancel (MyGUI::Widget* sender);
void onPersuade (MyGUI::Widget* sender);
// The receiver of the bribe
MWWorld::Ptr mReceiver;
};

Loading…
Cancel
Save