Nice Poster system for Butterstorm/Habbolatino
Hi,
I've coded system for old posters. You don't need add posters manually to furnidata. You need only one furnidata entry (this is already in furnidata):
Code:
["i","4001","poster","39655","","","","","","","","-1","-1","6"]
Find
Code:
Hashtable CataItems = new Hashtable();
Add to below query poster_id.
Find
Code:
case InteractionType.trophy:
ExtraData = Session.GetHabbo().Username + Convert.ToChar(9) + DateTime.Now.Day + "-" + DateTime.Now.Month + "-" + DateTime.Now.Year + Convert.ToChar(9) + ButterflyEnvironment.FilterInjectionChars(ExtraData, true);
break;
Add after:
Code:
case InteractionType.poster:
ExtraData = Item.PosterId.ToString();
break;
Find extraParam
Change line to:
Code:
Session.GetMessageHandler().GetResponse().AppendStringWithBreak(Item.GetBaseItem(i).InteractionType == InteractionType.poster ? Item.PosterId.ToString() : "");
Find
Code:
internal readonly bool HaveOffer;
Add after:
Code:
internal readonly int PosterId;
Find
Code:
this.HaveOffer = ((string)Row["offer_active"] == "1");
Add after:
Code:
this.PosterId = (int)Row["poster_id"];
Find
Code:
else if (this.songID > 0 && GetBaseItem(i).InteractionType == InteractionType.musicdisc)
{
Message.AppendStringWithBreak(songID.ToString());
}
Add after:
Code:
else if (PosterId > 0)
{
Message.AppendStringWithBreak(PosterId.ToString());
}
Find wireStandard,
Add after: poster,
Find
Code:
case "wireStandard":
return InteractionType.wireStandard;
Add after:
Code:
case "poster":
return InteractionType.poster;
Find
Code:
case InteractionType.wireStandard:
return "wireStandard";
Add after:
Code:
case InteractionType.poster:
return "poster";
Find
Code:
else if (GetBaseItem().Name.Contains("landscape"))
{
Message.AppendInt32(4);
}
Add after:
Code:
else if (GetBaseItem().Name == "poster")
{
Message.AppendInt32(6);
}
Find in Trade.cs UpdateTradeWindow()
Code:
Message.AppendInt32(Item.GetBaseItem().SpriteId);
Replace below line:
Code:
Message.AppendInt32(0);
to
Code:
Message.AppendInt32((Item.GetBaseItem().InteractionType == InteractionType.poster) ? 6 : 0);
Replace below string:
Code:
Message.AppendStringWithBreak((Item.GetBaseItem().InteractionType == InteractionType.poster) ? Item.ExtraData : string.Empty);
Add new column: poster_id to catalog_items and insert to items_base item who interaction_type is poster.
If you want add all posters easily use my postermaker (NOTICE: edit catalog_items line!):
Code:
<?php
/*=======================================================================
| UberCMS - Advanced Website and Content Management System for uberEmu
| #######################################################################
| Copyright (c) 2010, Roy 'Meth0d' and updates by Matthew 'MDK'
| http://www.meth0d.org & http://www.sulake.biz
| #######################################################################
| This program is free software: you can redistribute it and/or modify
| it under the terms of the GNU General Public License as published by
| the Free Software Foundation, either version 3 of the License, or
| (at your option) any later version.
| #######################################################################
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
\======================================================================*/
function startsWith($haystack, $needle)
{
return !strncmp($haystack, $needle, strlen($needle));
}
echo '<h1>Poster Generator</h1>';
$data = file_get_contents("http://www.habbo.com/gamedata/productdata/1");
$data = str_replace("\n", "", $data);
$data = str_replace("[[", "[", $data);
$data = str_replace("]]", "]", $data);
$data = str_replace("][", "],[", $data);
$ij = 0;
$stuffWeDontKnow = Array();
foreach (explode('],[', $data) as $val)
{
$val = str_replace('[', '', $val);
$val = str_replace(']', '', $val);
$bits = explode(',', $val);
$name = str_replace('"', '', $bits[0]);
$revision = str_replace('"', '', $bits[3]);
if (startsWith($name, 'poster ') != true)
{
continue;
}
$poster = explode(' ', $name);
echo "INSERT INTO `catalog_items` (`page_id`, `item_ids`, `catalog_name`, `cost_credits`, `amount`, `poster_id`) VALUES ('926', '60769', '" . $name . "', '3', '1', '" . $poster[1] . "');<br>";
$stuffWeDontKnow[] = '[' . $val . ']';
$ij++;
}
if ($ij >= 1)
{
foreach ($stuffWeDontKnow as $stuff)
{
}
}
else
{
echo '<Br /><br /><center style="font-size: 120%;"><i><b>Good news!</b><br />I have no new furni for you today.</i></center>';
}
?>
http://i.imgur.com/pHUSt.png
Re: Nice Poster system for Butterstorm/Habbolatino
Sounds nice, thank you Matias =)
Re: Nice Poster system for Butterstorm/Habbolatino
Quote:
Originally Posted by
=dj.matias=
I've coded system for old posters.
Link Me Please.
and Nice Release
Re: Nice Poster system for Butterstorm/Habbolatino
Wow thank you matias (: Release the manequin fix please :c
Re: Nice Poster system for Butterstorm/Habbolatino
Quote:
Originally Posted by
Xversion
Link Me Please.
and Nice Release
This is the system for old posters -.-
Re: Nice Poster system for Butterstorm/Habbolatino
You shoul'd have bots fixed, lol anyway nice release.
Re: Nice Poster system for Butterstorm/Habbolatino
It would be nice if this would be possible with normal furnis :D
Re: Nice Poster system for Butterstorm/Habbolatino
That moment when you spend 30 minutes doing all this when somebody has already coded an automated script with coding.
Re: Nice Poster system for Butterstorm/Habbolatino
Quote:
Originally Posted by
Shorty
That moment when you spend 30 minutes doing all this when somebody has already coded an automated script with coding.
(ノ≥∇≤)ノ
Nice release once again, also.