Allright - here's the big one...
The attached ZIP files contains patches vs 1030 and with opcodes for the Titanium client, that provide a somewhat faithful implementation of the LDoN chests.
The works:
There are three kinds of traps, mechanical, magical and cursed. Each kind can be locked and trapped.
- Rogues can sense traps, disarm and picklock mechanical chests.
- INT casters can appraise for traps, disarm and picklock magical chests (Wuggan's & Xalirilan's spell lines).
- WIS casters can appraise for traps, disarm and picklock cursed chests (Reebo's & Iony's spell lines).
The difficulty of the locks & traps on a chest are determined by the chest's NPC level. Disarming a trapped chest without prior successful appraise/sense is more difficult.
The DB:
I wanted to do it without changes to the npc_types table, but in the end I decided it was better to add a new field:
SQL:
Code:
ALTER TABLE `npc_types` ADD `ldonchest_type` TINYINT( 1 ) NOT NULL DEFAULT '0';
Valid values for this field are:
(defined in common/ldonchesttypes.h)
0: Mechanical
1: Magical
2: Cursed
3: Mechanical_Locked
4: Magical_Locked
5: Cursed_Locked
100: Random
101: Random_Locked
102: Random_Random
You must also set:
NPC Class: 62 (LDoN_Treasure Chest)
NPC Bodytype: 33 (BT_Boxes)
in order for the server to recognize an NPC as a LDoNChest.
For an unlocked chests of the desired type, use values 0-2.
For a locked chests of the desired type, use values 3-5.
For an unlocked chest of a random type (mechanical, magical, cursed), use 100.
For a locked chest of a random type (mechanical, magical, cursed), use 101.
For a chest which may or may not be locked at random and of a random type (mechanical, magical, cursed), use 102.
Traps:
To trap a chest, assign a spell set to the Chest npc_type. The server will determine whether or not a chest is a trapped type based on whether npc_spells_id for the chest npc_type is greater than 0.
The spellset can contain any valid spell(s). If you have more than one spell inside the spellset, the usual NPC casting rules regarding spell priority will apply in the selection of the spell that will fire in case the trap goes off.
So it's feasible to have traps with random effects as well as traps with beneficial effects. LDoN chests will not be subject to the casting time of the spell: the spell will hit instantly.
How to open LDoN chests (Player perspective):
- try to sense trap/appraise the chest several times to find out whether or not it is trapped
- if it is trapped, try disarming it with the appropriate skill/spell
- try to open the chest
- if it is locked, try picking the lock with the appropriate skill/spell, and once picked, open the chest
Trapped and/or Locked chests will award experience based on their level and relative to the opener's level (same rules as when killing an NPC apply) if successfully opened. All other chests will not give experience on opening.
Trapped, Locked, Magical and/or Cursed type chests cannot be harmed by melee or spells. Mechanical chests, which aren't locked, can be attacked and damaged; doing so sets of the trap if there's one.
That's pretty much it.
Code stuff:
New files:
common/ldonchesttypes.h
zone/ldonchests.h
zone/ldonchests.cpp
You may have to add these to your project manually. I've included a new "makefile.common" in the archive, which contains the new object to build.
Selector:
I had to increase the default parameter array size from 10 to 15 here.
client_packet.cpp:
- also contains a fix for the Titanium Banker "Change" bug:
Code:
--- ../EQEmu-0.7.0-1030/zone/client_packet.cpp 2007-08-05 23:13:12.000000000 +0200
+++ ../EQEmu/zone/client_packet.cpp 2007-09-02 10:03:44.000000000 +0200@@ -6689,7 +6790,8 @@
void Client::Handle_OP_BankerChange(const EQApplicationPacket *app)
{
- if(app->size != sizeof(BankerChange_Struct)) {
+ if(app->size != sizeof(BankerChange_Struct) && app->size!=4) // cb: Titanium only sends 4 Bytes for this
+ {
LogFile->write(EQEMuLog::Debug, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size);
DumpPacket(app);
return;
I've included my current set of modified source files in the archive. These are for
REFERENCE only. They are meant to help the code maintainers with merging my patches in case of conflicts. Do
NOT use these files directly, instead, apply the patch files to make sure everything is in working order.
Download Link:
http://ismg.ch/files/ldonchestpatches_v1_0_0.zip
Have fun,
-Chris