Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2007, 05:03 AM
cbodmer
Fire Beetle
 
Join Date: Oct 2006
Posts: 24
Default

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
Reply With Quote
  #2  
Old 09-02-2007, 01:58 PM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

Excellent work as always! If no one else does, once I see this implemented in the core I will copy this post to the wiki for reference.

Thank you again for your efforts
Reply With Quote
  #3  
Old 09-03-2007, 12:39 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

It's a lot of stuff to look at, I've DLed it and will take a look when I get a chance.
Reply With Quote
  #4  
Old 09-03-2007, 02:13 AM
cbodmer
Fire Beetle
 
Join Date: Oct 2006
Posts: 24
Default

Let me know if you have any questions or problems with my patches.
__________________
Head Admin, Legacy of The Rathe server
http://eq.ismg.ch
Reply With Quote
  #5  
Old 09-03-2007, 01:14 PM
Striat
Sarnak
 
Join Date: Aug 2006
Posts: 60
Default

This is great! I'm sure the community will appreciate this work you've done as much as I do!

Thanks so much!
Reply With Quote
  #6  
Old 10-20-2007, 05:37 AM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

Wow, I can't wait. While my server is currently hidden due to a new redatabasing soon, please let me know if you need a server to play with. My players are really good at finding issues and being patient on reboots to get new code.

Cheers
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:34 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3