Skip to content

Commit 5df1980

Browse files
committed
Merge pull request #175 from ProjectSWGCore/Treeku
Treeku
2 parents c3cf871 + 2d4f115 commit 5df1980

28 files changed

+380
-196
lines changed

scripts/buffs/me_evasion_1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
def setup(core, actor, buff):
44
core.skillModService.addSkillMod(actor, 'expertise_dodge', 35)
5-
core.skillModService.addSkillMod(actor, 'expertise_evasion_chance', 50)
5+
core.skillModService.addSkillMod(actor, 'display_only_evasion', 5000)
66
core.skillModService.addSkillMod(actor, 'combat_evasion_value', 50)
77
return
88

99
def removeBuff(core, actor, buff):
1010
core.skillModService.deductSkillMod(actor, 'expertise_dodge', 35)
11-
core.skillModService.deductSkillMod(actor, 'expertise_evasion_chance', 50)
11+
core.skillModService.deductSkillMod(actor, 'display_only_evasion', 5000)
1212
core.skillModService.deductSkillMod(actor, 'combat_evasion_value', 50)
1313
return
1414

scripts/commands/addfriend.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ def setup():
55

66
def run(core, actor, target, commandString):
77
actorGhost = actor.getSlottedObject("ghost")
8+
89
chatSrvc = core.chatService
910
if chatSrvc and actorGhost and commandString:
10-
chatSrvc.addFriend(actorGhost, commandString, 1)
11+
if actorGhost.getFriendList().contains(commandString.split(" ")[0].lower()):
12+
actor.sendSystemMessage(commandString.split(" ")[0].lower() + ' is already in your friend list.', 0)
13+
return
14+
else:
15+
chatSrvc.addFriend(actorGhost, commandString)
1116
return

scripts/commands/addignore.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,14 @@ def setup():
66
def run(core, actor, target, commandString):
77
actorGhost = actor.getSlottedObject("ghost")
88
chatSrvc = core.chatService
9+
10+
if not actorGhost and chatSrvc and commandString:
11+
return
12+
13+
if actorGhost.getIgnoreList().contains(commandString.split(" ")[0].lower()):
14+
actor.sendSystemMessage(commandString.split(' ')[0].lower() + ' is already in your ignore list.', 0)
15+
return
16+
917
chatSrvc.addToIgnoreList(actor, commandString)
18+
1019
return

scripts/commands/findfriend.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from resources.objects.waypoint import WaypointObject
2+
from engine.resources.common import CRC
13
import sys
24

35
def setup():
@@ -11,8 +13,29 @@ def run(core, actor, target, commandString):
1113
friendObj = core.chatService.getObjectByFirstName(friend)
1214
if friendObj is not None:
1315
if friendObj.getSlottedObject('ghost').getFriendList().contains(actor.getCustomName().lower().split(' ')[0]):
14-
fPos = friendObj.getPosition()
15-
core.commandService.callCommand(actor, 'waypoint', None, friendObj.getPlanet().name + ' ' + str(fPos.x) + ' ' + str(fPos.z) + ' ' + str(fPos.y) + ' blue ' + friendObj.getCustomName())
16+
createWaypoint(core, actor, friendObj)
1617
return
1718
return
18-
return
19+
return
20+
21+
22+
def createWaypoint(core, actor, friendObj):
23+
ghost = actor.getSlottedObject('ghost')
24+
friendName = friendObj.getCustomName().split(' ')[0]
25+
wp = WaypointObject()
26+
27+
for wp in ghost.getWaypoints():
28+
if wp.getName() == friendName and wp.getPlanet() == friendObj.getPlanet():
29+
core.commandService.callCommand(actor, 'serverdestroyobject', wp, '')
30+
break
31+
32+
waypoint = core.objectService.createObject('object/waypoint/shared_waypoint.iff', friendObj.getPlanet(), friendObj.getWorldPosition().x, friendObj.getWorldPosition().z, friendObj.getWorldPosition().y)
33+
waypoint.setName(friendName)
34+
waypoint.setActive(True)
35+
waypoint.setColor(WaypointObject.YELLOW)
36+
waypoint.setName(friendName)
37+
waypoint.setPlanetCRC(CRC.StringtoCRC(friendObj.getPlanet().name))
38+
waypoint.setStringAttribute('', '')
39+
ghost.waypointAdd(waypoint)
40+
actor.sendSystemMessage('A waypoint has been created in your datapad at the location.', 0)
41+
return

