Remove trailing whitespace

This commit is contained in:
j883376
2013-05-06 13:07:41 -04:00
parent 7a93966158
commit ffcff4aea1
548 changed files with 16397 additions and 16398 deletions
+54 -54
View File
@@ -4,13 +4,13 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -89,18 +89,18 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) {
char *query = 0;
MYSQL_RES *result;
MYSQL_ROW row;
uint8 index = 0;
uint32 item[FORAGE_ITEM_LIMIT];
uint32 chance[FORAGE_ITEM_LIMIT];
uint32 ret;
for (int c=0; c < FORAGE_ITEM_LIMIT; c++) {
item[c] = 0;
}
uint32 chancepool = 0;
if (RunQuery(query, MakeAnyLenString(&query, "SELECT itemid,chance FROM forage WHERE zoneid= '%i' and level <= '%i' LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT), errbuf, &result))
{
safe_delete_array(query);
@@ -111,7 +111,7 @@ LogFile->write(EQEMuLog::Error, "Possible Forage: %d with a %d chance", item[ind
chancepool = chance[index];
index++;
}
mysql_free_result(result);
}
else {
@@ -119,14 +119,14 @@ LogFile->write(EQEMuLog::Error, "Possible Forage: %d with a %d chance", item[ind
safe_delete_array(query);
return 0;
}
if(chancepool == 0 || index < 1)
return(0);
if(index == 1) {
return(item[0]);
}
ret = 0;
uint32 rindex = MakeRandomInt(1, chancepool);
@@ -137,7 +137,7 @@ LogFile->write(EQEMuLog::Error, "Possible Forage: %d with a %d chance", item[ind
break;
}
}
return ret;
}
@@ -147,7 +147,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
char *query = 0;
MYSQL_RES *result;
MYSQL_ROW row;
uint8 index = 0;
uint32 item[50];
uint32 chance[50];
@@ -155,12 +155,12 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
uint32 npc_chances[50];
uint32 chancepool = 0;
uint32 ret = 0;
for (int c=0; c<50; c++) {
item[c]=0;
chance[c]=0;
}
if (RunQuery(query, MakeAnyLenString(&query, "SELECT itemid,chance,npc_id,npc_chance FROM fishing WHERE (zoneid= '%i' || zoneid = 0) and skill_level <= '%i'",ZoneID, skill ), errbuf, &result))
{
safe_delete_array(query);
@@ -168,12 +168,12 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
item[index] = atoi(row[0]);
chance[index] = atoi(row[1])+chancepool;
chancepool = chance[index];
npc_ids[index] = atoi(row[2]);
npc_chances[index] = atoi(row[3]);
index++;
}
mysql_free_result(result);
}
else {
@@ -181,7 +181,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
safe_delete_array(query);
return 0;
}
npc_id = 0;
npc_chance = 0;
if (index>0) {
@@ -199,7 +199,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
} else {
ret = 0;
}
return ret;
}
@@ -234,10 +234,10 @@ bool Client::CanFish() {
HeadingDegrees = (int) ((GetHeading()*360)/256);
HeadingDegrees = HeadingDegrees % 360;
RodX = x_pos + RodLength * sin(HeadingDegrees * M_PI/180.0f);
RodY = y_pos + RodLength * cos(HeadingDegrees * M_PI/180.0f);
// Do BestZ to find where the line hanging from the rod intersects the water (if it is water).
// and go 1 unit into the water.
VERTEX dest;
@@ -289,13 +289,13 @@ void Client::GoFish()
7007, // Rusty Dagger
7007, // Rusty Dagger
7007 // Rusty Dagger
};
//success formula is not researched at all
int fishing_skill = GetSkill(FISHING); //will take into account skill bonuses on pole & bait
//make sure we still have a fishing pole on:
int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal);
const ItemInst* Bait = nullptr;
@@ -306,21 +306,21 @@ void Client::GoFish()
if(bslot >= IDX_INV && Bait->GetItem()->SkillModType == FISHING) {
fishing_skill += Bait->GetItem()->SkillModValue;
}
if (fishing_skill > 100)
{
fishing_skill = 100+((fishing_skill-100)/2);
}
if (MakeRandomInt(0,175) < fishing_skill) {
uint32 food_id = 0;
//25% chance to fish an item.
if (MakeRandomInt(0, 399) <= fishing_skill ) {
uint32 npc_id = 0;
uint8 npc_chance = 0;
food_id = database.GetZoneFishing(m_pp.zone_id, fishing_skill, npc_id, npc_chance);
//check for add NPC
if(npc_chance > 0 && npc_id) {
if(npc_chance < MakeRandomInt(0, 99)) {
@@ -328,31 +328,31 @@ void Client::GoFish()
if(tmp != nullptr) {
NPC* npc = new NPC(tmp, nullptr, GetX()+3, GetY(), GetZ(), GetHeading(), FlyMode3);
npc->AddLootTable();
npc->AddToHateList(this, 1, 0, false); //no help yelling
entity_list.AddNPC(npc);
Message(MT_Emote, "You fish up a little more than you bargained for...");
}
}
}
}
//consume bait, should we always consume bait on success?
DeleteItemInInventory(bslot, 1, true); //do we need client update?
if(food_id == 0) {
int index = MakeRandomInt(0, MAX_COMMON_FISH_IDS-1);
food_id = common_fish_ids[index];
}
const Item_Struct* food_item = database.GetItem(food_id);
Message_StringID(MT_Skills, FISHING_SUCCESS);
const ItemInst* inst = database.CreateItem(food_item, 1);
if(inst != nullptr) {
if(CheckLoreConflict(inst->GetItem()))
if(CheckLoreConflict(inst->GetItem()))
{
this->Message_StringID(0,DUP_LORE);
}
@@ -384,7 +384,7 @@ void Client::GoFish()
parse->EventPlayer(EVENT_FISH_FAILURE, this, "", 0);
}
//chance to break fishing pole...
//this is potentially exploitable in that they can fish
//and then swap out items in primary slot... too lazy to fix right now
@@ -401,9 +401,9 @@ void Client::GoFish()
}
void Client::ForageItem(bool guarantee) {
int skill_level = GetSkill(FORAGE);
//be wary of the string ids in switch below when changing this.
uint32 common_food_ids[MAX_COMMON_FOOD_IDS] = {
13046, // Fruit
@@ -415,23 +415,23 @@ void Client::ForageItem(bool guarantee) {
14905, // mushroom
13106 // Fishing Grubs
};
// these may need to be fine tuned, I am just guessing here
if (guarantee || MakeRandomInt(0,199) < skill_level) {
uint32 foragedfood = 0;
uint32 stringid = FORAGE_NOEAT;
if (MakeRandomInt(0,99) <= 25) {
foragedfood = database.GetZoneForage(m_pp.zone_id, skill_level);
}
//not an else in case theres no DB food
if(foragedfood == 0) {
uint8 index = 0;
index = MakeRandomInt(0, MAX_COMMON_FOOD_IDS-1);
foragedfood = common_food_ids[index];
}
const Item_Struct* food_item = database.GetItem(foragedfood);
if(!food_item) {
@@ -439,17 +439,17 @@ void Client::ForageItem(bool guarantee) {
return;
}
if(foragedfood == 13106)
if(foragedfood == 13106)
stringid = FORAGE_GRUBS;
else
switch(food_item->ItemType) {
case ItemTypeFood:
case ItemTypeFood:
stringid = FORAGE_FOOD;
break;
case ItemTypeDrink:
if(strstr(food_item->Name, "ater"))
case ItemTypeDrink:
if(strstr(food_item->Name, "ater"))
stringid = FORAGE_WATER;
else
stringid = FORAGE_DRINK;
@@ -457,12 +457,12 @@ void Client::ForageItem(bool guarantee) {
default:
break;
}
Message_StringID(MT_Skills, stringid);
const ItemInst* inst = database.CreateItem(food_item, 1);
if(inst != nullptr) {
// check to make sure it isn't a foraged lore item
if(CheckLoreConflict(inst->GetItem()))
if(CheckLoreConflict(inst->GetItem()))
{
this->Message_StringID(0,DUP_LORE);
}
@@ -474,9 +474,9 @@ void Client::ForageItem(bool guarantee) {
}
safe_delete(inst);
}
parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst != nullptr ? inst->GetItem()->ID : 0);
int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems;
if(!guarantee && MakeRandomInt(0,99) < ChanceSecondForage) {
this->Message_StringID(MT_Skills, FORAGE_MASTERY);
@@ -487,7 +487,7 @@ void Client::ForageItem(bool guarantee) {
Message_StringID(MT_Skills, FORAGE_FAILED);
parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0);
}
CheckIncreaseSkill(FORAGE, nullptr, 5);
}