EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   EQemu - Gone Fishing! (https://www.eqemulator.org/forums/showthread.php?t=9500)

Qtoken 09-23-2003 08:12 AM

EQemu - Gone Fishing!
 
EDIT: how could I forget fishin' and BEER! Thanks Kgaul
EDIT2: And Skillups
EDIT3: BTW this is extreemly basic fishing.. TWEEK the chances to catch fish / skillups (added code here)

Alright: Here is a quick bit of code for basic fishin that goes into client_process.cpp as an opcode (0x0073) .. seems fishing is no-longer a tradeskill and now has its own opcode?

the 0x0073 code is sent when you cast your line.. so, this will return fish to you as soon as you cast, if you succed. The client then handles the recast delay. The client already checks if you have a rod and bait before even sending this Op-code.

This code is a Mix & Fix of the forrageing code as well as the the basics of the GM item summon.

Quote:

<pre>
// opcode 0x0073 is use for for fishing - when casting the fishing line
case 0x0073: {
if (m_inv[SLOT_CURSOR]) {
this->Message(13, "You cannot fish while you are holding something.");
break;
}
if (rand()%8==1) {
this->Message(MT_Emote, "You spill your beer while casting your line!.");
}
if(rand()%20==1){
this->Message(MT_Emote, "You take a swig of your beer!.");
//emote (Drinking BEER!)
//Increase drunkeness by 5
}
//Even if you have max 252skill you're not guarenteed to catch anything.
//And there is at least a one in 10 chance to always catch something.
if (rand()%280&lt;GetSkill(FISHING)||rand()%10==1) {
uint32 food_id = 13019; // fresh fish
//set different items and chances to catch them as food_id.
const Item_Struct* food_item = database.GetItem(food_id);
if (food_item &amp;&amp; food_item->Name!=0 &amp;&amp; food_item!=NULL) {
sint8 charges = 1;
this->Message(MT_Emote, "You caught a %s",food_item->Name);
ItemCommonInst common(food_item, charges);
if ((charges==0) &amp;&amp; common.IsStackable())
common.SetCharges(1);
PutItemInInventory(SLOT_CURSOR, (ItemInst&amp;)common);
SendItemPacket(SLOT_CURSOR, m_inv[SLOT_CURSOR], ItemPacketSummonItem);
}
else{
Message(0, "No such item: %i", food_id);
break;
}
}
else {this->Message(MT_Emote, "You failed to catch anything.");}
float wisebonus = (m_pp.WIS > 200) ? 20 + ((m_pp.WIS - 200) * 0.05) : m_pp.WIS * 0.1;
if ((55-(GetSkill(FISHING)*0.236))+wisebonus > (float)rand()/RAND_MAX*100)
this->SetSkill(FISHING,GetSkill(FISHING)+1);
break;
}
</pre>
Now .. for the problems:

1) Find and Delete a fishing bait off of a stack in your inventory? Any ideas how to delete an item? eg. breaking fishing pole .. etc

2) As long as you're standing on dry land (not swimming) you can fish .. even in the middle of a desert of RO .. Any fish you find there isn't going to be too fresh!

Kgaul 09-23-2003 08:18 AM

dont forget about the spiilling of the beer!

Kgaul


*edit* yea i take spelling to new lows

Qtoken 09-24-2003 11:43 AM

Added beer - and chances
 
Just wanted to draw attention back to this thread if anyone has included this code into their server yet .. TWEEK it. It was only meant as a base outline for fish'n

Chances to catch fish / other items .. etc. (Zone depending)

And there are a few issues to be worked out before its used.
Fishing Location & Bait use for example.. What I was looking for was suggestions on how to fix these two items.


All times are GMT -4. The time now is 02:20 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.