Skip to content
Browse files

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.
  • Loading branch information...
1 parent 7df3414 commit 7c63b9d2c1ffceaca272ce9262b1567209f2b0eb giwo committed
Showing with 49 additions and 15 deletions.
  1. +4 −1 source/Changelog.txt
  2. +35 −6 source/cGuild.cpp
  3. +1 −0 source/cGuild.h
  4. +1 −1 source/cServerData.cpp
  5. +1 −1 source/cVersionClass.cpp
  6. +1 −1 source/classes.h
  7. +4 −1 source/items.cpp
  8. +2 −4 source/skills.cpp
View
5 source/Changelog.txt
@@ -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).
View
41 source/cGuild.cpp
@@ -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()];
@@ -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;
@@ -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
{
@@ -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
{
@@ -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;
@@ -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() )
{
@@ -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() )
{
View
1 source/cGuild.h
@@ -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 );
View
2 source/cServerData.cpp
@@ -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
}
View
2 source/cVersionClass.cpp
@@ -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";
View
2 source/classes.h
@@ -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 );
View
5 source/items.cpp
@@ -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() ) )
{
@@ -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 );
}
View
6 source/skills.cpp
@@ -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

0 comments on commit 7c63b9d

Please sign in to comment.
Something went wrong with that request. Please try again.