mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
set target correctly on action objs
This commit is contained in:
parent
f202a8820e
commit
a5aaa1b792
2 changed files with 17 additions and 6 deletions
|
@ -548,7 +548,7 @@ namespace Sapphire::Common
|
||||||
Status = 32,
|
Status = 32,
|
||||||
PLDGauge = 41,
|
PLDGauge = 41,
|
||||||
RDMGaugeBoth = 74,
|
RDMGaugeBoth = 74,
|
||||||
// RDMGaugeBlack = 75, // not right?
|
// RDMGaugeBlack = 75, // not right?
|
||||||
DRGGauge3Eyes = 76,
|
DRGGauge3Eyes = 76,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include "Action/Action.h"
|
#include "Action/Action.h"
|
||||||
#include "Script/ScriptMgr.h"
|
#include "Script/ScriptMgr.h"
|
||||||
|
|
||||||
#include "Actor/Player.h"
|
#include "Actor/Player.h"
|
||||||
|
|
||||||
#include <Exd/ExdDataGenerated.h>
|
#include <Exd/ExdDataGenerated.h>
|
||||||
|
@ -36,6 +35,17 @@ void World::Manager::ActionMgr::handleTargetedPlayerAction( Entity::Player& play
|
||||||
|
|
||||||
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
|
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
|
||||||
|
|
||||||
|
if( targetId != player.getId() )
|
||||||
|
{
|
||||||
|
auto target = player.lookupTargetById( targetId );
|
||||||
|
if( auto chara = target->getAsChara() )
|
||||||
|
action->setTargetChara( chara );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// maybe an eobj? wat do?
|
||||||
|
}
|
||||||
|
|
||||||
bootstrapAction( player, action, *actionData );
|
bootstrapAction( player, action, *actionData );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,10 +122,11 @@ bool World::Manager::ActionMgr::canPlayerUseAction( Entity::Player& player,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: min tp
|
auto& actionCost = currentAction.getCostArray();
|
||||||
// todo: min mp
|
for( uint8_t i = 0; i < actionCost.size(); ++i )
|
||||||
|
{
|
||||||
// todo: script callback for action conditionals?
|
// todo: validate costs/conditionals here
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue