Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2002, 12:55 PM
mByte
Hill Giant
 
Join Date: Feb 2002
Posts: 206
Default Forage Code v.1

I saw a TODO on something so here it is. I hope this is in time for the next release.

Its very basic at the moment because Im not 100% sure how things are pulled from the database in this code yet.

client_process.cpp
---------------------------------------------------------------
#include "skills.h" //add this include please

case OP_Forage:
{
//Forage Version 1.0 - mByte
//TODO: 1 set a reuse time.
// 2 Set item_id to be the item name
// 3 Set Skill Check & Skill Set
// 4 Check Aginst Database and Randomly get a Item.

//Bugs: 1 Camp and Come back with full stack.
// 2 Sitting allows you to forage - need to check if sitting.

int skillinuse;
int skill;
int8 chance = rand()/10;
skillinuse = 27;
skill = pp.skills[skillinuse]; //gets current skill
int16 item_id = 13419; // Summon's Veggies
int charges = 1;
if(chance > 200){
SummonItem(item_id, charges);
Message(0, "You foraged up some %d's!", item_id);
}
else{
Message(0, "You did not forage anything.");
}
//Testing Message
//Message(0, "You Foraged up Something *(chance) %d *(skillinuse) %d *(skill) %d", chance, skillinuse, skill);
Save(); // I dont think this works - somebody check that save
break;
}

-----------------------------------------------------------

Database Table Creation

-----------------------------------------------------------

#
# Table structure for table 'forage_items'
#

CREATE TABLE items_forage (
id int(11) NOT NULL auto_increment,
item_id int(11) unsigned default NULL,
zone_id int(11) unsigned default NULL,
skill_req int(11) unsigned default NULL,
chance int(11) unsigned default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

#
# Dumping data for table 'items_forage'
#
INSERT INTO items_forage VALUES (1,0,0,0,0);

-----------------------------------------------------------

Going to need the creator to make a GUI to this on his program - and make sure I created the table correctly.

Thanks,
__________________
mByte
Reply With Quote
  #2  
Old 02-22-2002, 03:47 PM
Nefarious
Fire Beetle
 
Join Date: Jan 2002
Posts: 18
Default Looks good, but....

Your code looks good, but we already put forage in =(

it should be in next version along with most of the other skills that aren't in yet....
__________________
<!||Nefarious||!>
"Just because I'm smart, doesn't mean i can't act stupid"
Reply With Quote
  #3  
Old 02-22-2002, 04:11 PM
mByte
Hill Giant
 
Join Date: Feb 2002
Posts: 206
Default

DoH!
__________________
mByte
Reply With Quote
  #4  
Old 02-22-2002, 04:12 PM
mByte
Hill Giant
 
Join Date: Feb 2002
Posts: 206
Default

its ok only took me like 20min to write that
__________________
mByte
Reply With Quote
  #5  
Old 02-23-2002, 05:51 AM
DeletedUser
Fire Beetle
 
Join Date: Sep 2002
Posts: 0
Default

looks good mByte sorry someone beat ya to it...
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 05:29 PM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3