Skip to content

Commit

Permalink
DRAGONAGE2: Implement DoAreaTransition nwscript method
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed Jul 15, 2018
1 parent 472a13f commit d232ae1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/engines/dragonage2/script/function_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ const Functions::FunctionPointer Functions::kFunctionPointers[] = {
{ 742, "GetPlotResRef" , 0 },
{ 743, "GetPlotFlagName" , 0 },
{ 744, "DisplayFloatyMessage" , 0 },
{ 745, "DoAreaTransition" , 0 },
{ 745, "DoAreaTransition" , &Functions::doAreaTransition },
{ 746, "StartCharGen" , 0 },
{ 747, "DisplayStatusMessage" , 0 },
{ 748, "SetQuickslot" , 0 },
Expand Down
2 changes: 2 additions & 0 deletions src/engines/dragonage2/script/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ class Functions {
void getModule(Aurora::NWScript::FunctionContext &ctx);

void getHero(Aurora::NWScript::FunctionContext &ctx);

void doAreaTransition(Aurora::NWScript::FunctionContext &ctx);
// '---

// .--- General object functions, functions_object.cpp
Expand Down
11 changes: 11 additions & 0 deletions src/engines/dragonage2/script/functions_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ void Functions::getHero(Aurora::NWScript::FunctionContext &ctx) {
ctx.getReturn() = (Aurora::NWScript::Object *) campaign->getPC();
}

void Functions::doAreaTransition(Aurora::NWScript::FunctionContext &ctx) {
const Common::UString newArea = ctx.getParams()[0].getString();
const Common::UString waypoint = ctx.getParams()[1].getString();

_game->getCampaigns().getCurrentCampaign()->movePC(newArea);

// TODO: Move Characters to waypoint.

ctx.getReturn() = true;
}

} // End of namespace DragonAge2

} // End of namespace Engines

0 comments on commit d232ae1

Please sign in to comment.