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<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 && food_item->Name!=0 && 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) && common.IsStackable())
common.SetCharges(1);
PutItemInInventory(SLOT_CURSOR, (ItemInst& 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!