Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv21620
Modified Files:
Timing.cpp Trade.cpp ai_vendors.cpp boats.cpp combat.cpp
dbl_single_click.cpp dragdrop.cpp items.cpp items.h player.cpp
resources.cpp targetactions.cpp targetrequests.h walking.cpp
world.cpp
Log Message:
removed more1 to more4 and morex to morez
Index: Timing.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Timing.cpp,v
retrieving revision 1.174
retrieving revision 1.175
diff -C2 -d -r1.174 -r1.175
*** Timing.cpp 23 Aug 2003 01:03:30 -0000 1.174
--- Timing.cpp 28 Aug 2003 20:56:16 -0000 1.175
***************
*** 696,709 ****
switch( pItem->type() )
{
- // If it is a sound-item there is a 1%*item->morez chance that
- // It "emits" a sound to this character.
- // This is a rather stupid method...
- // Only one character is hearing the sound at once
- case 88:
- if( pItem->dist( socket->player() ) < pItem->morey() )
- if( RandomNum( 1, 100 ) <= pItem->morez() )
- socket->soundEffect( pItem->morex(), pItem );
- break;
-
// Move Boats
case 117:
--- 696,699 ----
Index: Trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Trade.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -d -r1.85 -r1.86
*** Trade.cpp 27 Aug 2003 20:35:09 -0000 1.85
--- Trade.cpp 28 Aug 2003 20:56:16 -0000 1.86
***************
*** 504,632 ****
void Trade::clearalltrades()
{
- qWarning("cTrade::clearalltrades() disabled");
- /* AllItemsIterator iterItems;
- for (iterItems.Begin(); !iterItems.atEnd(); iterItems++)
- {
- P_ITEM pi = iterItems.GetData();
- if( pi->type() == 1 && pi->pos.x == 26 && pi->pos.y == 0 && pi->pos.z == 0 && pi->id() == 0x1E5E )
- {
- P_CHAR pc = FindCharBySerial(pi->contserial);
- P_ITEM pBackpack = Packitem(pc);
- SERIAL serial = pi->serial();
- unsigned int ci;
- vector<SERIAL> vecContainer = contsp.getData(serial);
- for (ci = 0; ci < vecContainer.size(); ci++)
- {
- P_ITEM pj = FindItemBySerial(vecContainer[ci]);
- if (pj != NULL)
- if ((pj->contserial==serial))
- {
- if(pBackpack != NULL)
- {
- pBackpack->addItem(pj);
- }
- }
- }
- //iterItems++; // Iterator will became invalid when deletting.
- pi->remove();
- clConsole.send("Trade cleared\n");
- }
- }
- */
}
void Trade::trademsg(int s)
{
- /* P_ITEM cont1, cont2;
- cont1 = cont2 = NULL ;
- switch(buffer[s][3])
- {
- case 0://Start trade - Never happens, sent out by the server only.
- break;
- case 2://Change check marks. Possibly conclude trade
- cont1 = FindItemBySerPtr(&buffer[s][4]);
- if (cont1 != NULL)
- cont2 = FindItemBySerial(calcserial(cont1->moreb1(), cont1->moreb2(), cont1->moreb3(), cont1->moreb4()));
- else
- cont2 = NULL;
- if (cont2 != NULL) // lb crashfix
- {
- cont1->setMoreZ(buffer[s][11]);
- sendtradestatus(cont1, cont2);
- if (cont1->morez() && cont2->morez())
- {
- dotrade(cont1, cont2);
- endtrade(calcserial(buffer[s][4], buffer[s][5], buffer[s][6], buffer[s][7]));
- }
- }
- break;
- case 1://Cancel trade. Send each person cancel messages, move items.
- endtrade(calcserial(buffer[s][4], buffer[s][5], buffer[s][6], buffer[s][7]));
- break;
- default:
- clConsole.send("ERROR: Fallout of switch statement without default. wolfpack.cpp, trademsg()\n"); //Morrolan
- }
- */
}
void Trade::dotrade(P_ITEM cont1, P_ITEM cont2)
{
- qWarning("cTrade::dotrade() is disabled");
- /* int serial;
-
- P_CHAR p1 = FindCharBySerial(cont1->contserial);
- if(p1 == NULL) return;
- P_CHAR p2 = FindCharBySerial(cont2->contserial);
- if(p2 == NULL) return;
- if(cont1->morez==0 || cont2->morez==0)
- {//not checked - give items to previous owners - AntiChrist
- P_CHAR t;
- t = p1;
- p1 = p2;
- p2 = t;
- }
- P_ITEM bp1 = Packitem(p1);
- if(bp1 == NULL) return;
- P_ITEM bp2 = Packitem(p2);
- if(bp2 == NULL) return;
- UOXSOCKET s1 = calcSocketFromChar(p1);
- if (s1 ==-1)
- cout << "Error getting socket in trade, calcSocketFromChar for s1" << endl;
- UOXSOCKET s2 = calcSocketFromChar(p2);
- if (s2 ==-1)
- cout << "Error getting socket in trade, calcSocketFromChar for si" << endl;
- serial = cont1->serial();
- unsigned int ci;
- vector<SERIAL> vecContainer = contsp.getData(serial);
- for (ci = 0; ci < vecContainer.size(); ++ci)
- {
- P_ITEM pi = FindItemBySerial(vecContainer[ci]);
- if (pi != NULL)
- if ((pi->contserial==serial))
- {
- bp2->addItem(pi);
- if (s1!=-1)
- pi->update();//AntiChrist
- if (s2!=-1) sendbpitem(s2, pi);
- pi->update();//AntiChrist
- }
- }
- serial = cont2->serial();
- vecContainer.clear();
- vecContainer = contsp.getData(serial);
- for (ci = 0; ci < vecContainer.size(); ++ci)
- {
- P_ITEM pi = FindItemBySerial(vecContainer[ci]);
- if (pi != NULL)
- if ((pi->contserial==serial))
- {
- bp1->addItem(pi);
- if (s2 != INVALID_UOXSOCKET)
- pi->update();//AntiChrist
- if (s1 != INVALID_UOXSOCKET) sendbpitem(s1, pi);
- pi->update();//AntiChrist
- }
- }
- */
}
--- 504,515 ----
Index: ai_vendors.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai_vendors.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ai_vendors.cpp 27 Aug 2003 20:35:09 -0000 1.11
--- ai_vendors.cpp 28 Aug 2003 20:56:16 -0000 1.12
***************
*** 98,103 ****
m_actions.append( new Action_Wander( npc, this ) );
m_actions.append( new Action_FleeAttacker( npc, this ) );
- if( npc )
- TempEffects::instance()->insert( new cStablemasterRefreshTimer( npc, this, SrvParams->stablemasterRefreshTime() ) );
}
--- 98,101 ----
***************
*** 105,109 ****
{
AbstractAI::init( npc );
- TempEffects::instance()->insert( new cStablemasterRefreshTimer( npc, this, SrvParams->stablemasterRefreshTime() ) );
}
--- 103,106 ----
***************
*** 133,137 ****
{
int gold = pTalker->CountBankGold() + pTalker->CountGold();
- int topay = 0;
P_ITEM pPack = m_npc->getBackpack();
cItem::ContainerContent stableitems;
--- 130,133 ----
***************
*** 142,160 ****
while( it != content.end() )
{
! if( (*it) && (*it)->id() == 0x1ea7 && (*it)->morey() == pTalker->serial() )
! {
! topay += (int)floor( (float)(*it)->morez() * SrvParams->stablemasterGoldPerRefresh() );
stableitems.push_back( (*it) );
- }
++it;
}
}
if( !stableitems.empty() )
{
- if( topay > gold )
- {
- m_npc->talk( tr("You do not possess enough gold. Come later if you have more!") );
- return;
- }
cItem::ContainerContent::const_iterator it( stableitems.begin() );
while( it != stableitems.end() )
--- 138,152 ----
while( it != content.end() )
{
! if( !(*it)->tags().has( "player" ) || !(*it)->tags().has( "pet" ) )
! continue;
!
! if( (*it) && (*it)->id() == 0x1ea7 && (*it)->tags().get( "player" ).asInt() == pTalker->serial() )
stableitems.push_back( (*it) );
++it;
}
}
+
if( !stableitems.empty() )
{
cItem::ContainerContent::const_iterator it( stableitems.begin() );
while( it != stableitems.end() )
***************
*** 162,166 ****
if( (*it) )
{
! P_NPC pPet = dynamic_cast<P_NPC>(World::instance()->findChar( (*it)->morex() ));
if( pPet )
{
--- 154,158 ----
if( (*it) )
{
! P_NPC pPet = dynamic_cast<P_NPC>(World::instance()->findChar( (*it)->tags().get( "pet" ).asInt() ));
if( pPet )
{
***************
*** 173,184 ****
++it;
}
pPack->update();
! if( topay > 0 )
! {
! pTalker->takeGold( topay, true );
! m_npc->talk( tr("Here you are! That costs %1 gold. Farewell!").arg( topay ) );
! }
! else
! m_npc->talk( tr("Here's your pet back!") );
}
}
--- 165,171 ----
++it;
}
+
pPack->update();
! m_npc->talk( tr("Here's your pet back!") );
}
}
***************
*** 188,209 ****
void Human_Stablemaster::refreshStock()
{
- // let's increase the refresh times of the gems in the
- // stablemaster's backpack
- P_ITEM pPack = m_npc->getBackpack();
- if( pPack )
- {
- cItem::ContainerContent content = pPack->content();
- cItem::ContainerContent::const_iterator it( content.begin() );
- while( it != content.end() )
- {
- if( (*it) && (*it)->id() == 0x1ea7 )
- {
- (*it)->setMoreZ( (*it)->morez() + 1 );
- }
- ++it;
- }
- }
-
- TempEffects::instance()->insert( new cStablemasterRefreshTimer( m_npc, this, SrvParams->stablemasterRefreshTime() ) );
}
--- 175,178 ----
***************
*** 237,243 ****
P_ITEM pGem = new cItem();
pGem->Init( false );
! pGem->setMoreX( pPet->serial() );
! pGem->setMoreY( player->serial() );
! pGem->setMoreZ( 0 );
pGem->setId( 0x1ea7 );
pGem->setName( tr("petitem: %1").arg(pPet->name()) );
--- 206,211 ----
P_ITEM pGem = new cItem();
pGem->Init( false );
! pGem->tags().set( "player", cVariant( player->serial() ) );
! pGem->tags().set( "pet", cVariant( pPet->serial() ) );
pGem->setId( 0x1ea7 );
pGem->setName( tr("petitem: %1").arg(pPet->name()) );
Index: boats.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** boats.cpp 27 Aug 2003 23:20:55 -0000 1.110
--- boats.cpp 28 Aug 2003 20:56:16 -0000 1.111
***************
*** 1016,1061 ****
}
- /*
- // khpae : initial setup for auto sailing
- void cBoat::setAutoSail (UOXSOCKET s, P_ITEM pMap, P_ITEM pTiller) {
- P_CHAR pc = currchar[s];
- if (pc == NULL) {
- return;
- }
-
- if( !pTiller->tags().get( "boatserial" ).isValid() )
- return;
-
- if (!pMap->mapNumPin) {
- itemtalk (s, pTiller, "Sir, there's no ship course.");
- return;
- }
- if (pc->multis == INVALID_SERIAL) {
- sysmessage (s, "You must be on the boat to do that.");
- return;
- }
- SERIAL bserial = pTiller->tags().get( "boatserial" ).toUInt();
- if (bserial != pc->multis) {
- sysmessage (s, "You must be on the boat to do that.");
- return;
- }
- int x0 = (pMap->more1<<8) | pMap->more2;
- int y0 = (pMap->more3<<8) | pMap->more4;
- int x1 = (pMap->moreb1<<8) | pMap->moreb2;
- int y1 = (pMap->moreb3<<8) | pMap->moreb4;
- int width = 134 * (pMap->morez + 1);
- int i, posx, posy;
- for (i=0; i<pMap->mapNumPin; i++) {
- posx = x0 + pMap->mapPinXY[i][0]*(x1-x0) / width;
- posy = y0 + pMap->mapPinXY[i][1]*(y1-y0) / width;
- this->mapPinXY[i][0] = (unsigned short)posx;
- this->mapPinXY[i][1] = (unsigned short)posy;
- }
- itemtalk (s, pTiller, "Aye, Sir.");
- this->autosail_ = this->boatdir + 1;
- this->mapNumPin = pMap->mapNumPin;
- }
- */
-
char cBoat::speechInput( cUOSocket* socket, const QString& msg )//See if they said a command. msg must already be capitalized
{
--- 1016,1019 ----
Index: combat.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/combat.cpp,v
retrieving revision 1.143
retrieving revision 1.144
diff -C2 -d -r1.143 -r1.144
*** combat.cpp 20 Aug 2003 17:10:48 -0000 1.143
--- combat.cpp 28 Aug 2003 20:56:16 -0000 1.144
***************
*** 1368,1599 ****
}
}
-
- #pragma note("convert old cCombat::ItemCastSpell to python(?)")
- /* ==> PYTHON
- void cCombat::ItemCastSpell( P_CHAR pAttacker, P_CHAR pDefender, P_ITEM pItem )
- {
- if( !pAttacker || !pDefender || !pItem )
- return;
-
- UINT16 spellnum = ( ( pItem->morex * 8 ) - 8 ) + pItem->morey;
- UINT16 tempmana = pAttacker->mn(); //Save their mana so we can give it back.
- UINT16 tempmage = pAttacker->skillValue( MAGERY ); //Easier than writing new functions for all these spells
-
- if( pItem->type() != 15 || pItem->morez <= 0 )
- return;
-
- switch( spellnum )
- {
- case 1: Magic->ClumsySpell( pAttacker, pDefender ); break;
- case 3: Magic->FeebleMindSpell( pAttacker, pDefender ); break;
- case 5: Magic->MagicArrow( pAttacker, pDefender ); break;
- case 8: Magic->WeakenSpell( pAttacker, pDefender ); break;
- case 18: Magic->FireballSpell( pAttacker, pDefender ); break;
- case 22: Magic->HarmSpell( pAttacker, pDefender ); break;
- case 27: Magic->CurseSpell( pAttacker, pDefender ); break;
- case 30: Magic->LightningSpell( pAttacker, pDefender ); break;
- case 37: Magic->MindBlastSpell( pAttacker, pDefender ); break;
- case 38: Magic->ParalyzeSpell( pAttacker, pDefender ); break;
- case 42: Magic->EnergyBoltSpell( pAttacker, pDefender ); break;
- case 43: Magic->ExplosionSpell( pAttacker, pDefender ); break;
- case 51: Magic->FlameStrikeSpell( pAttacker, pDefender ); break;
- default:
- staticeffect( pAttacker, 0x37, 0x35, 0, 30 );
- pAttacker->soundEffect( 0x5C );
- break;
- }
-
- pAttacker->setMn(pAttacker->mn() + tempmana);
- pAttacker->setSkill( MAGERY, tempmage );
-
- if( pAttacker->in() < pAttacker->mn() )
- pAttacker->setMn( pAttacker->in() );
-
- pItem->morez--;
-
- if( pAttacker->socket() )
- {
- pAttacker->socket()->updateMana();
-
- if( pItem->morez == 0 )
- pAttacker->socket()->sysMessage( tr( "This item is out of charges." ) );
- }
- }*/
-
- #pragma note("Reimplement NpcSpellAttack with cMagic!")
- /*
- static void NpcSpellAttack( P_CHAR pc_attacker, P_CHAR pc_defender, unsigned int currenttime, int los )
- {
- if( pc_attacker->spatimer <= currenttime )
- {
-
- int spattacks = numbitsset( pc_attacker->spattack );
-
- if (!pc_defender->isDead() && chardist(pc_attacker, pc_defender) < SrvParams->attack_distance() && spattacks > 0 )
- {
- if (los)
- {
- int spattackbit=rand()%(spattacks) + 1;
- switch(whichbit(pc_attacker->spattack, spattackbit))
- {
- case 1:
- if (pc_attacker->mn()>=4)
- {
- npcaction(pc_attacker, 6);
- Magic->MagicArrow(pc_attacker, pc_defender);
- }
- break;
- case 2:
- if (pc_attacker->mn()>=6)
- {
- npcaction(pc_attacker, 6);
- Magic->HarmSpell(pc_attacker, pc_defender);
- }
- break; //lb
- case 3:
- if (pc_attacker->mn()>=4)
- {
- npcaction(pc_attacker, 6);
- Magic->ClumsySpell(pc_attacker, pc_defender);
- }
- break; //LB
- case 4:
- if (pc_attacker->mn()>=4)
- {
- npcaction(pc_attacker, 6);
- Magic->FeebleMindSpell(pc_attacker, pc_defender);
- }
- break; //LB
- case 5:
- if (pc_attacker->mn()>=4)
- {
- npcaction(pc_attacker, 6);
- Magic->WeakenSpell(pc_attacker, pc_defender);
- }
- break; //LB
- case 6:
- if (pc_attacker->mn()>=9)
- {
- npcaction(pc_attacker, 6);
- Magic->FireballSpell(pc_attacker, pc_defender);
- }
- break; //LB
- case 7:
- if (pc_attacker->mn()>=11)
- {
- npcaction(pc_attacker, 6);
- Magic->CurseSpell(pc_attacker, pc_defender);
- }
- break; //LB
- case 8:
- if (pc_attacker->mn()>=11)
- {
- npcaction(pc_attacker, 6);
- Magic->LightningSpell(pc_attacker, pc_defender);
- }
- break; //lb
- case 9:
- if (pc_attacker->mn()>=14)
- {
- npcaction(pc_attacker, 6);
- Magic->ParalyzeSpell(pc_attacker, pc_defender);
- }
- break; //lb
- case 10:
- if (pc_attacker->mn()>=14)
- {
- npcaction(pc_attacker, 6);
- Magic->MindBlastSpell(pc_attacker, pc_defender);
- }
- break;
- case 11:
- if (pc_attacker->mn()>=20)
- {
- npcaction(pc_attacker, 6);
- Magic->EnergyBoltSpell(pc_attacker, pc_defender);
- }
- break;
- case 12:
- if (pc_attacker->mn()>=20)
- {
- npcaction(pc_attacker, 6);
- Magic->ExplosionSpell(pc_attacker, pc_defender);
- }
- break;
- case 13:
- if (pc_attacker->mn()>=40)
- {
- npcaction(pc_attacker, 6);
- Magic->FlameStrikeSpell(pc_attacker, pc_defender);
- }
- break;
- case 14:
- npcaction(pc_attacker, 6);
- Magic->PFireballTarget(pc_attacker, pc_defender, 10);
- break;
- case 15:
- npcaction(pc_attacker, 6);
- Magic->PFireballTarget(pc_attacker, pc_defender, 20);
- break;
- case 16:
- npcaction(pc_attacker, 6);
- Magic->PFireballTarget(pc_attacker, pc_defender, 40);
- break;
- }
- }
- }
- pc_attacker->spatimer=currenttime+(pc_attacker->spadelay*MY_CLOCKS_PER_SEC); //LB bugkilling
- }
- }
- */
- /*
-
- void cCombat::ItemSpell(cChar* Attacker, cChar* Defender)
- {
- // Check this when magic is done
- /*if( Attacker->npc ) // npcs can't use casting weapons right now (Duke)
- return;
- currentSpellType[ calcSocketFromChar( Attacker ) ]=2;
- unsigned int ci;
- P_ITEM pi;
- vector<SERIAL> vecContainer = contsp.getData(Attacker->serial());
- for ( ci = 0; ci < vecContainer.size(); ci++)
- {
- pi = FindItemBySerial(vecContainer[ci]);
- if ( ( ( pi->layer() == 1 && pi->type() != 9 ) || (pi->layer() == 2 ) ) )
- {
- if( pi->offspell() && ( pi->att || pi->maxDamage() ) && pi->type() == 15 )
- {
- switch( pi->offspell() )
- {
- case 1: Magic->ClumsySpell(Attacker,Defender, false); break;
- case 2: Magic->FeebleMindSpell(Attacker, Defender, false); break;
- case 3: Magic->MagicArrow(Attacker,Defender, false); break;
- case 4: Magic->WeakenSpell(Attacker,Defender, false); break;
- case 5: Magic->HarmSpell(Attacker,Defender, false); break;
- case 6: Magic->FireballSpell(Attacker,Defender, false); break;
- case 8: Magic->CurseSpell(Attacker,Defender, false); break;
- case 9: Magic->LightningSpell(Attacker,Defender, false); break;
- case 11:Magic->MindBlastSpell(Attacker,Defender, false); break;
- case 12:Magic->ParalyzeSpell(Attacker,Defender, false); break;
- case 14:Magic->ExplosionSpell(Attacker,Defender, false); break;
- case 15:Magic->FlameStrikeSpell(Attacker, Defender, false); break;
- default:
- LogErrorVar("invalid offspell value %i",pi->offspell());
- }
- pi->morez--;
- if (pi->morez == 0)
- {
- pi->setType( pi->type2() );
- pi->morex = 0;
- pi->morey = 0;
- pi->setOffspell( 0 );
- }
- }
- return;
- }
- }*//*
- }
-
-
- */
--- 1368,1369 ----
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.215
retrieving revision 1.216
diff -C2 -d -r1.215 -r1.216
*** dbl_single_click.cpp 27 Aug 2003 20:35:10 -0000 1.215
--- dbl_single_click.cpp 28 Aug 2003 20:56:16 -0000 1.216
***************
*** 123,127 ****
if( !pc_currchar->Owns( pi ) && !pc_currchar->isGM() && pc_currchar->isInnocent() )
{
! if( pi->more2() == 1 )
{
pc_currchar->makeCriminal();
--- 123,128 ----
if( !pc_currchar->Owns( pi ) && !pc_currchar->isGM() && pc_currchar->isInnocent() )
{
! // Innocent Corpse?
! if( pi->tags().has( "notority" ) && pi->tags().get( "notority" ).asInt() == 1 )
{
pc_currchar->makeCriminal();
***************
*** 392,402 ****
}
return;
-
- // Teleport object
- case 104:
- pc_currchar->removeFromView( false );
- pc_currchar->MoveTo( pi->morex(), pi->morey(), pi->morez() );
- pc_currchar->resend( false );
- return;
// Drinks (This needs some other effects as well)
--- 393,396 ----
***************
*** 455,483 ****
return;
}
! case 404: // Fraz'z ID wand
! {
! P_ITEM pBackpack = pc_currchar->getBackpack();
! if ( pBackpack != NULL )
! {
! if ((pi->container() == pBackpack) || pc_currchar->Wears(pi) &&(pi->layer() == 1))
! {
! if (pi->morex() <= 0)
! {
! socket->sysMessage( tr("That is out of charges.") );
! return;
! }
! pi->setMoreX((tempuint=pi->morex())--);
! //pi->morex--;
! socket->sysMessage( tr("Your wand now has %1 charges left").arg( pi->morex()) );
! // target(s, 0, 1, 0, 75, "What do you wish to identify?");
! }
! else
! {
! socket->sysMessage(tr("If you wish to use this, it must be equipped or in your backpack."));
! }
! }
! return;
! }
!
// Dyes
case 405:
--- 449,453 ----
return;
}
!
// Dyes
case 405:
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.194
retrieving revision 1.195
diff -C2 -d -r1.194 -r1.195
*** dragdrop.cpp 28 Aug 2003 04:05:42 -0000 1.194
--- dragdrop.cpp 28 Aug 2003 20:56:16 -0000 1.195
***************
*** 124,142 ****
P_ITEM outmostCont = pItem->getOutmostItem();
- // If it's a trade-window, reset the ack-status
- if( outmostCont && ( outmostCont->container() == pChar ) && ( outmostCont->layer() == 0 ) && ( outmostCont->id() == 0x1E5E ) )
- {
- // Get the other sides tradewindow
- P_ITEM tradeWindow = 0;//FindItemBySerial( calcserial( outmostCont->moreb1(), outmostCont->moreb2(), outmostCont->moreb3(), outmostCont->moreb4() ) );
-
- // If one of the trade-windows has the ack-status reset it
- if( tradeWindow && ( tradeWindow->morez() || outmostCont->morez() ) )
- {
- tradeWindow->setMoreZ(0);
- outmostCont->setMoreZ(0);
- // sendtradestatus( tradeWindow, outmostCont );
- }
- }
-
// If the top-most container ( thats important ) is a corpse
// and looting is a crime, flag the character criminal.
--- 124,127 ----
***************
*** 147,151 ****
bool sameGuild = ( GuildCompare( pChar, outmostCont->owner() ) != 0 );
! if( ( outmostCont->more2() == 1 ) && !pChar->Owns( outmostCont ) && !sameGuild )
{
// pChar->karma -= 5;
--- 132,137 ----
bool sameGuild = ( GuildCompare( pChar, outmostCont->owner() ) != 0 );
! if( outmostCont->tags().has( "notority" ) && outmostCont->tags().get( "notority" ).asInt() == 1 &&
! !pChar->Owns( outmostCont ) && !sameGuild )
{
// pChar->karma -= 5;
***************
*** 710,729 ****
socket->bounceItem( pItem, BR_NO_REASON );
return;
- }
- }
-
- // If we put the item into a trade-window
- // Reset the trade-status for both players
- if( pCont->layer() == 0 && pCont->id() == 0x1E5E && pChar->Wears( pCont ) )
- {
- // Trade window???
- P_ITEM tradeWindow = 0;//FindItemBySerial( calcserial( pCont->moreb1(), pCont->moreb2(), pCont->moreb3(), pCont->moreb4() ) );
-
- // If it *IS* a trade-window, replace the status
- if( tradeWindow && ( pCont->morez() || tradeWindow->morez() ) )
- {
- tradeWindow->setMoreZ(0);
- pCont->setMoreZ(0);
- // sendtradestatus( tradeWindow, pCont );
}
}
--- 696,699 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.340
retrieving revision 1.341
diff -C2 -d -r1.340 -r1.341
*** items.cpp 27 Aug 2003 23:20:56 -0000 1.340
--- items.cpp 28 Aug 2003 20:56:16 -0000 1.341
***************
*** 96,106 ****
this->type2_ = src.type2_;
this->weight_ = src.weight_;
- this->more1_ = src.more1_;
- this->more2_ = src.more2_;
- this->more3_ = src.more3_;
- this->more4_ = src.more4_;
- this->morex_ = src.morex_;
- this->morey_ = src.morey_;;
- this->morez_ = src.morez_;
this->amount_ = src.amount_;
this->def_ = src.def_;
--- 96,99 ----
***************
*** 449,459 ****
addField("type", type_);
addField("type2", type2_);
- addField("more1", more1_);
- addField("more2", more2_);
- addField("more3", more3_);
- addField("more4", more4_);
- addField("morex", morex_);
- addField("morey", morey_);
- addField("morez", morez_);
addField("amount", amount_);
addField("decaytime", (decaytime_ > uiCurrentTime) ? decaytime_ - uiCurrentTime : 0 );
--- 442,445 ----
***************
*** 578,588 ****
this->type2_=0;
this->weight_ = 0;
- this->more1_=0; // For various stuff
- this->more2_=0;
- this->more3_=0;
- this->more4_=0;
- this->morex_=0;
- this->morey_=0;
- this->morez_=0;
this->amount_ = 1; // Amount of items in pile
this->def_=0; // Item defense
--- 564,567 ----
***************
*** 1192,1231 ****
this->dir_ = Value.toUShort();
- // <more1>10</more1>
- else if( TagName == "more1" )
- this->more1_ = Value.toInt();
-
- // <more>10</more> <<<<< alias for more1
- else if( TagName == "more" )
- this->more1_ = Value.toInt();
-
- // <more2>10</more2>
- else if( TagName == "more2" )
- this->more2_ = Value.toInt();
-
- // <morex>10</morex>
- else if( TagName == "morex" )
- this->morex_ = Value.toInt();
-
- // <morey>10</morey>
- else if( TagName == "morey" )
- this->morey_ = Value.toInt();
-
- // <morez>10</morez>
- else if( TagName == "morez" )
- this->morez_ = Value.toInt();
-
- // <morexyz>10</morexyz>
- else if( TagName == "morexyz" )
- {
- QStringList Elements = QStringList::split( ",", Value );
- if( Elements.count() == 3 )
- {
- this->morex_ = Elements[ 0 ].toInt();
- this->morey_ = Elements[ 1 ].toInt();
- this->morez_ = Elements[ 2 ].toInt();
- }
- }
-
// <movable />
// <ownermovable />
--- 1171,1174 ----
***************
*** 1518,1527 ****
}
- // Show charges for wands only if they are identified
- if( type() == 15 && !tags().has( "identified" ) )
- itemname.append( tr( " [%1 charge%2]" ).arg( morez_ ).arg( ( morez_ > 1 ) ? "s" : "" ) );
- else if( type() == 404 || type() == 181 )
- itemname.append( tr( " [%1 charge%2]" ).arg( morex_ ).arg( ( morex_ > 1 ) ? "s" : "" ) );
-
// Try a localized Message
if( name_.isNull() )
--- 1461,1464 ----
***************
*** 1540,1550 ****
// Show RepSys Settings of Victim when killed
! if( corpse() )
{
! if( more2_ == 1 )
socket->showSpeech( this, tr( "[Innocent]" ), 0x005A );
! else if( more2_ == 2 )
socket->showSpeech( this, tr( "[Criminal]" ), 0x03B2 );
! else if( more2_ == 3 )
socket->showSpeech( this, tr( "[Murderer]" ), 0x0026 );
}
--- 1477,1489 ----
// Show RepSys Settings of Victim when killed
! if( corpse() && tags_.has( "notority" ) )
{
! int notority = tags_.get( "notority" ).asInt();
!
! if( notority == 1 )
socket->showSpeech( this, tr( "[Innocent]" ), 0x005A );
! else if( notority == 2 )
socket->showSpeech( this, tr( "[Criminal]" ), 0x03B2 );
! else if( notority == 3 )
socket->showSpeech( this, tr( "[Murderer]" ), 0x0026 );
}
***************
*** 1980,1990 ****
type_ = atoi( result[offset++] );
type2_ = atoi( result[offset++] );
- more1_ = atoi( result[offset++] );
- more2_ = atoi( result[offset++] );
- more3_ = atoi( result[offset++] );
- more4_ = atoi( result[offset++] );
- morex_ = atoi( result[offset++] );
- morey_ = atoi( result[offset++] );
- morez_ = atoi( result[offset++] );
amount_ = atoi( result[offset++] );
decaytime_ = atoi( result[offset++] );
--- 1919,1922 ----
***************
*** 2018,2022 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.decaytime,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 1950,1954 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.amount,items.decaytime,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock" );
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2269,2279 ****
}
- else SET_INT_PROPERTY( "more1", more1_ )
- else SET_INT_PROPERTY( "more2", more2_ )
- else SET_INT_PROPERTY( "more3", more3_ )
- else SET_INT_PROPERTY( "more4", more4_ )
- else SET_INT_PROPERTY( "morex", morex_ )
- else SET_INT_PROPERTY( "morey", morey_ )
- else SET_INT_PROPERTY( "morez", morez_ )
else SET_INT_PROPERTY( "defense", def_ )
else SET_INT_PROPERTY( "decaytime", decaytime_ )
--- 2201,2204 ----
***************
*** 2408,2418 ****
}
- else GET_PROPERTY( "more1", more1_ )
- else GET_PROPERTY( "more2", more2_ )
- else GET_PROPERTY( "more3", more3_ )
- else GET_PROPERTY( "more4", more4_ )
- else GET_PROPERTY( "morex", (int)morex_ )
- else GET_PROPERTY( "morey", (int)morey_ )
- else GET_PROPERTY( "morez", (int)morez_ )
else GET_PROPERTY( "defense", (int)def_ )
else GET_PROPERTY( "decaytime", (int)decaytime_ )
--- 2333,2336 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.176
retrieving revision 1.177
diff -C2 -d -r1.176 -r1.177
*** items.h 27 Aug 2003 23:20:56 -0000 1.176
--- items.h 28 Aug 2003 20:56:16 -0000 1.177
***************
*** 101,111 ****
int buyprice() const { return buyprice_; } // Price this item is being sold at by normal vendors
- uchar more1() const { return more1_; }
- uchar more2() const { return more2_; }
- uchar more3() const { return more3_; }
- uchar more4() const { return more4_; }
- uint morex() const { return morex_; }
- uint morey() const { return morey_; }
- uint morez() const { return morez_; }
uint def() const { return def_; }
uchar magic() const { return magic_; }
--- 101,104 ----
***************
*** 150,160 ****
void showName( cUOSocket *socket );
//*****************************************ADDED SETTERS ***************
- void setMore1( uchar data ) { more1_ = data; flagChanged();}
- void setMore2( uchar data ) { more2_ = data; flagChanged();}
- void setMore3( uchar data ) { more3_ = data; flagChanged();}
- void setMore4( uchar data ) { more4_ = data; flagChanged();}
- void setMoreX( uint data ) { morex_ = data; flagChanged();}
- void setMoreY( uint data ) { morey_ = data; flagChanged();}
- void setMoreZ( uint data ) { morez_ = data; flagChanged();}
void setDef( uint data ) { def_ = data; flagChanged(); changed( TOOLTIP );}
void setMagic( uchar data ) { magic_ = data; flagChanged(); changed( TOOLTIP );}
--- 143,146 ----
***************
*** 272,285 ****
int buyprice_;
- // More values
ContainerContent content_;
cUObject* container_;
- uchar more1_; // For various stuff
- uchar more2_;
- uchar more3_;
- uchar more4_;
- uint morex_;
- uint morey_;
- uint morez_;
uint def_; // Item defense
uchar magic_; // 0=Default as stored in client, 1=Always movable, 2=Never movable, 3=Owner movable, 4=Locked Down
--- 258,263 ----
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** player.cpp 27 Aug 2003 23:20:56 -0000 1.31
--- player.cpp 28 Aug 2003 20:56:16 -0000 1.32
***************
*** 548,556 ****
// Will display the right color
if( isInnocent() )
! corpse->setMore2(1);
else if( isCriminal() )
! corpse->setMore2(2);
else if( isMurderer() )
! corpse->setMore2(3);
corpse->setOwner( this );
--- 548,556 ----
// Will display the right color
if( isInnocent() )
! corpse->tags().set( "notority", cVariant( 1 ) );
else if( isCriminal() )
! corpse->tags().set( "notority", cVariant( 2 ) );
else if( isMurderer() )
! corpse->tags().set( "notority", cVariant( 3 ) );
corpse->setOwner( this );
***************
*** 689,695 ****
{
P_ITEM pi = atLayer(Mount);
! if( pi && !pi->free)
{
! P_NPC pMount = dynamic_cast<P_NPC>(FindCharBySerial( pi->morex() ));
if( pMount )
{
--- 689,695 ----
{
P_ITEM pi = atLayer(Mount);
! if( pi && !pi->free )
{
! P_NPC pMount = dynamic_cast<P_NPC>( FindCharBySerial( pi->tags().get( "pet" ).asInt() ) );
if( pMount )
{
***************
*** 698,706 ****
pMount->setWanderY1( pi->pos().y );
pMount->setWanderRadius( pi->pos().z );
! pMount->setBodyID( pi->morey() );
pMount->setDirection( direction() );
! pMount->setStrength( pi->tags().get("strength").toInt() );
! pMount->setDexterity( pi->tags().get("dexterity").toInt() );
! pMount->setIntelligence( pi->tags().get("intelligence").toInt() );
pMount->setHitpoints( pi->hp() );
pMount->setFame( pi->lodamage() );
--- 698,706 ----
pMount->setWanderY1( pi->pos().y );
pMount->setWanderRadius( pi->pos().z );
! pMount->setBodyID( pi->tags().get( "body" ).asInt() );
pMount->setDirection( direction() );
! pMount->setStrength( pi->tags().get( "strength" ).toInt() );
! pMount->setDexterity( pi->tags().get( "dexterity" ).toInt() );
! pMount->setIntelligence( pi->tags().get( "intelligence" ).toInt() );
pMount->setHitpoints( pi->hp() );
pMount->setFame( pi->lodamage() );
***************
*** 789,794 ****
pMountItem->setPos( position );
! pMountItem->setMoreX(pMount->serial());
! pMountItem->setMoreY(pMount->bodyID());
pMountItem->tags().set( "wanderType", (int)pMount->wanderType() );
--- 789,794 ----
pMountItem->setPos( position );
! pMountItem->tags().set( "pet", cVariant( pMount->serial() ) );
! pMountItem->tags().set( "body", cVariant( pMount->bodyID() ) );
pMountItem->tags().set( "wanderType", (int)pMount->wanderType() );
***************
*** 817,821 ****
pMount->setBodyID(0);
MapObjects::instance()->remove( pMount );
! pMount->setPos( Coord_cl(0, 0, 0) );
pMount->setAtWar( false );
--- 817,821 ----
pMount->setBodyID(0);
MapObjects::instance()->remove( pMount );
! pMount->setPos( Coord_cl( 0, 0, 0 ) );
pMount->setAtWar( false );
***************
*** 990,995 ****
pi->Init();
pi->setId( 0x9ab );
! pi->SetOwnSerial(this->serial());
! pi->setMoreX(1);
pi->setType( 1 );
pi->setName( tr( "%1's bank box" ).arg( name() ) );
--- 990,994 ----
pi->Init();
pi->setId( 0x9ab );
! pi->SetOwnSerial( this->serial() );
pi->setType( 1 );
pi->setName( tr( "%1's bank box" ).arg( name() ) );
Index: resources.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resources.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** resources.cpp 27 Aug 2003 23:20:56 -0000 1.44
--- resources.cpp 28 Aug 2003 20:56:16 -0000 1.45
***************
*** 659,662 ****
--- 659,665 ----
}
+ if( pResItem && !( pResItem->tags().has( "vein" ) || pResItem->tags().has( "amount" ) ) )
+ pResItem = 0;
+
resourcespec_st item;
QMap< UINT32, resourcespec_st > possible_resspecs;
***************
*** 779,784 ****
}
! // the amount is stored in morex, vein in morey!
! amount = pResItem->morex();
if( amount == 0 )
{
--- 782,786 ----
}
! amount = pResItem->tags().get( "amount" ).asInt();
if( amount == 0 )
{
***************
*** 794,798 ****
return;
}
! vein = pResItem->morey();
--- 796,800 ----
return;
}
! vein = pResItem->tags().get( "vein" ).asInt();
***************
*** 879,883 ****
amount -= spawnamount;
! pResItem->setMoreX(amount);
if( amount == 0 )
{
--- 881,885 ----
amount -= spawnamount;
! pResItem->tags().set( "amount", cVariant( (int)amount ) );
if( amount == 0 )
{
***************
*** 1186,1191 ****
setDecayTime(uiCurrentTime + SrvParams->resitemdecaytime() * MY_CLOCKS_PER_SEC );
}
! setMoreX(amount);
! setMoreY(vein);
this->setId( 0x1ea7 );
this->amount_ = 1;
--- 1188,1195 ----
setDecayTime(uiCurrentTime + SrvParams->resitemdecaytime() * MY_CLOCKS_PER_SEC );
}
!
! tags().set( "amount", cVariant( (int)amount ) );
! tags().set( "vein", cVariant( (int)vein ) );
!
this->setId( 0x1ea7 );
this->amount_ = 1;
Index: targetactions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetactions.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** targetactions.cpp 20 Jul 2003 00:04:51 -0000 1.27
--- targetactions.cpp 28 Aug 2003 20:56:16 -0000 1.28
***************
*** 189,193 ****
bool cSkLockpicking::responsed( cUOSocket *socket, cUORxTarget *target )
{
! const P_ITEM pi = FindItemBySerial( target->serial() );
P_CHAR pc_currchar = socket->player();
if (pi && !pi->isLockedDown()) // Ripper
--- 189,193 ----
bool cSkLockpicking::responsed( cUOSocket *socket, cUORxTarget *target )
{
! /* const P_ITEM pi = FindItemBySerial( target->serial() );
P_CHAR pc_currchar = socket->player();
if (pi && !pi->isLockedDown()) // Ripper
***************
*** 234,238 ****
}
}
! }
return true;
}
--- 234,238 ----
}
}
! }*/
return true;
}
Index: targetrequests.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** targetrequests.h 20 Aug 2003 17:10:48 -0000 1.43
--- targetrequests.h 28 Aug 2003 20:56:16 -0000 1.44
***************
*** 188,227 ****
bool poisonItem( cUOSocket* socket, cUORxTarget* target )
{
-
- P_ITEM pi = FindItemBySerial( target->serial() );
- if ( !pi )
- return true;
-
- P_CHAR pc = socket->player();
- int success=0;
- switch(pPoison->morez())
- {
- case 1: success=pc->checkSkill( POISONING, 0, 500); break;//lesser poison
- case 2: success=pc->checkSkill( POISONING, 151, 651); break;//poison
- case 3: success=pc->checkSkill( POISONING, 551, 1051); break;//greater poison
- case 4: success=pc->checkSkill( POISONING, 901, 1401); break;//deadly poison
- default:
- // LogError("cSkPoisoning::poisonItem(..): switch reached default\n");
- return true;
- }
-
- pc->soundEffect( 0x0247 ); //poisoning effect
-
- if(success)
- {
-
- if(pi->poisoned()<pPoison->morez()) pi->setPoisoned( pPoison->morez() );
- socket->sysMessage( tr("You successfully poison that item.") );
- }
- else
- socket->sysMessage( tr("You fail to apply the poison.") );
-
- //empty bottle after poisoning
- pPoison->remove();
- pPoison = new cItem;
- pPoison->Init(true);
- pPoison->setId(0x0F0E);
- pPoison->moveTo(pc->pos());
- pPoison->update();
return true;
}
--- 188,191 ----
Index: walking.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v
retrieving revision 1.87
retrieving revision 1.88
diff -C2 -d -r1.87 -r1.88
*** walking.cpp 20 Aug 2003 17:10:48 -0000 1.87
--- walking.cpp 28 Aug 2003 20:56:16 -0000 1.88
***************
*** 350,393 ****
return true;
- // Decide what to do on type first.
- switch( pItem->type() )
- {
- // Gate
- case 51:
- case 52:
- dPos.x = pItem->morex();
- dPos.y = pItem->morey();
- dPos.z = pItem->morez();
-
- // Soundeffect before teleport
- pChar->soundEffect( 0x1FE );
-
- // Teleport us
- pChar->removeFromView( false );
- pChar->moveTo( dPos );
- pChar->resend( false );
-
- // And soundeffect after
- pChar->soundEffect( 0x1FE );
- pChar->effect( 0x372A, 0x09, 0x06 );
-
- /* // Teleport pets
- RegionIterator4Chars iter( pChar->pos() );
- for( iter.Begin(); !iter.atEnd(); iter++ )
- {
- P_NPC pPet = dynamic_cast<P_NPC>(iter.GetData());
- if( pPet->wanderFollowTarget() == pChar->serial() )
- {
- if( pPet->inRange( pItem, 4 ) )
- {
- pPet->removeFromView( false );
- pPet->moveTo( dPos );
- pPet->resend( false );
- }
- }
- }*/
- return true;
- };
-
return false;
}
--- 350,353 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** world.cpp 28 Aug 2003 04:05:42 -0000 1.34
--- world.cpp 28 Aug 2003 20:56:16 -0000 1.35
***************
*** 536,540 ****
if( it != p->items.end() )
{
! clConsole.log( LOG_ERROR, QString( "Trying to register an item with the Serial 0x%08x which is already in use." ).arg( serial ) );
return;
}
--- 536,540 ----
if( it != p->items.end() )
{
! clConsole.log( LOG_ERROR, QString( "Trying to register an item with the Serial 0x%1 which is already in use." ).arg( serial, 16 ) );
return;
}
***************
*** 545,549 ****
if( !pItem )
{
! clConsole.log( LOG_ERROR, QString( "Trying to register an object with an item serial (0x%08x) which is no item." ).arg( serial ) );
return;
}
--- 545,549 ----
if( !pItem )
{
! clConsole.log( LOG_ERROR, QString( "Trying to register an object with an item serial (0x%1) which is no item." ).arg( serial, 16 ) );
return;
}
|