PDA

View Full Version : coins weightless


aesian
04-30-2009, 10:19 AM
can we change this somewhere in the code that coins are weightless?

And that there is a loot all button?

drakelord
04-30-2009, 10:50 AM
Loot all button would be very hard to implement, as it is currently not available in the titanium client.

As for coins being weightless, that can be changed.

Find

int16 Client::CalcCurrentWeight() {
const Item_Struct* TempItem = 0;
ItemInst* ins;
int16 Total = 0;
int x;
for(x = 0; x <= 30; x++)
{
TempItem = 0;
ins = GetInv().GetItem(x);
if (ins)
TempItem = ins->GetItem();
if (TempItem)
Total += TempItem->Weight;
}
for (x = 251; x < 331; x++)
{
int TmpWeight = 0;
TempItem = 0;
ins = GetInv().GetItem(x);
if (ins)
TempItem = ins->GetItem();
if (TempItem)
TmpWeight = TempItem->Weight;
if (TmpWeight > 0)
{
int bagslot = 22;
int reduction = 0;
for (int m = 261; m < 331; m += 10)
{
if (x >= m)
bagslot += 1;
}
ItemInst* baginst = GetInv().GetItem(bagslot);
if (baginst && baginst->GetItem() && baginst->IsType(ItemClassContainer))
reduction = baginst->GetItem()->BagWR;
if (reduction > 0)
TmpWeight -= TmpWeight*reduction/100;
Total += TmpWeight;
}
}

if (GetAA(aaPackrat) > 0)
Total *= (GetAA(aaPackrat) * 10) / 100; //AndMetal: guessing 10% per level, up to 50%. description just indicates it affects gear, doesn't mention coin

Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
return Total;
}


and take out the line:

Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;

trevius
04-30-2009, 05:57 PM
I recall some items on live that were favored by monks. I believe they were called coin purses or something like that. Basically, they reduced the weight of coins on your character by a percentage.

I think it would be cool to implement coin purses into the emu if it is possible. I don't really know the specifics offhand about what item settings would be used for that, but 13th floor may be of some use.

Here is a list of some coin purses, which I assume are the items I was thinking of:
http://eqitems.13th-floor.org/itemsearch.php?name=coin+purse

As long as they have something special set on them so we can tell them apart from other bags, it shouldn't be too hard to implement. From looking at a few examples, the only thing I can see special is "bagtype". It seems that the coin purses are all set to bagtype 0. Other bags I looked at are set to type 1 or 5.

Bag of the Tinkerers (Bagtype 1)
http://eqitems.13th-floor.org/itemraw.php?id=17403

Hand Made Backpack (Bagtype 5)
http://eqitems.13th-floor.org/itemraw.php?id=17969

Frizznik's Endless Coin Purse (Bagtype 0)
http://eqitems.13th-floor.org/itemraw.php?id=17209


Here is a list of known bagtypes from the wiki. It definitely isn't a complete list though:
o 2 = Quiver
o 9 = Alchemy Container
o 10 = Toolbox
o 11 = Books (for research)
o 12 = Mortar & Pestle
o 13 = Quest Related?
o 14 = Mixing Bowl
o 15 = Spit
o 16 = Sewing Kit
o 18 = Fletching Kit
o 19 = Brewing
o 20 = Jeweler's Kit
o 24 = Lexicon (wizard research?)
o 25 = Elemental Grimoire (mage research?)
o 26 = Books of Binding (necro research?)
o 27 = Enchanter research?
o 46 = Tackle Box (for fishing)
o 51 = Trader's Satchel (for Bazaar trading)
o 53 = Augmentation Sealer (for applying augments)
o 54 = Cooking

After doing some database searching, it seems that bag type 0 is for bags that also reduce the weight of coins. Assuming that I am not falsely remembering that as a feature on Live. I just did a database search for items with itemclass set to 1, bagtype set to 0 and bagwr not set to 0. This resulted in all of the coin purses and a few other purses that I assume serve the same purpose. The only bag that stood out from that search is this one:

Tailored Small Bag
http://eqitems.13th-floor.org/item.php?id=17047

I would be curious to see if this Tailored bag actually does have a 10% weight reduction benefit on EQLive. If so, it would be safe to assume that bagtype 0 is for coin weight reduction as well as the normal item weight reduction. And if that is the case, we could just check the main inventory slots for a bag with bagtype 0 when calculating player weight and then just reduce their weight by the amount set in the bagwr field.

As far as loot all, I believe that is an option with the new SoF client, but I am not at my EQ PC atm to check for sure. If so, I am sure it would be possible to code it in.

