mirror of
https://github.com/Wesley-DeMontigny/WLUS.git
synced 2026-04-25 01:48:20 -05:00
Bugfixes
This commit is contained in:
+21
-5
@@ -123,13 +123,29 @@ class AccountManager():
|
||||
if(mission not in currentMissionCharacterIds):
|
||||
CurrentMissionsTable.delete("PlayerID = {} AND MissionID = {}".format(character.ObjectConfig["ObjectID"], mission.MissionID))
|
||||
|
||||
InventoryTable.delete("OwnerID = {}".format(character.ObjectConfig["ObjectID"]))
|
||||
PlayerInventory = InventoryTable.selectAll("OwnerID = {}".format(character["ObjectID"]))
|
||||
inventory : Inventory = character.ObjectConfig["Inventory"]
|
||||
|
||||
InventoryTableObjects = []
|
||||
for item in PlayerInventory:
|
||||
InventoryTableObjects.append(item["ObjectID"])
|
||||
|
||||
InventoryCharacterObjects = []
|
||||
for item in inventory.InventoryList:
|
||||
InventoryTable.insert({"LOT":item["LOT"], "Slot":item["Slot"],
|
||||
"Equipped":int(item["Equipped"]), "Linked":int(item["Linked"]),
|
||||
"Quantity":item["Quantity"], "ObjectID":item["ObjectID"],
|
||||
"OwnerID":character.ObjectConfig["ObjectID"]})
|
||||
InventoryCharacterObjects.append(item["ObjectID"])
|
||||
|
||||
for item in inventory.InventoryList:
|
||||
if(item["ObjectID"] not in InventoryTableObjects):
|
||||
InventoryTable.insert({"LOT":item["LOT"], "Slot":item["Slot"],
|
||||
"Equipped":int(item["Equipped"]), "Linked":int(item["Linked"]),
|
||||
"Quantity":item["Quantity"], "ObjectID":item["ObjectID"],
|
||||
"OwnerID":character.ObjectConfig["ObjectID"]})
|
||||
else:
|
||||
InventoryTable.update({"Linked":int(item["Linked"]), "Quantity":item["Quantity"], "Slot":item["Slot"]}, "ObjectID = {} AND OwnerID = {}".format(item["ObjectID"], character.ObjectConfig["ObjectID"]))
|
||||
for item in InventoryTableObjects:
|
||||
if(item not in InventoryCharacterObjects):
|
||||
InventoryTable.delete("OwnerID = {} AND ObjectID = {}".format(character.ObjectConfig["ObjectID"], item))
|
||||
|
||||
|
||||
posStr = "{},{},{}".format(character.ObjectConfig["Position"].X,character.ObjectConfig["Position"].Y,character.ObjectConfig["Position"].Z)
|
||||
rotStr = "{},{},{},{}".format(character.ObjectConfig["Rotation"].X,
|
||||
|
||||
@@ -148,10 +148,6 @@ class Mission():
|
||||
for item in self.RewardItems:
|
||||
itemId = random.randint(100000000000000000, 999999999999999999)
|
||||
self.Parent.ObjectConfig["Inventory"].addItem(item, itemId)
|
||||
self.Parent.ObjectConfig["CompletedMissions"].append(self.MissionID)
|
||||
for i in range(len(self.Parent.ObjectConfig["CurrentMissions"])):
|
||||
if(self.Parent.ObjectConfig["CurrentMissions"][i] == self):
|
||||
del self.Parent.ObjectConfig["CurrentMissions"][i]
|
||||
|
||||
class Humanoid(ReplicaObject):
|
||||
def __init__(self, Parent):
|
||||
|
||||
@@ -27,8 +27,9 @@ def MissionOffering(Object, stream : ReadStream, address : Address, Server : Gam
|
||||
Server.InitializeGameMessage(NotifyMission, PlayerID, 0x0fe)
|
||||
NotifyMission.write(c_int(MissionID))
|
||||
NotifyMission.write(c_int(State))
|
||||
NotifyMission.write(c_bit(Complete))
|
||||
NotifyMission.write(c_bit(False))
|
||||
Server.send(NotifyMission, address)
|
||||
|
||||
if(Server.Game.getObjectByID(PlayerID).getMissionByID(MissionID) is None):
|
||||
missionTable = Server.CDClient.Tables["Missions"]
|
||||
mission = missionTable.select(["target_objectID", "id", "defined_type",
|
||||
@@ -41,4 +42,9 @@ def MissionOffering(Object, stream : ReadStream, address : Address, Server : Gam
|
||||
else:
|
||||
player = Server.Game.getObjectByID(PlayerID)
|
||||
missionObj = player.getMissionByID(MissionID)
|
||||
missionObj.Complete()
|
||||
missionObj.Complete()
|
||||
missionObj.Parent.ObjectConfig["CompletedMissions"].append(MissionID)
|
||||
for i in range(len(missionObj.Parent.ObjectConfig["CurrentMissions"])):
|
||||
if(missionObj.Parent.ObjectConfig["CurrentMissions"][i] == missionObj):
|
||||
del missionObj.Parent.ObjectConfig["CurrentMissions"][i]
|
||||
print("Removed Old Mission")
|
||||
|
||||
@@ -21,6 +21,7 @@ def HandleInteraction(Object, stream : ReadStream, address : Address, Server : G
|
||||
"reward_item3_count", "reward_item4", "reward_item4_count"], "offer_objectID = {} OR target_objectID = {}".format(gameObject.ObjectConfig["LOT"],gameObject.ObjectConfig["LOT"]))
|
||||
except:
|
||||
return
|
||||
|
||||
if(missions != []):
|
||||
for mission in missions:
|
||||
canGive = True
|
||||
@@ -29,13 +30,13 @@ def HandleInteraction(Object, stream : ReadStream, address : Address, Server : G
|
||||
if(prereqMission not in Object.ObjectConfig["CompletedMissions"]):
|
||||
canGive = False
|
||||
if(canGive):
|
||||
packet = WriteStream()
|
||||
Server.InitializeGameMessage(packet, Object.ObjectConfig["ObjectID"], 0x00f8)
|
||||
packet.write(c_int(int(mission["id"])))
|
||||
packet.write(c_longlong(gameObject.ObjectConfig["ObjectID"]))
|
||||
Server.send(packet, address)
|
||||
print("Offering Mission {}".format(mission["id"]))
|
||||
return
|
||||
if(mission["id"] not in Object.ObjectConfig["CompletedMissions"]):
|
||||
packet = WriteStream()
|
||||
Server.InitializeGameMessage(packet, Object.ObjectConfig["ObjectID"], 0x00f8)
|
||||
packet.write(c_int(int(mission["id"])))
|
||||
packet.write(c_longlong(gameObject.ObjectConfig["ObjectID"]))
|
||||
Server.send(packet, address)
|
||||
print("Offering Mission {}".format(mission["id"]))
|
||||
|
||||
|
||||
def SmashPlayer(Object, stream : ReadStream, address : Address, Server : GameServer):
|
||||
|
||||
@@ -155,31 +155,6 @@ class WorldServer(GameServer):
|
||||
if(self.Game.getObjectZone(Object) is not None):
|
||||
self.brodcastPacket(packet, self.Game.getObjectZone(Object))
|
||||
|
||||
# def addItemToInventory(self, LOT : int, Player : Character, Quantity : int = 1, Linked : bool = False):
|
||||
# inventory : Inventory = Player.ObjectConfig["Inventory"]
|
||||
# objectID = random.randint(100000000000000000, 999999999999999999)
|
||||
# inventory.addItem(LOT, objectID, Quantity=Quantity, Linked=Linked, Equipped=False)
|
||||
# syncPacket = WriteStream()
|
||||
# self.InitializeGameMessage(syncPacket, Player.ObjectConfig["ObjectID"], 227)
|
||||
# syncPacket.write(c_bit(Linked))#Linked
|
||||
# syncPacket.write(c_bit(False))
|
||||
# syncPacket.write(c_bit(False))
|
||||
# syncPacket.write(c_bit(False))
|
||||
# syncPacket.write(c_ulong(0))
|
||||
# syncPacket.write(c_long(LOT))
|
||||
# syncPacket.write(c_bit(False))
|
||||
# syncPacket.write(c_bit(False))
|
||||
# syncPacket.write(c_bit(False))
|
||||
# syncPacket.write(c_bit(False))
|
||||
# syncPacket.write(c_longlong(objectID))
|
||||
# syncPacket.write(c_float(0))#X flying loot
|
||||
# syncPacket.write(c_float(0))#Y flying loot
|
||||
# syncPacket.write(c_float(0))#Z flying loot
|
||||
# syncPacket.write(c_bit(True))
|
||||
# syncPacket.write(c_int(inventory.getItemByID(objectID)["Slot"]))
|
||||
# session = self.Game.getSessionByCharacterID(Player.ObjectConfig["ObjectID"])
|
||||
# self.send(syncPacket, session.address)
|
||||
|
||||
def spawnObject(self, LOT : int, zoneID : ZoneID, CustomConfig : dict, Position : Vector3 = Vector3(0,0,0), Rotation : Vector4 = Vector4(0,0,0,0), debug : bool = True,
|
||||
initialize : bool = False):
|
||||
try:
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user