Skip to content

Commit

Permalink
Fixed an issue causing smelted iron ore to combine with colored ore …
Browse files Browse the repository at this point in the history
…already in a players pack.

	Fixed a bug making it impossible to accept or deny a recruit into a guild.
	Added functionality to automatically turn on the Guild title display of all members when a guild aligns with Chaos/Order.
  • Loading branch information
giwo committed Jan 19, 2009
1 parent 7df3414 commit 7c63b9d
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 15 deletions.
5 changes: 4 additions & 1 deletion source/Changelog.txt
Expand Up @@ -8,7 +8,10 @@
Fixed an error in tailoring.js where invalid socket and character objects were referenced
Removed a debug-message from taming.js

1/19/2009 - giwo
1/19/2009 - giwo (0.98-4.0b)
Fixed an issue causing smelted iron ore to combine with colored ore already in a players pack.
Fixed a bug making it impossible to accept or deny a recruit into a guild.
Added functionality to automatically turn on the Guild title display of all members when a guild aligns with Chaos/Order.
Added onDropItemOnItem( iDropped, cDropper, iDroppedOn ) JS Event to handle dropping an item on another item.
Added onVirtueGumpPress( pUser, cTarg, buttonNum ) JS Event to handle clicking the Virtue gump icon (and subsequent menus).

Expand Down
41 changes: 35 additions & 6 deletions source/cGuild.cpp
Expand Up @@ -804,6 +804,27 @@ void CGuild::TellMembers( SI32 dictEntry, ... )
}
}

void CGuild::SetGuildFaction( GuildType newFaction )
{
Type( newFaction );

if( newFaction != GT_STANDARD )
{
SERLIST_CITERATOR cIter;
for( cIter = members.begin(); cIter != members.end(); ++cIter )
{
CChar *memberChar = calcCharObjFromSer( (*cIter) );
if( !memberChar->GetGuildToggle() )
{
memberChar->SetGuildToggle( true );
CSocket *memberSock = memberChar->GetSocket();
if( memberSock != NULL )
memberSock->sysmessage( 154 ); // Let him know about the change
}
}
}
}