So_1337
04-30-2009, 07:52 PM
Yelinak could drop a coin purse... It just bothered me to think of what part of the dragon it was made from =X

demonstar55
04-30-2009, 08:08 PM
this could also be implemented as a rule so coins could be weightless or not. Coin purses shouldn't be too hard either

demonstar55
05-01-2009, 12:32 AM
if someone made a rule Character:CoinWeightless or something of the like (I don't know too much about the DB, otherwise I'd set it all up myself, but I don't got the stuff to do it here :/)

and then just at 919 in zone/client_mods.cpp adding:

if (!RuleI(Character, CoinWeightless)
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;

that should take care of being able to have a rule to allow servers to enable coin's weight or not rule would default to having a weight (so CoinWeightless would be set to 0, or off)

demonstar55
05-01-2009, 03:47 AM
well, after some testing (and then asking some people :P), weight is calculated client side (but things that benefit from low weight such as monk AC are server side, so that's about all this would effect)

trevius
05-01-2009, 07:35 AM
Item weight is probably calculated client side, but I would kinda be surprised if coin weight was too. The thing that makes me think it might not be is because if you trade coin, it takes a few seconds before weight is actually updated. Not sure what is causing the delay though.

demonstar55
05-01-2009, 12:26 PM
Item weight is probably calculated client side, but I would kinda be surprised if coin weight was too. The thing that makes me think it might not be is because if you trade coin, it takes a few seconds before weight is actually updated. Not sure what is causing the delay though.


Was trying to set up a rule to have coins have a weght or not, they had it both with it set to true and false commented out that crap, still had the weight, and I couldn't find anything else on it, plus mq2docrack can let you walk around over encumbered, pointing towards it bring calculated client side (not sure if docrack will let you do it here, saw some code that should prevent it, or at least log it if you are moving while over encumbered

KLS
05-01-2009, 12:54 PM
It's calculated client side, I'm not really sure why the client sometimes waits a few seconds after trades to update it's weight... another quirk of the client.

trevius
05-01-2009, 05:54 PM
Oh sweet! I just figured out that coin reducing bags do already work client-side lol. Just do a #si 17209 and put the bag it summons into your main inventory slot while you have a bunch of coin weight on you (#givemoney 20000 0 0 0). It will reduce your weight a huge amount as it should. Since this is already handled client-side, we just need to add the code for it server-side and people can easily have a way for their players to have weightless coins by giving them a 100% weight reducing bag with bagtype set to 0. Even without adding the code for it, players will be able to walk the speed they should be walking, since walk speed from weight seems to be purely client-side. The only reason to add the code is so people don't fall off of things and die from the server killing them due to being overweight :P

KLS
05-01-2009, 05:58 PM
But the client handles fall damage too =x

Secrets
05-02-2009, 08:16 AM
I guess you could either do that, or make them have a tribute item with 100% weight reduction a tribute slot. That way they don't have an item slot taken up.

As for falling... remove the packet for dealing fall damage? Not sure.

edit: now that I think about it, tributes might be useful for other things. You could give a dedicated slot on items for having stuff like see invis all the time on a worn effect. The only thing the client would have to do is *maybe* download a spell file, and when the item gets sent to the client it has see invis. I'll see what I come up with. :P

demonstar55
05-02-2009, 01:13 PM
Secrets, fall damage is handled client side

Secrets
05-02-2009, 11:06 PM
Secrets, fall damage is handled client side

I'm well aware of that. But, is the death opcode ever sent to the server if the damage packet that handles falling damage is missing serverside? You could remove the packet that does that, and while you see falling damage (and your client might go unconcious for a split second, much like what happens when you are GM flagged and fall for more than your max HP) clientsided, nothing happens on the server, and thus, you never die.

As far as i'm aware, there is nothing stopping you from removing the update serverside for HP and have that so when you fall, you see the damage message but nothing happens serversided, resulting in you just getting up when you fall.

Sometimes it's easier to remove stuff :P

KLS
05-02-2009, 11:26 PM
We can choose not to actually damage the client but they'll still get the you have fallen for xxx damage message. In fact what we do for the safefall AA is just reduce the damage since we're not sure on the effect used yet. You could probably do something like reduce damage based on how much you weigh if you wanted, but since the fall calc is exponential it may be hard to get something that feels right at any height.

trevius
05-02-2009, 11:38 PM
Actually, even though fall damage is calculated client side, it can be disabled from the server (at least on SoF). In the newzone structure, we send details of the zone and by setting one of the fields to 1, you will never take fall damage. We had to get this identified and corrected for fall damage to work in SoF. Prior to that, it didn't.