scripts/commands/getfriendlist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def setup():
55
return
66

77
def run(core, actor, target, commandString):
8-
ghost = actor.getSlottedObject('ghost')
9-
friendsListMessage = ChatOnGetFriendsList(ghost)
10-
actor.getClient().getSession().write(friendsListMessage.serialize())
8+
#ghost = actor.getSlottedObject('ghost')
9+
#friendsListMessage = ChatOnGetFriendsList(ghost)
10+
#actor.getClient().getSession().write(friendsListMessage.serialize())
1111
return

scripts/commands/lfg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ def setup():
66

77
def run(core, actor, target, commandString):
88
ghost = actor.getSlottedObject('ghost')
9-
print ('Command recieved!')
109
ghost.toggleFlag(PlayerFlags.LFG)
1110
return

scripts/commands/meditate.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ def setup():
66
def run(core, actor, target, commandString):
77
##To do make it reset moodanimations when meditation is cancled.
88

9+
if core.collectionService.isComplete(actor, 'inv_holocron_collection_02') is False:
10+
return
11+
912
if actor.getPosture() != 0x08:
1013
actor.sendSystemMessage('You need to sit',0)
1114
actor.setMoodAnimation('neutral')

scripts/commands/waypoint.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def run(core, actor, target, commandString):
2222
planet = core.terrainService.getPlanetByName(commandArgs[0])
2323
waypoint = core.objectService.createObject('object/waypoint/shared_waypoint.iff', planet, float(commandArgs[1]), float(commandArgs[2]), float(commandArgs[3]))
2424
waypoint.setActive(True)
25-
waypoint.setColor(colorCheck(core, actor, target, commandString, commandArgs[4]))
25+
waypoint.setColor(colorCheck(commandArgs[4]))
2626
name = commandString.split(" ", 5)
2727
waypoint.setName(name[5])
2828
waypoint.setPlanetCRC(crc.StringtoCRC(planet.getName()))
@@ -89,7 +89,10 @@ def run(core, actor, target, commandString):
8989
waypoint = core.objectService.createObject('object/waypoint/shared_waypoint.iff', actor.getPlanet(), actor.getWorldPosition().x, actor.getWorldPosition().z, actor.getWorldPosition().y)
9090
waypoint.setActive(True)
9191
waypoint.setColor(WaypointObject.BLUE)
92-
waypoint.setName(commandString)
92+
if commandString == '':
93+
waypoint.setName(actor.getPlanet().name.capitalize())
94+
else:
95+
waypoint.setName(commandString)
9396
waypoint.setPlanetCRC(crc.StringtoCRC(actor.getPlanet().getName()))
9497
waypoint.setStringAttribute('', '') # This simply allows the attributes to display (nothing else has to be done)
9598
actorPlayer.waypointAdd(waypoint)
@@ -98,7 +101,7 @@ def run(core, actor, target, commandString):
98101

99102
return
100103

101-
def colorCheck(core, actor, target, commandString, validcolors):
104+
def colorCheck(validcolors):
102105
if validcolors == "blue":
103106
return WaypointObject.BLUE
104107
if validcolors == "green":

src/main/NGECore.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public class NGECore {
113113

114114
private volatile boolean isShuttingDown = false;
115115

116+
private long galacticTime = System.currentTimeMillis();
117+
116118
private ConcurrentHashMap<IoSession, Client> clients = new ConcurrentHashMap<IoSession, Client>();
117119

118120
// Database
@@ -542,5 +544,9 @@ public void initiateShutdown() {
542544

543545
}
544546

547+
public long getGalacticTime() {
548+
return System.currentTimeMillis() - this.galacticTime;
549+
}
550+
545551
}
546552

src/protocol/swg/ChatFriendsListUpdate.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ public void deserialize(IoBuffer data) {
2929

3030
@Override
3131
public IoBuffer serialize() {
32-
Config config = new Config();
33-
config.setFilePath("nge.cfg");
34-
if (!(config.loadConfigFile())) {
35-
config = DefaultConfig.getConfig();
36-
}
37-
String serverName = config.getString("GALAXY_NAME");
32+
33+
String serverName = NGECore.getInstance().getConfig().getString("GALAXY_NAME");
3834

3935
IoBuffer result = IoBuffer.allocate(50 + friendName.length()).order(ByteOrder.LITTLE_ENDIAN);
4036
result.putShort((short) 3);

0 commit comments

Comments
 (0)