Hercules Elf Bot - Oct 26, 2007 16:29
Originally posted by [b]TPPK[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=309
the combo doesn't works when the merchant set is equipped
raggler, myst case, hyzolist, zipper bear, baby leopard for merchant set
holden, muka, baby leopard, raggler and zipper bear for creator set
the merchant set gets priority over the alchemist set, and they are both possible if taking slotted sunglasses into account (imo on iRO there are sunglasses with myst case card in)
aka they don't work together, but card combos are possible together
also it's the holden card triggering the bonus in eathena, wouldn't it be better to not let it trigger on headgears (again if we concider slotted sunglasses to be in existance)
This post has been edited by Hyper Storm: Oct 26 2007, 09:30 AM
Hercules Elf Bot - May 3, 2012 12:24
Originally posted by [b]Angezerus[/b]
Confirmed. The rest of the original discussion is interesting as well
[url="http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=309"]http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=309[/url]
Hercules Elf Bot - May 3, 2012 15:18
Originally posted by [b]Kenpachi[/b]
Kind of funny... I brought up this topic in IRC yesterday, too.
But unfortunately it was too late to get answers. But be sure, we'll discuss it.
Hercules Elf Bot - Jun 20, 2012 14:04
Originally posted by [b]Skotlex[/b]
isequipped keeps a hash to know which cards are already used by a previous "isequipped" check. It is in place to avoid issues such as using the same card multiple times for a combo.
Example: Crab Card + Aster + Shell Fish card combo is scripted in the Crab card. Without the hash, you'd be able to trigger the bonus multiple times if you have one Aster card, one Shell Fish card, and multiple Crab cards.
However, the code itself SHOULD work if you have multiple cards. The hash value is different for each card in each slot position.Notice how the hash value is "1<<((equip position)*4 + (slot number)). If this is failing, it might be that the hash variables are not large enough to hold the shifted number. Though the max value to hash is 1<<(4*4+3), 1<<19.... oops. An "int" normally is just 4 bytes long (16 bits). This might explain why it isn't always working?I guess the solution here to use four hash variables instead of two.
So change setitem_hash1/2 to "setitem_hash1/2/3/4" and make them unsigned long (long is better than int for this case).
Set the hash according to the equip index (script function isequipped):
hash = 4*(equip_idx%3) + slot_idx;
unsigned long *sd_hash;
switch (equip_idx/3) {
case 0: sd_hash = &sd->setitem_hash1; break; //EQI_ACC_L, EQI_ACC_R, EQI_SHOES
case 1: sd_hash = &sd->setitem_hash2; break; //EQI_GARMENT, EQI_HEAD_LOW, EQI_HEAD_MID
case 2: sd_hash = &sd->setitem_hash3; break; //EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L
case 3: sd_hash = &sd->setitem_hash4; break; //EQI_HAND_R, EQI_COSTUME_TOP, EQI_COSTUME_MID
default: continue; //Unsupported gear piece, cannot hash it.
}
if ((*sd_hash)&hash) continue; //Card already used
//We have found a match
flag = 1;
(*sd_hash) |= hash;
...And with this change, you should properly support up to four slots on equipment pieces with index from 0 to 11 (I don't think EQI_COSTUME pieces have any cards, otherwise if you want to support EQI_COSTUME_LOW you need a fifth hash variable :/)
Damn, this is a lot of variables. I think it could be optimized by setting a temporary structure on status calc pc to hold all hashes, and free that at the end.... oh well, that's a talk for another day.
Sorry, but I can't run rA servers on my machine right now,so I can't test my fix. But it should point you guys on the right direction.
Hercules Elf Bot - Jun 20, 2012 21:12
Originally posted by [b]Ind[/b]
[quote name='Skotlex' timestamp='1340201099' post='10976']
[/quote]
thank you so much for taking the time to elaborate.
This post has been edited by
Ind
on Jun 20, 2012 21:20
Hercules Elf Bot - Jul 27, 2012 0:23
Originally posted by [b]Ind[/b]
Fixed in [rev=16508]