const std::string CGuild::TypeName( void )
{
return GTypeNames[Type()];
Expand Down Expand Up @@ -1324,9 +1345,9 @@ void CGuildCollection::GumpChoice( CSocket *s )
case BasePage+3: // Guild type
switch( button )
{
case 2: gList[trgGuild]->Type( GT_STANDARD ); break;
case 3: gList[trgGuild]->Type( GT_ORDER ); break;
case 4: gList[trgGuild]->Type( GT_CHAOS ); break;
case 2: gList[trgGuild]->SetGuildFaction( GT_STANDARD ); break;
case 3: gList[trgGuild]->SetGuildFaction( GT_ORDER ); break;
case 4: gList[trgGuild]->SetGuildFaction( GT_CHAOS ); break;
case 5: Menu( s, BasePage + 2, trgGuild ); break;
}
break;
Expand Down Expand Up @@ -1359,7 +1380,7 @@ void CGuildCollection::GumpChoice( CSocket *s )
Menu( s, BasePage + 17, trgGuild, gList[trgGuild]->MemberNumber( button - 2 ) ); // display member number
break;
case BasePage+8: // Member dismiss
if( gList[trgGuild]->NumMembers() >= (button - 2) )
if( gList[trgGuild]->NumMembers() <= (button - 2) )
Menu( s, BasePage + 2, trgGuild );
else
{
Expand All @@ -1372,13 +1393,13 @@ void CGuildCollection::GumpChoice( CSocket *s )
}
break;
case BasePage+9: // Dismiss recruit
if( gList[trgGuild]->NumRecruits() >= (button - 2) )
if( gList[trgGuild]->NumRecruits() <= (button - 2) )
Menu( s, BasePage + 2, trgGuild );
else
gList[trgGuild]->RemoveRecruit( gList[trgGuild]->RecruitNumber( button - 2 ) );
break;
case BasePage+10: // Accept recruit
if( gList[trgGuild]->NumRecruits() >= (button - 2) )
if( gList[trgGuild]->NumRecruits() <= (button - 2) )
Menu( s, BasePage + 2, trgGuild );
else
{
Expand All @@ -1387,6 +1408,8 @@ void CGuildCollection::GumpChoice( CSocket *s )
{
gList[trgGuild]->RecruitToMember( (*tChar) );
tChar->SetGuildNumber( trgGuild );
if( gList[trgGuild]->Type() != GT_STANDARD )
tChar->SetGuildToggle( true );
}
}
break;
Expand All @@ -1397,6 +1420,9 @@ void CGuildCollection::GumpChoice( CSocket *s )
case BasePage+13: // Declare war list
offCounter = tCtr = 0;
ourList = gList[trgGuild]->GuildRelationList();
if( ourList->size() <= (button - 2) )
Menu( s, BasePage + 2, trgGuild );

toCheck = ourList->begin();
while( toCheck != ourList->end() )
{
Expand All @@ -1419,6 +1445,9 @@ void CGuildCollection::GumpChoice( CSocket *s )
case BasePage+14: // Declare peace list
offCounter = tCtr = 0;
ourList = gList[trgGuild]->GuildRelationList();
if( ourList->size() <= (button - 2) )
Menu( s, BasePage + 2, trgGuild );

toCheck = ourList->begin();
while( toCheck != ourList->end() )
{
Expand Down
1 change: 1 addition & 0 deletions source/cGuild.h
Expand Up @@ -108,6 +108,7 @@ class CGuild
bool IsNeutral( GUILDID otherGuild ) const;
bool IsAlly( GUILDID otherGuild ) const;

void SetGuildFaction( GuildType newFaction );
void SetGuildRelation( GUILDID otherGuild, GUILDRELATION toSet );
void Save( std::ofstream &toSave, GUILDID gNum );
void Load( ScriptSection *toRead );
Expand Down
2 changes: 1 addition & 1 deletion source/cServerData.cpp
Expand Up @@ -429,7 +429,7 @@ bool CServerData::ServerBackupStatus( void ) const
void CServerData::ServerSavesTimer( UI32 timer )
{
serversavestimer = timer;
if( timer > 0 && timer < 180 ) // 3 minutes is the lowest value you can set saves for
if( timer < 180 ) // 3 minutes is the lowest value you can set saves for
serversavestimer = 300; // 10 minutes default
}

Expand Down
2 changes: 1 addition & 1 deletion source/cVersionClass.cpp
Expand Up @@ -21,7 +21,7 @@ namespace UOX
// product info
//o---------------------------------------------------------------------------o
const std::string VER = "0.98-4";
const std::string BUILD = "0a";
const std::string BUILD = "0b";
const std::string REALBUILD = "0";
const std::string SVER = "2.0";
const std::string CVER = "2.0";
Expand Down
2 changes: 1 addition & 1 deletion source/classes.h
Expand Up @@ -40,7 +40,7 @@ class cItem
PackTypes getPackType( CItem *i );

CItem * CreateItem( CSocket *mSock, CChar *mChar, const UI16 iID, const UI16 iAmount, const UI16 iColour, const ObjectType itemType, bool inPack = false );
CItem * CreateScriptItem( CSocket *mSock, CChar *mChar, std::string item, const UI16 iAmount, const ObjectType itemType, const bool inPack = false );
CItem * CreateScriptItem( CSocket *mSock, CChar *mChar, std::string item, const UI16 iAmount, const ObjectType itemType, const bool inPack = false, const UI16 iColor = 0xFFFF );
CItem * CreateBaseScriptItem( UString ourItem, const UI08 worldNumber, const ObjectType itemType = OT_ITEM );
CMultiObj * CreateMulti( CChar *mChar, const std::string cName, const UI16 iID, const bool isBoat );
CItem * CreateRandomItem( CSocket *mSock, const std::string itemList );
Expand Down
5 changes: 4 additions & 1 deletion source/items.cpp
Expand Up @@ -291,7 +291,7 @@ CItem * cItem::CreateItem( CSocket *mSock, CChar *mChar, const UI16 iID, const U
//| Description - Creates a script item, gives it an amount, and sets
//| its location (be it in a pack or on the ground).
//o--------------------------------------------------------------------------o
CItem * cItem::CreateScriptItem( CSocket *mSock, CChar *mChar, std::string item, const UI16 iAmount, const ObjectType itemType, const bool inPack )
CItem * cItem::CreateScriptItem( CSocket *mSock, CChar *mChar, std::string item, const UI16 iAmount, const ObjectType itemType, const bool inPack, const UI16 iColor )
{
if( inPack && !ValidateObject( mChar->GetPackItem() ) )
{
Expand All @@ -306,6 +306,9 @@ CItem * cItem::CreateScriptItem( CSocket *mSock, CChar *mChar, std::string item,
if( iAmount > 1 && iCreated->isPileable() )
iCreated->SetAmount( iAmount );

if( iColor != 0xFFFF )
iCreated->SetColour( iColor );

return PlaceItem( mSock, mChar, iCreated, inPack );
}

Expand Down
6 changes: 2 additions & 4 deletions source/skills.cpp
Expand Up @@ -507,12 +507,10 @@ void cSkills::SmeltOre( CSocket *s )
}
UI16 ingotNum = smeltedItem->GetAmount() * 2; // 2 Ingots per ore pile.... shouldn't this be variable based on quality of ore?
sprintf( ingotString, "%s Ingot", oreType->name.c_str() );
CItem *ingot = Items->CreateScriptItem( s, chr, "0x1BF2", ingotNum, OT_ITEM, true );
CItem *ingot = Items->CreateScriptItem( s, chr, "0x1BF2", ingotNum, OT_ITEM, true, oreType->colour );
if( ingot != NULL )
{
ingot->SetName( ingotString );
ingot->SetColour( oreType->colour );
}

s->sysmessage( 818 );
s->sysmessage( 819, oreType->name.c_str() );
smeltedItem->Delete(); // delete the ore
Expand Down

0 comments on commit 7c63b9d

Please sign in to comment.