mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-09-29 14:12:52 -04:00
Fix for inspiration buff
Buff is now properly applied, stat mods are properly computed and changes to stats are clearly visible . Sample test at https://www.youtube.com/watch?v=KOV2C4z5VAw
This commit is contained in:
@@ -62,6 +62,8 @@ public class EntertainmentService implements INetworkDispatch {
|
||||
|
||||
private Map<String, PerformanceEffect> performanceEffects = new ConcurrentHashMap<String, PerformanceEffect>();
|
||||
|
||||
|
||||
|
||||
public EntertainmentService(NGECore core) {
|
||||
this.core = core;
|
||||
populateSkillCaps();
|
||||
@@ -282,7 +284,8 @@ public class EntertainmentService implements INetworkDispatch {
|
||||
buffRecipient.getClient().getSession().write(closeMessage.serialize());
|
||||
|
||||
}
|
||||
if (sender.getObjectId() == buffRecipient.getObjectId()) {
|
||||
if (sender.getObjectId() == buffRecipient.getObjectId())
|
||||
{
|
||||
// send close packet to buffer
|
||||
BuffBuilderEndMessage end = new BuffBuilderEndMessage(sentPacket);
|
||||
end.setObjectId(buffer.getObjectId());
|
||||
@@ -294,6 +297,8 @@ public class EntertainmentService implements INetworkDispatch {
|
||||
buffer.getClient().getSession().write(closeMessage.serialize());
|
||||
CreatureObject cre = (CreatureObject) buffer;
|
||||
cre.sendSystemMessage("The buff recipient cancelled the buff builder session.", (byte) 0);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -537,21 +542,61 @@ public class EntertainmentService implements INetworkDispatch {
|
||||
Vector<BuffBuilder> availableStats = buffBuilderSkills;
|
||||
Vector<BuffItem> stats = new Vector<BuffItem>();
|
||||
|
||||
for (BuffItem item : buffVector) {
|
||||
for(BuffBuilder builder : availableStats) {
|
||||
if(builder.getStatName().equalsIgnoreCase(item.getSkillName())) {
|
||||
for (BuffItem item : buffVector)
|
||||
{
|
||||
for(BuffBuilder builder : availableStats)
|
||||
{
|
||||
|
||||
if(builder.getStatName().equalsIgnoreCase(item.getSkillName()))
|
||||
{
|
||||
|
||||
|
||||
if(builder.getMaxTimesApplied() < item.getInvested())
|
||||
return;
|
||||
|
||||
int affectTotal=0;
|
||||
|
||||
|
||||
|
||||
// Ent. Expertise Percent + (invested points * affect amount) = stat
|
||||
int bonusPoints = (int) (builder.getAffectAmount() *((float) item.getEntertainerBonus()/100f));
|
||||
int affectTotal = bonusPoints + (item.getInvested() * builder.getAffectAmount());
|
||||
|
||||
BuffItem stat = new BuffItem(builder.getStatAffects(), item.getInvested(), item.getEntertainerBonus());
|
||||
stat.setAffectAmount(affectTotal);
|
||||
|
||||
switch(builder.getCategoryId())
|
||||
{
|
||||
|
||||
case TRADE:
|
||||
case RESISTANCES:
|
||||
case ATTRIBUTES:
|
||||
{
|
||||
affectTotal=(int)( ( (1+(float) item.getEntertainerBonus()/100f)*builder.getAffectAmount()) * item.getInvested());
|
||||
break;
|
||||
|
||||
}
|
||||
case COMBAT:
|
||||
{
|
||||
affectTotal=(int) (( builder.getAffectAmount()+item.getEntertainerBonus()) * item.getInvested());
|
||||
break;
|
||||
|
||||
}
|
||||
case MISC:
|
||||
{
|
||||
affectTotal=(int) (( builder.getAffectAmount()) * item.getInvested());
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
{
|
||||
System.out.println("unhandled builder catId of "+builder.getCategoryId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
stat.setAffectAmount(affectTotal);
|
||||
stats.add(stat);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user