Re: [SwiftEmu] Fix's for NewCrypto! [UPDATED 01/08]
Quote:
Originally Posted by rafa95123
Well people... I've fixed two new things in Swift Emulator:
Mannequin
HabboWheel
I'll improve the Mannequin... For now remains fix when the save Mannequin Save the Name of Mannequin too !
More Later or tomorrow i post the Mannequin Fix :)
using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { adapter.runFastQuery(string.Concat(new object[] { "UPDATE items SET base_id = '", row["item_id"], "' WHERE item_id = ", item.Id }));
adapter.setQuery(string.Concat(new object[] { "UPDATE items_extradata SET data = '" + row["extradata"] + "' WHERE item_id = " + item.Id })); adapter.addParameter("extradata", row["extradata"]); adapter.runQuery();
adapter.runFastQuery("DELETE FROM user_gifts WHERE gift_id = " + item.Id); }
string s = item.GetBaseItem().Type.ToString().ToLower(); string extraData = row["extradata"].ToString(); item.BaseItem = Convert.ToUInt32(row["item_id"]); item.refreshItem(); item.ExtraData = extraData; if (!room.GetRoomItemHandler().SetFloorItem(this.Session, item, item.GetX, item.GetY, item.Rot, true, false, true)) { this.Session.SendNotif("Failed to create your gift!"); } else { this.Response.Init(Outgoing.OpenGift); this.Response.AppendString(item2.Type.ToString()); this.Response.AppendInt32(item2.SpriteId); this.Response.AppendString(item2.Name); this.Response.AppendInt32(item.Id); this.Response.AppendString(s); this.Response.AppendBoolean(true); this.Response.AppendString(extraData); this.SendResponse(); } } else { room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id); using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { adapter.runFastQuery("DELETE FROM user_gifts WHERE gift_id = " + item.Id); } this.Session.GetMessageHandler().GetResponse().Init(Outgoing.SendPurchaseAlert); this.Session.GetMessageHandler().GetResponse().AppendInt32(1); int i = 2; if (item2.Type.ToString().ToLower().Equals("s")) { if (item2.InteractionType == InteractionType.pet) { i = 3; } else { i = 1; } } this.Session.GetMessageHandler().GetResponse().AppendInt32(i); List<UserItem> list = ButterflyEnvironment.GetGame().GetCatalog().DeliverItems(this.Session, item2, (int)row["amount"], (string)row["extradata"], 0, 0); this.Session.GetMessageHandler().GetResponse().AppendInt32(list.Count); foreach (UserItem item3 in list) { this.Session.GetMessageHandler().GetResponse().AppendInt32(item3.Id); } this.Session.GetMessageHandler().SendResponse(); this.Session.GetHabbo().GetInventoryComponent().UpdateItems(true); //this.Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary); //this.Session.GetMessageHandler().SendResponse(); } } } } this.Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary); this.Session.GetMessageHandler().SendResponse(); }
To enable the gift purchase, edit this:
In Incoming.cs,
Search by: Incoming.PurchaseGift = 0x0901
Replace by: Incoming.PurchaseGift = 0x0900
Sorry my english, i'm brazilian..
|
|
V
For the present don't bug stay in inventory and when placing it on the ground, do this:
In: GameClientMessageHandler.cs, Search by: internal void PlaceItem()
And, replace all void PlaceItem, by:
if (strArray[1].StartsWith(":")) { try { WallCoordinate wallCoord = new WallCoordinate(":" + str.Split(new char[] { ':' })[1]); item2 = new RoomItem(item.Id, pRoom.RoomId, item.BaseItem, item.ExtraData, wallCoord, pRoom, item.Group_data, item.RareId, item.placedBy); if (pRoom.GetRoomItemHandler().SetWallItem(this.Session, item2)) { this.Session.GetHabbo().GetInventoryComponent().RemoveItem(id, true); } } catch { } } else { try { int x = int.Parse(strArray[1]); int y = int.Parse(strArray[2]); int rot = int.Parse(strArray[3]); if (this.Session.GetHabbo().forceRot > -1) { rot = this.Session.GetHabbo().forceRot; } item2 = new RoomItem(item.Id, pRoom.RoomId, item.BaseItem, item.ExtraData, x, y, 0.0, rot, pRoom, item.Group_data, item.RareId, item.placedBy); if (pRoom.GetRoomItemHandler().SetFloorItem(this.Session, item2, x, y, rot, true, false, true)) { this.Session.GetHabbo().GetInventoryComponent().RemoveItem(id, true); } if (WiredUtillity.TypeIsWired(item.GetBaseItem().InteractionType)) { WiredSaver.HandleDefaultSave(item.Id, pRoom); } } catch (Exception ex) { Logging.LogCriticalException(ex.ToString()); } } } } this.Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary); this.Session.GetMessageHandler().SendResponse(); }
Done!
If you don't have table user_gifts, add USE MY USER_GIFTS TABLE:
PHP Code:
CREATE TABLE IF NOT EXISTS `user_gifts` ( `gift_id` int(10) NOT NULL AUTO_INCREMENT, `page_id` int(10) unsigned NOT NULL DEFAULT '5', `item_id` mediumint(10) NOT NULL, `extradata` varchar(50) NOT NULL DEFAULT '', `amount` int(11) NOT NULL DEFAULT '1', `target_name` varchar(50) NOT NULL, `by_userid` int(50) NOT NULL, `message` varchar(115) NOT NULL DEFAULT '', `ribbon` tinyint(1) NOT NULL DEFAULT '0', `color` tinyint(1) NOT NULL DEFAULT '0', `gift_sprite` int(10) NOT NULL, `show_sender` tinyint(4) NOT NULL DEFAULT '1', `rare_id` int(10) NOT NULL DEFAULT '0', `inventory_id` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`gift_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=300000 ;
Uffs, By Marlon Colhado? ♥
I noticed an error in my code and fixed it ..
to tidy up the falls, below:
In: Catalog.cs Click in "EDIT" -> Go to... and digit: 1144, press Ok.
Search for: if (IsGift)
And, replace all if by:
Simple, now will not fall over when buying gifts..
Like? :D
06-08-13
vicancer
Re: [SwiftEmu] Fix's for NewCrypto! [UPDATED 01/08]
Quote:
Originally Posted by Marlon Colhado
I noticed an error in my code and fixed it ..
to tidy up the falls, below:
In: Catalog.cs Click in "EDIT" -> Go to... and digit: 1144, press Ok.
Search for: if (IsGift)
And, replace all if by: