Bug Fixes: Issue #215 + #235 & Minor improvements.

(BugFix) Officer group buff's will now check ranges
(BugFix) Group buffs applied when a player joins a group as long as they
are within range
(BugFix) /inspire will now take a command string for target
(BugFix) /imagedesign will now take a command string for target
This commit is contained in:
Waverunner
2014-03-27 11:23:15 -04:00
parent c63c602367
commit bb85682bd6
23 changed files with 101 additions and 29 deletions
+5 -2
View File
@@ -27,7 +27,10 @@ def run(core, actor, target, commandString):
if commandString == "kitty":
commandString = "technokitty"
if commandString is None or commandString == "":
commandString == installedEmote
if commandString != installedEmote and installedEmote != 'all':
actor.sendSystemMessage('Your installed Holo-Emote generator does not support that emote.', 0)
return
@@ -47,7 +50,7 @@ def holoPrompt(player, emote):
if player.getHoloEmoteUses() == 1:
remainingCharges = "You have 1 charge remaining.\n"
body = "To play a Holo-Emote, type /holoemote <name>." \
body = "To play a Holo-Emote, type /holoemote <name>.\n" \
"To delete your Holo-Emote type /holoemote delete.\n" \
"Purchasing a new Holo-Emote will automatically delete your current Holo-Emote.\n" \
"\n" \
+6 -1
View File
@@ -7,13 +7,18 @@ def setup():
def run(core, actor, target, commandString):
if target is None:
if target is None and commandString is None:
design = ImageDesignStartMessage(actor.getObjectId(), actor.getObjectId(), target.getObjectId())
obj = ObjControllerMessage(11, design)
actor.getClient().getSession().write(obj.serialize())
return
else:
if target is None and commandString is not None:
target = core.chatService.getObjectByFirstName(commandString)
if target is None:
return
if target.getGroupId() == actor.getGroupId():
tDesign = ImageDesignStartMessage(target.getObjectId(), actor.getObjectId(), target.getObjectId())
+5
View File
@@ -17,6 +17,11 @@ def run(core, actor, target, commandString):
actor.getClient().getSession().write(objController.serialize())
return
if target is None and commandString is not None:
target = core.chatService.getObjectByFirstName(commandString)
if target is None:
return
if actor.getPosture() != 0x09 and target.getObjectId() != actor.getObjectId():
actor.sendSystemMessage('@performance:insp_buff_must_perform', 2)
return
+4 -1
View File
@@ -4,6 +4,9 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_1')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_1', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_2')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_2', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_3')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_3', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_4')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_4', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_5')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_5', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_6')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_6', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_7')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_7', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_8')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_8', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_buff_def_9')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_buff_def_9', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_drillmaster_1')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_drillmaster_1', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_focus_fire_1')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_focus_fire_1', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_focus_fire_2')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_focus_fire_2', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_focus_fire_3')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_focus_fire_3', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_focus_fire_4')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_focus_fire_4', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_focus_fire_5')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_focus_fire_5', actor)
return
+3 -1
View File
@@ -4,6 +4,8 @@ def setup(core, actor, buff):
return
def run(core, actor, target, commandString):
core.buffService.addGroupBuff(actor, 'of_focus_fire_6')
if target is None:
target = actor
core.buffService.addGroupBuff(target, 'of_focus_fire_6', actor)
return
+11 -2
View File
@@ -40,12 +40,12 @@ import engine.clientdata.ClientFileManager;
import engine.clientdata.visitors.DatatableVisitor;
import engine.resources.common.CRC;
@Persistent(version=8)
@Persistent(version=9)
public class Buff implements IDelta {
@NotPersistent
private SimpleBufferAllocator bufferPool = new SimpleBufferAllocator();
private String group1;
private String group1, group2;
private int priority;
private float duration;
private String buffName;
@@ -86,6 +86,7 @@ public class Buff implements IDelta {
if(((String) visitor.getObject(i, 0)).equalsIgnoreCase(buffName)) {
group1 = (String) visitor.getObject(i, 1);
group2 = (String) visitor.getObject(i, 2);
priority = (int) visitor.getObject(i, 4);
duration = (Float) visitor.getObject(i, 6);
effect1Name = (String) visitor.getObject(i, 7);
@@ -440,4 +441,12 @@ public class Buff implements IDelta {
this.groupBufferId = groupBufferId;
}
public String getGroup2() {
return group2;
}
public void setGroup2(String group2) {
this.group2 = group2;
}
}
+23 -4
View File
@@ -89,7 +89,7 @@ public class BuffService implements INetworkDispatch {
}
}
public Buff doAddBuff(final CreatureObject target, String buffName, CreatureObject buffer) {
public Buff doAddBuff(final CreatureObject target, String buffName, final CreatureObject buffer) {
if (target.getPosition().getDistance(buffer.getPosition()) > 20) {
return null;
@@ -153,6 +153,23 @@ public class BuffService implements INetworkDispatch {
buff.setRemovalTask(task);
} else if (buff.getGroup2().contains("of_aura") && buffer != null && buffer.getObjectId() != target.getObjectId()) {
// I'm not sure if all aura effects follow the same rules, so this is simply restricted to officer aura's atm
ScheduledFuture<?> task = scheduler.scheduleAtFixedRate(new Runnable() {
@SuppressWarnings("unused")
@Override
public void run() {
if (buffer == null)
removeBuffFromCreature(target, buff);
if (target.getPosition().getDistance2D(buffer.getWorldPosition()) > 80) {
removeBuffFromCreature(target, buff);
}
}
}, 5, 5, TimeUnit.SECONDS);
buff.setRemovalTask(task);
}
for (String effect : buff.getParticleEffect().split(",")) {
@@ -186,7 +203,6 @@ public class BuffService implements INetworkDispatch {
@SuppressWarnings("unused")
public void removeBuffFromCreature(CreatureObject creature, Buff buff) {
if(!creature.getBuffList().contains(buff))
return;
DamageOverTime dot = creature.getDotByBuff(buff);
@@ -201,8 +217,11 @@ public class BuffService implements INetworkDispatch {
for (String effect : buff.getParticleEffect().split(",")) {
creature.stopEffectObject(buff.getBuffName());
}
if (buff.getRemovalTask() != null) {
buff.getRemovalTask().cancel(true);
buff.setRemovalTask(null);
}
}
public void clearBuffs(final CreatureObject creature) {
+2 -2
View File
@@ -187,8 +187,8 @@ public class GroupService implements INetworkDispatch {
for(SWGObject otherMember : group.getMemberList()) {
if(otherMember != member) {
for(Buff buff : ((CreatureObject) otherMember).getBuffList().get()) {
if(buff.isGroupBuff()) {
core.buffService.doAddBuff(member, buff.getBuffName(), (CreatureObject) core.objectService.getObject(buff.getGroupBufferId()));
if(buff.isGroupBuff() && otherMember.getPlanet() == member.getPlanet() && otherMember.getPosition().getDistance2D(member.getWorldPosition()) <= 80) {
core.buffService.addBuffToCreature((CreatureObject) otherMember, buff.getBuffName(), member);
}
}
return;
-2
View File
@@ -92,7 +92,6 @@ public class SkillService implements INetworkDispatch {
if (isTitle == true) {
core.playerService.addPlayerTitle(player, skill);
Console.println("Gave skill title: " + skill);
}
if (isProfession) {
@@ -118,7 +117,6 @@ public class SkillService implements INetworkDispatch {
for (String skillName : skillsRequired) {
if (skillName != "" && !creature.hasSkill(skillName)) {
System.out.println("Skill Name: " + skillName);
return;
}
}