Merge branch 'master' into lua

This commit is contained in:
KimLS 2013-05-11 20:35:49 -07:00
commit 2445576ae8
16 changed files with 115 additions and 21 deletions

View File

@ -84,6 +84,14 @@ ELSE(MSVC)
ADD_DEFINITIONS(-DHAS_UNION_SEMUN)
ENDIF(MSVC)
#FreeBSD support
IF(UNIX)
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
ADD_DEFINITIONS(-DFREEBSD)
SET(FREEBSD TRUE)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
ENDIF(UNIX)
#use stdint.h types if they exist for this platform (we have to guess otherwise)
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
IF(HAVE_STDINT_H)

View File

@ -74,7 +74,7 @@ Mutex::Mutex() {
#else
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
#if defined(__CYGWIN__) || defined(__APPLE__)
#if defined(__CYGWIN__) || defined(__APPLE__) || defined(FREEBSD)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#else
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);

View File

@ -29,6 +29,9 @@
#include <stdio.h>
#endif
#include "eqemu_exception.h"
#ifdef FREEBSD
#include <sys/stat.h>
#endif
namespace EQEmu {

View File

@ -1859,7 +1859,7 @@ ENCODE(OP_ZoneSpawns)
}
float SpawnSize = emu->size;
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522)))
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize += 60;
@ -1985,7 +1985,7 @@ ENCODE(OP_ZoneSpawns)
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff); // unknown18
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff); // unknown19
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for(k = 0; k < 9; ++k)
{

View File

@ -1003,7 +1003,7 @@ ENCODE(OP_ZoneSpawns) {
}
float SpawnSize = emu->size;
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522)))
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::EquipStruct) * 9);
@ -1200,7 +1200,7 @@ ENCODE(OP_ZoneSpawns) {
Buffer += sizeof(structs::Spawn_Struct_Position);
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for(k = 0; k < 9; ++k)
{
@ -1225,7 +1225,7 @@ ENCODE(OP_ZoneSpawns) {
}
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
structs::EquipStruct *Equipment = (structs::EquipStruct *)Buffer;

View File

@ -1015,7 +1015,7 @@ ENCODE(OP_ZoneSpawns) {
}
float SpawnSize = emu->size;
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522)))
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::EquipStruct) * 9);
@ -1212,7 +1212,7 @@ ENCODE(OP_ZoneSpawns) {
Buffer += sizeof(structs::Spawn_Struct_Position);
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for(k = 0; k < 9; ++k)
{
@ -1237,7 +1237,7 @@ ENCODE(OP_ZoneSpawns) {
}
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
structs::EquipStruct *Equipment = (structs::EquipStruct *)Buffer;

View File

@ -26,7 +26,9 @@ IF(MINGW)
ENDIF(MINGW)
IF(UNIX)
TARGET_LINK_LIBRARIES(eqlaunch "dl")
IF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(eqlaunch "dl")
ENDIF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(eqlaunch "z")
TARGET_LINK_LIBRARIES(eqlaunch "m")
TARGET_LINK_LIBRARIES(eqlaunch "rt")

View File

@ -53,7 +53,9 @@ IF(MINGW)
ENDIF(MINGW)
IF(UNIX)
TARGET_LINK_LIBRARIES(loginserver "dl")
IF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(loginserver "dl")
ENDIF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(loginserver "z")
TARGET_LINK_LIBRARIES(loginserver "m")
TARGET_LINK_LIBRARIES(loginserver "rt")

View File

@ -32,7 +32,9 @@ IF(MINGW)
ENDIF(MINGW)
IF(UNIX)
TARGET_LINK_LIBRARIES(queryserv "dl")
IF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(queryserv "dl")
ENDIF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(queryserv "z")
TARGET_LINK_LIBRARIES(queryserv "m")
TARGET_LINK_LIBRARIES(queryserv "rt")

View File

@ -31,7 +31,9 @@ IF(MINGW)
ENDIF(MINGW)
IF(UNIX)
TARGET_LINK_LIBRARIES(shared_memory "dl")
IF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(shared_memory "dl")
ENDIF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(shared_memory "z")
TARGET_LINK_LIBRARIES(shared_memory "m")
TARGET_LINK_LIBRARIES(shared_memory "rt")

View File

@ -34,7 +34,9 @@ IF(MINGW)
ENDIF(MINGW)
IF(UNIX)
TARGET_LINK_LIBRARIES(ucs "dl")
IF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(ucs "dl")
ENDIF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(ucs "z")
TARGET_LINK_LIBRARIES(ucs "m")
TARGET_LINK_LIBRARIES(ucs "rt")

View File

@ -80,7 +80,9 @@ IF(MINGW)
ENDIF(MINGW)
IF(UNIX)
TARGET_LINK_LIBRARIES(world "dl")
IF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(world "dl")
ENDIF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(world "z")
TARGET_LINK_LIBRARIES(world "m")
TARGET_LINK_LIBRARIES(world "rt")

View File

@ -180,7 +180,9 @@ IF(MINGW)
ENDIF(MINGW)
IF(UNIX)
TARGET_LINK_LIBRARIES(zone "dl")
IF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(zone "dl")
ENDIF(NOT FREEBSD)
TARGET_LINK_LIBRARIES(zone "z")
TARGET_LINK_LIBRARIES(zone "m")
TARGET_LINK_LIBRARIES(zone "rt")

View File

@ -3745,6 +3745,7 @@ void Bot::AI_Process() {
if(IsBotArcher() && ranged_timer.Check(false)) {
if(GetTarget()->GetHPRatio() <= 99.0f)
// Mob::DoArcheryAttackDmg() takes care of Bot Range and Ammo procs
BotRangedAttack(GetTarget());
}
else if(!IsBotArcher() && (!(IsBotCaster() && GetLevel() > 12)) && GetTarget() && !IsStunned() && !IsMezzed() && (GetAppearance() != eaDead)) {
@ -3763,6 +3764,9 @@ void Bot::AI_Process() {
if(attack_timer.Check()) {
Attack(GetTarget(), SLOT_PRIMARY);
ItemInst *wpn = GetBotItem(SLOT_PRIMARY);
TryWeaponProc(wpn, GetTarget(), SLOT_PRIMARY);
bool tripleSuccess = false;
if(BotOwner && GetTarget() && CanThisClassDoubleAttack()) {
@ -5374,7 +5378,7 @@ std::string Bot::RaceIdToString(uint16 raceId) {
Result = std::string("Iksar");
break;
case 130:
Result == std::string("Vah Shir");
Result = std::string("Vah Shir");
break;
case 330:
Result = std::string("Froglok");
@ -11767,6 +11771,25 @@ void Bot::CalcItemBonuses()
if(itemtmp->Haste != 0)
if(itembonuses.haste < itemtmp->Haste)
itembonuses.haste = itemtmp->Haste;
if(GetClass() == BARD && itemtmp->BardValue != 0) {
if(itemtmp->BardType == ItemTypeBrassInstr)
itembonuses.brassMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeDrumInstr)
itembonuses.percussionMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseSinging)
itembonuses.singingMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeStringInstr)
itembonuses.stringedMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeWindInstr)
itembonuses.windMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseAllInstruments) {
itembonuses.brassMod += itemtmp->BardValue;
itembonuses.percussionMod += itemtmp->BardValue;
itembonuses.singingMod += itemtmp->BardValue;
itembonuses.stringedMod += itemtmp->BardValue;
itembonuses.windMod += itemtmp->BardValue;
}
}
if ((itemtmp->Worn.Effect != 0) && (itemtmp->Worn.Type == ET_WornEffect)) { // latent effects
ApplySpellsBonuses(itemtmp->Worn.Effect, itemtmp->Worn.Level, &itembonuses);
}
@ -11832,6 +11855,25 @@ void Bot::CalcItemBonuses()
if(itemtmp->Haste != 0)
if(itembonuses.haste < itemtmp->Haste)
itembonuses.haste = itemtmp->Haste;
if(GetClass() == BARD && itemtmp->BardValue != 0) {
if(itemtmp->BardType == ItemTypeBrassInstr)
itembonuses.brassMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeDrumInstr)
itembonuses.percussionMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseSinging)
itembonuses.singingMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeStringInstr)
itembonuses.stringedMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeWindInstr)
itembonuses.windMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseAllInstruments) {
itembonuses.brassMod += itemtmp->BardValue;
itembonuses.percussionMod += itemtmp->BardValue;
itembonuses.singingMod += itemtmp->BardValue;
itembonuses.stringedMod += itemtmp->BardValue;
itembonuses.windMod += itemtmp->BardValue;
}
}
if ((itemtmp->Worn.Effect != 0) && (itemtmp->Worn.Type == ET_WornEffect)) { // latent effects
ApplySpellsBonuses(itemtmp->Worn.Effect, itemtmp->Worn.Level, &itembonuses);
}
@ -11869,6 +11911,10 @@ void Bot::CalcBotStats(bool showtext) {
GetBotOwner()->Message(15, "Base stats:");
GetBotOwner()->Message(15, "Level: %i HP: %i AC: %i Mana: %i STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetLevel(), base_hp, AC, max_mana, STR, STA, DEX, AGI, INT, WIS, CHA);
GetBotOwner()->Message(15, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",MR,PR,FR,CR,DR,Corrup);
// Test Code
if(GetClass() == BARD)
GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i",
GetSkill(BRASS_INSTRUMENTS), GetSkill(PERCUSSION_INSTRUMENTS), GetSkill(SINGING), GetSkill(STRINGED_INSTRUMENTS), GetSkill(WIND_INSTRUMENTS));
}
/*if(this->Save())
@ -11884,6 +11930,16 @@ void Bot::CalcBotStats(bool showtext) {
GetBotOwner()->Message(15, "I'm updated.");
GetBotOwner()->Message(15, "Level: %i HP: %i AC: %i Mana: %i STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetLevel(), max_hp, GetAC(), max_mana, GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA());
GetBotOwner()->Message(15, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",GetMR(),GetPR(),GetFR(),GetCR(),GetDR(),GetCorrup());
// Test Code
if(GetClass() == BARD) {
GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i",
GetSkill(BRASS_INSTRUMENTS) + GetBrassMod(),
GetSkill(PERCUSSION_INSTRUMENTS) + GetPercMod(),
GetSkill(SINGING) + GetSingMod(),
GetSkill(STRINGED_INSTRUMENTS) + GetStringMod(),
GetSkill(WIND_INSTRUMENTS) + GetWindMod());
GetBotOwner()->Message(15, "Bard Skill Mods-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", GetBrassMod(), GetPercMod(), GetSingMod(), GetStringMod(), GetWindMod());
}
}
}

View File

@ -12549,11 +12549,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app)
//
char *GuildName = (char *)app->pBuffer;
#ifdef FREEBSD
if(strlen(GuildName) > 60)
#else
if(strnlen(GuildName, 64) > 60)
#endif
{
Message(clientMessageError, "Guild name too long.");
return;

View File

@ -706,6 +706,15 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
if(!center->CheckLosFN(curmob))
continue;
}
else { // check to stop casting beneficial ae buffs (to wit: bard songs) on enemies...
// This does not check faction for beneficial AE buffs..only agro and attackable.
// I've tested for spells that I can find without problem, but a faction-based
// check may still be needed. Any changes here should also reflect in BardAEPulse() -U
if(caster->IsAttackAllowed(curmob, true))
continue;
if(caster->CheckAggro(curmob))
continue;
}
//if we get here... cast the spell.
if(IsTargetableAESpell(spell_id) && bad)
@ -812,6 +821,14 @@ void EntityList::AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool aff
if(!center->CheckLosFN(curmob))
continue;
}
else { // check to stop casting beneficial ae buffs (to wit: bard songs) on enemies...
// See notes in AESpell() above for more info.
if(caster->IsAttackAllowed(curmob, true))
continue;
if(caster->CheckAggro(curmob))
continue;
}
//if we get here... cast the spell.
curmob->BardPulse(spell_id, caster);
}