Commit fb49a5b3 authored by Scribble's avatar Scribble

Merge branch 'ToDWeapons' into 'master'

ToD Weapons And a bunch of other fixes read Commits

See merge request !1
parents 6aaca002 2d6507f6
This diff is collapsed.
......@@ -7,7 +7,7 @@ bind_port=9110
database_ip=127.0.0.1
database_username=root
database_password=
database_name=phatac
database_name=hightide
# World
world_name=Classic Dereth
......@@ -22,14 +22,14 @@ hardcore_mode=0
# If this is set to 0 and hardcore mode is set to 1, dying to anything (even monsters) will trigger a character being deleted
hardcore_mode_players_only=0
player_killer_only=0
player_killer_only=1
colored_sentinels=0
# More options can be added at a later time, recommended to set these to "0" for exploration purposes.
spawn_landscape=1
spawn_static_creatures=1
everything_unlocked=0
town_crier_buffs=0
town_crier_buffs=1
# More options can be added at a later time, recommended to set these to "1" for exploration purposes.
enable_teleport_commands=0
......@@ -75,5 +75,6 @@ max_dormant_landblocks=1000
dormant_landblock_cleanup_time=300
show_logins=0
speed_hack_kicking=1
speed_hack_kicking=0
pk_respite_time=30.0
......@@ -140,13 +140,13 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetName>PhatAC - Classic Dereth - Debug</TargetName>
<TargetName>GDLEnhanced - Debug</TargetName>
<OutDir>$(SolutionDir)\Bin\</OutDir>
<IntDir>Intermediate\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetName>PhatAC - Classic Dereth</TargetName>
<TargetName>GDLEnhanced</TargetName>
<OutDir>$(SolutionDir)\Bin\</OutDir>
<IntDir>Intermediate\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
......@@ -160,7 +160,7 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\Bin\</OutDir>
<IntDir>Intermediate\$(Platform)\$(Configuration)\</IntDir>
<TargetName>PhatAC - Classic Dereth - Debug</TargetName>
<TargetName>GDLEnhanced - Debug</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)\Bin\</OutDir>
......@@ -176,13 +176,13 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>PhatAC - Classic Dereth</TargetName>
<TargetName>GDLEnhanced</TargetName>
<OutDir>$(SolutionDir)\Bin\</OutDir>
<IntDir>Intermediate\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - Public|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>PhatAC - Classic Dereth</TargetName>
<TargetName>GDLEnhanced</TargetName>
<OutDir>$(SolutionDir)\Bin\</OutDir>
<IntDir>Intermediate\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
......
# Classic Dereth
Classic Asheron's Call Emulator based on the GDL project.
# GDLEnhanced
Asheron's Call Emulator based on the GDL project, and GDL-Classic Dereth
GDL Github: https://github.com/GamesDeadLol/GDL
Necessary dat files: https://mega.nz/#!c6RgjDxa!7ng3Gm_eh7JY2nBvHY7KMxMPP0_QJUH-oyF1MMmlVnY
GDL-Classic Github: https://github.com/bDekaru/ClassicDereth
Portal.dat file modified entries and patcher: https://mega.nz/#!xnJ01I5R!Sdo8lZaKS4lLzXsLa2J2SP5bL3DFDieISouMrmXM65Y
License: https://raw.githubusercontent.com/bDekaru/ClassicDereth/master/LICENSE
1.10 Binaries: https://mega.nz/#!RyRl0bwZ!WNIJuuAG5NyA55AR85ko4THilSt-uO1BT5qrFV7h1kA
License: https://raw.githubusercontent.com/bDekaru/ClassicDereth/master/LICENSE
\ No newline at end of file
Good luck, have fun.
\ No newline at end of file
......@@ -53,7 +53,7 @@ END
IDD_MAIN DIALOGEX 0, 0, 431, 292
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_STATICEDGE
CAPTION "PhatAC - Classic Dereth"
CAPTION "GDLEnhanced"
MENU IDR_MENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
......@@ -115,7 +115,7 @@ END
IDD_ABOUT DIALOGEX 0, 0, 255, 152
STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION
CAPTION "About PhatAC - Classic Dereth"
CAPTION "About GDLEnhanced"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Close",IDOK,198,130,50,14
......@@ -213,11 +213,6 @@ BEGIN
END
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
/////////////////////////////////////////////////////////////////////////////
//
// AFX_DIALOG_LAYOUT
......@@ -257,7 +252,7 @@ BEGIN
BLOCK "040004b0"
BEGIN
VALUE "FileVersion", "1.0.0.0"
VALUE "ProductName", "PhatAC - Classic Dereth"
VALUE "ProductName", "GDLEnhanced"
VALUE "ProductVersion", "1.0.0.0"
END
END
......
Resource/client.ico

4.6 KB | W: | H:

Resource/client.ico

59.8 KB | W: | H:

Resource/client.ico
Resource/client.ico
Resource/client.ico
Resource/client.ico
  • 2-up
  • Swipe
  • Onion skin
......@@ -444,7 +444,7 @@ void CMeleeAttackEvent::HandleAttackHook(const AttackCone &cone)
damageType = weapon->InqDamageType();
}
offenseMod = weapon->GetOffenseMod();
weaponSkill = (STypeSkill)weapon->InqIntQuality(WEAPON_SKILL_INT, UNARMED_COMBAT_SKILL, TRUE);
weaponSkill = SkillTable::OldToNewSkill((STypeSkill)weapon->InqIntQuality(WEAPON_SKILL_INT, LIGHT_WEAPONS_SKILL, TRUE));
//todo: maybe handle this differently as to integrate all possible damage type combos
if (damageType == (DAMAGE_TYPE::SLASH_DAMAGE_TYPE|DAMAGE_TYPE::PIERCE_DAMAGE_TYPE))
......@@ -926,7 +926,7 @@ void CMissileAttackEvent::FireMissile()
_weenie->AdjustStamina(-necessaryStamina);
missile->_weaponSkill = (STypeSkill)weapon->InqIntQuality(WEAPON_SKILL_INT, UNDEF_SKILL, false);
missile->_weaponSkill = SkillTable::OldToNewSkill((STypeSkill)weapon->InqIntQuality(WEAPON_SKILL_INT, UNDEF_SKILL, false));
if (_weenie->InqSkill(missile->_weaponSkill, missile->_weaponSkillLevel, false))
{
double offenseMod = weapon->GetOffenseMod();
......
This diff is collapsed.
......@@ -1640,6 +1640,7 @@ CLIENT_COMMAND(fixbusy, "", "Makes you unbusy if you are stuck.", BASIC_ACCESS)
pPlayer->NotifyInventoryFailedEvent(0, 0);
pPlayer->NotifyUseDone(0);
pPlayer->NotifyWeenieError(0);
pPlayer->ChangeCombatMode(NONCOMBAT_COMBAT_MODE, false);
return false;
}
......
......@@ -156,7 +156,6 @@ void CClientEvents::LoginCharacter(DWORD char_weenie_id, const char *szAccount)
m_pPlayer->SetLoginPlayerQualities(); // overrides
m_pPlayer->RecalculateEncumbrance();
m_pPlayer->LoginCharacter();
m_pPlayer->TryToUnloadAllegianceXP(true);
/*
if (*g_pConfig->WelcomePopup() != 0)
......@@ -168,7 +167,7 @@ void CClientEvents::LoginCharacter(DWORD char_weenie_id, const char *szAccount)
}
*/
m_pPlayer->SendText("PhatAC - Classic Dereth " SERVER_VERSION_NUMBER_STRING " " SERVER_VERSION_STRING, LTT_DEFAULT);
m_pPlayer->SendText("GDLEnhanced " SERVER_VERSION_NUMBER_STRING " " SERVER_VERSION_STRING, LTT_DEFAULT);
m_pPlayer->SendText("Powered by GamesDeadLol. Not an official Asheron's Call server.", LTT_DEFAULT);
/*
......@@ -180,6 +179,7 @@ void CClientEvents::LoginCharacter(DWORD char_weenie_id, const char *szAccount)
g_pWorld->CreateEntity(m_pPlayer);
m_pPlayer->DebugValidate();
m_pPlayer->TryToUnloadAllegianceXP(true);
return;
}
......
......@@ -692,6 +692,9 @@ bool CContainerWeenie::SpawnCloneInContainer(CWeenieObject *itemToClone, int amo
}
}
else if (item->InqIntQuality(STACK_SIZE_INT, 1) > 1)
item->SetStackSize(1);
if (!SpawnInContainer(item, sendEnvent, false))
{
CWeenieObject *owner = this->GetWorldTopLevelOwner();
......
......@@ -463,7 +463,7 @@ void CMonsterWeenie::FinishMoveItemToContainer(CWeenieObject *sourceItem, CConta
// 4. Item being stored is in an external container (chest) or being moved to an external container (chest)
bool wasWielded = sourceItem->IsWielded();
bool wasInWorld = (GetBlock() != NULL);
bool isPickup = sourceItem->GetWorldTopLevelOwner() != this;
DWORD dwCell = GetLandcell();
......@@ -490,7 +490,7 @@ void CMonsterWeenie::FinishMoveItemToContainer(CWeenieObject *sourceItem, CConta
EmitSound(Sound_PickUpItem, 1.0f);
}
if (wasInWorld)
if (isPickup)
sourceItem->OnPickedUp(this);
if (bSendEvent)
......@@ -601,6 +601,9 @@ void CMonsterWeenie::FinishMoveItemTo3D(CWeenieObject *sourceItem)
if (bWasWielded && get_minterp()->InqStyle() != Motion_NonCombat)
AdjustToNewCombatMode();
if (bWasWielded)
sourceItem->OnUnwield(this);
sourceItem->OnDropped(this);
}
......@@ -753,7 +756,7 @@ bool CMonsterWeenie::FinishMoveItemToWield(CWeenieObject *sourceItem, DWORD targ
DWORD skillActivationTypeDID = 0;
if (sourceItem->m_Qualities.InqInt(ITEM_SKILL_LEVEL_LIMIT_INT, difficulty, TRUE, FALSE) && sourceItem->m_Qualities.InqDataID(ITEM_SKILL_LIMIT_DID, skillActivationTypeDID))
{
STypeSkill skillActivationType = (STypeSkill)skillActivationTypeDID;
STypeSkill skillActivationType = SkillTable::OldToNewSkill((STypeSkill)skillActivationTypeDID);
DWORD skillLevel = 0;
if (!m_Qualities.InqSkill(skillActivationType, skillLevel, FALSE) || (int)skillLevel < difficulty)
......
......@@ -21,7 +21,7 @@ MonsterAIManager::MonsterAIManager(CMonsterWeenie *pWeenie, const Position &Home
_shield = m_pWeenie->GetWieldedCombat(COMBAT_USE_SHIELD);
SKILL_ADVANCEMENT_CLASS unarmedSkill;
m_pWeenie->m_Qualities.InqSkillAdvancementClass(UNARMED_COMBAT_SKILL, unarmedSkill);
m_pWeenie->m_Qualities.InqSkillAdvancementClass(LIGHT_WEAPONS_SKILL, unarmedSkill);
_hasUnarmedSkill = (unarmedSkill > UNTRAINED_SKILL_ADVANCEMENT_CLASS);
if (_meleeWeapon != NULL && _missileWeapon != NULL) //if we have both melee and missile weapons, favor missile
......
......@@ -22,7 +22,7 @@ LRESULT CALLBACK AboutProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
switch (message)
{
case WM_INITDIALOG:
SetWindowText(GetDlgItem(hDlg, IDC_CREDITS), "PhatAC - Classic Dereth " SERVER_VERSION_NUMBER_STRING "\n" SERVER_VERSION_STRING "\n\nClassic Dereth created by Dekaru (dekaru@protonmail.com)\nhttps://github.com/bDekaru/ClassicDereth\n\nBased on the GamesDeadLol Server project.\nhttps://github.com/GamesDeadLol/GDL\n\nPhatAC originally created by Pea and halted in September 2017.\n\nPhatAC was created in C++ and compiled with Visual Studio. Third-party libraries used include zlib, SHA512 and ISAAC algorithms.");
SetWindowText(GetDlgItem(hDlg, IDC_CREDITS), "GDLEnhanced " SERVER_VERSION_NUMBER_STRING "\n" SERVER_VERSION_STRING "\n" "\n" "GDLEnhanced updated and maintained by ChosenOne, LikeableLime, and Scribble\n\nClassic Dereth created by Dekaru (dekaru@protonmail.com)\nhttps://github.com/bDekaru/ClassicDereth\n\nBased on the GamesDeadLol Server project.\nhttps://github.com/GamesDeadLol/GDL\n\nPhatAC originally created by Pea and halted in September 2017.\n\nPhatAC was created in C++ and compiled with Visual Studio. Third-party libraries used include zlib, SHA512 and ISAAC algorithms.");
// SetWindowText(GetDlgItem(hDlg, IDC_PACKETCREDITS), PACKET_CAPTURE_CREDITS);
return TRUE;
......@@ -207,7 +207,7 @@ LRESULT CALLBACK LauncherProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
if (!FileExists(((std::string)szLaunchDir + "\\acclient.exe").c_str()))
{
MsgBox("Please copy your Asheron's Call client to the Client folder of PhatAC.\r\n");
MsgBox("Please copy your Asheron's Call client to the Client folder of GDLEnhanced.\r\n");
}
else
{
......@@ -306,7 +306,7 @@ INT_PTR CALLBACK MainProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
g_Logger.AddLogCallback(OutputConsole);
HWND hVersion = GetDlgItem(hDlg, IDC_VERSION);
SetWindowText(hVersion, "PhatAC - Classic Dereth " SERVER_VERSION_NUMBER_STRING " " SERVER_VERSION_STRING); // "PhatAC compiled " __TIMESTAMP__);
SetWindowText(hVersion, "GDLEnhanced " SERVER_VERSION_NUMBER_STRING " " SERVER_VERSION_STRING); // "PhatAC compiled " __TIMESTAMP__);
HICON hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_PHATAC));
SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
......@@ -423,7 +423,7 @@ INT_PTR CALLBACK MainProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
if (!FileExists(((std::string)szLaunchDir + "\\acclient.exe").c_str()))
{
MsgBox("Please copy your Asheron's Call client to the Client folder of PhatAC.\r\n");
MsgBox("Please copy your Asheron's Call client to the Client folder of GDLEnhanced.\r\n");
}
else
{
......@@ -550,7 +550,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
extern DWORD64 g_RandomAdminPassword;
g_RandomAdminPassword = ((DWORD64)Random::GenUInt(0, 0xFFFFFFF0) << 32) | Random::GenUInt(0, 0xFFFFFFF0) + GetTickCount64();
LOG(UserInterface, Normal, "Welcome to PhatAC - Classic Dereth!\n");
LOG(UserInterface, Normal, "Welcome to GDLEnhanced!\n");
ShowWindow(g_hWndMain, nCmdShow);
......
......@@ -35,6 +35,33 @@ DEFINE_UNPACK(SkillTable)
return _skillBaseHash.UnPack(pReader);
}
STypeSkill SkillTable::OldToNewSkill(STypeSkill old) // Custom
{
switch (old)
{
case SWORD_SKILL:
return HEAVY_WEAPONS_SKILL;
case DAGGER_SKILL:
return FINESSE_WEAPONS_SKILL;
case AXE_SKILL:
case MACE_SKILL:
case STAFF_SKILL:
case SPEAR_SKILL:
case UNARMED_COMBAT_SKILL:
return LIGHT_WEAPONS_SKILL;
case BOW_SKILL:
case CROSSBOW_SKILL:
case THROWN_WEAPON_SKILL:
return MISSILE_WEAPONS_SKILL;
}
return old;
}
const SkillBase *SkillTable::GetSkillBaseRaw(STypeSkill key) // custom
{
return _skillBaseHash.lookup(key);
......
......@@ -60,6 +60,8 @@ public:
DECLARE_PACKABLE()
DECLARE_LEGACY_PACK_MIGRATOR()
static STypeSkill OldToNewSkill(STypeSkill old);
const SkillBase *GetSkillBaseRaw(STypeSkill key); // custom
const SkillBase *GetSkillBase(STypeSkill key);
......
......@@ -18,6 +18,10 @@ void CalculateDamage(DamageEventData *dmgEvent, SpellCastData *spellData)
if (!dmgEvent)
return;
dmgEvent->damageBeforeMitigation = dmgEvent->damageAfterMitigation = dmgEvent->baseDamage;
if (!dmgEvent->source)
return;
CalculateAttributeDamageBonus(dmgEvent);
CalculateSkillDamageBonus(dmgEvent, spellData);
CalculateCriticalHitData(dmgEvent, spellData);
......@@ -52,12 +56,13 @@ void CalculateAttributeDamageBonus(DamageEventData *dmgEvent)
case DF_MISSILE:
{
DWORD attrib = 0;
if (dmgEvent->attackSkill == DAGGER_SKILL || dmgEvent->attackSkill == BOW_SKILL || dmgEvent->attackSkill == CROSSBOW_SKILL)
if (dmgEvent->attackSkill == FINESSE_WEAPONS_SKILL || dmgEvent->attackSkill == MISSILE_WEAPONS_SKILL)
dmgEvent->source->m_Qualities.InqAttribute(COORDINATION_ATTRIBUTE, attrib, FALSE);
else
dmgEvent->source->m_Qualities.InqAttribute(STRENGTH_ATTRIBUTE, attrib, FALSE);
double attribDamageMod = ((int)attrib - 55.0) / 33.0;
// double attribDamageMod = ((int)attrib - 55.0) / 33.0;
double attribDamageMod = 6.75*(1.0 - exp(-0.005*((int)attrib - 55)));
if (attribDamageMod < 0)
dmgEvent->attributeDamageBonus = dmgEvent->baseDamage * (attribDamageMod / 2.0);
else
......@@ -73,6 +78,8 @@ void CalculateSkillDamageBonus(DamageEventData *dmgEvent, SpellCastData *spellDa
{
if (!dmgEvent)
return;
if (!dmgEvent->source)
return;
switch (dmgEvent->damage_form)
{
......
This diff is collapsed.
......@@ -80,7 +80,7 @@ void CPortal::CheckedTeleport(CWeenieObject *pOther)
}
else if (maxLevel && currentLevel > maxLevel)
{
pOther->SendText("You too powerful to use this portal.", LTT_MAGIC);
pOther->SendText("You are too powerful to use this portal.", LTT_MAGIC);
}
else
{
......
......@@ -32,7 +32,7 @@ DWORD WINAPI MainServerThread(LPVOID)
extern DWORD64 g_RandomAdminPassword;
g_RandomAdminPassword = ((DWORD64)Random::GenUInt(0, 0xFFFFFFF0) << 32) | Random::GenUInt(0, 0xFFFFFFF0);
LOG(UserInterface, Normal, "Welcome to PhatAC - Classic Dereth!\n");
LOG(UserInterface, Normal, "Welcome to GDLEnhanced!\n");
unsigned long serverIP = GetLocalIP();
int serverPort = 9050;
......
......@@ -24,7 +24,7 @@ int CSkillAlterationDeviceWeenie::Use(CPlayerWeenie *player)
// 1 = raise
// 2 = lower
int alterationType = InqIntQuality(TYPE_OF_ALTERATION_INT, 0);
STypeSkill skillToAlter = (STypeSkill)InqIntQuality(SKILL_TO_BE_ALTERED_INT, STypeSkill::UNDEF_SKILL);
STypeSkill skillToAlter = SkillTable::OldToNewSkill((STypeSkill)InqIntQuality(SKILL_TO_BE_ALTERED_INT, STypeSkill::UNDEF_SKILL));
if (alterationType <= 0 || alterationType > 2 || skillToAlter <= 0 || skillToAlter > NUM_SKILL)
{
......
......@@ -1043,6 +1043,23 @@ int CSpellcastingManager::LaunchSpellEffect()
// portal bitmask, 0x10 = cannot be summoned
// portal bitmask, 0x20 = cannot be linked/recalled
int minLevel = pTarget->InqIntQuality(MIN_LEVEL_INT, 0);
int maxLevel = pTarget->InqIntQuality(MAX_LEVEL_INT, 0);
int currentLevel = m_pWeenie->InqIntQuality(LEVEL_INT, 1);
if (minLevel && currentLevel < minLevel)
{
m_pWeenie->SendText("You are not powerful enough to tie to this portal yet.", LTT_MAGIC);
break;
}
else if (maxLevel && currentLevel > maxLevel)
{
m_pWeenie->SendText("You are too powerful to tie to this portal.", LTT_MAGIC);
break;
}
switch (meta->_index)
{
case 1:
......@@ -1139,8 +1156,7 @@ int CSpellcastingManager::LaunchSpellEffect()
}
case 4: // primary portal recall
{
// TODO make sure they meet the portal requirements
{
DWORD portalDID = 0;
if (m_pWeenie->m_Qualities.InqDataID(LINKED_PORTAL_ONE_DID, portalDID) && portalDID != 0)
{
......@@ -1151,6 +1167,37 @@ int CSpellcastingManager::LaunchSpellEffect()
portalDefaults = g_pWeenieFactory->GetWeenieDefaults(portalDID);
}
int minLevel = 0;
int maxLevel = 0;
portalDefaults->m_Qualities.InqInt(MIN_LEVEL_INT, minLevel);
portalDefaults->m_Qualities.InqInt(MAX_LEVEL_INT, maxLevel);
int currentLevel = m_pWeenie->InqIntQuality(LEVEL_INT, 1);
if (minLevel && currentLevel < minLevel)
{
m_pWeenie->SendText("You are not powerful enough to recall this portal yet.", LTT_MAGIC);
break;
}
else if (maxLevel && currentLevel > maxLevel)
{
m_pWeenie->SendText("You are too powerful to recall this portal.", LTT_MAGIC);
break;
}
std::string restriction;
if (portalDefaults->m_Qualities.InqString(QUEST_RESTRICTION_STRING, restriction))
{
if (CPlayerWeenie *player = m_pWeenie->AsPlayer())
{
if (!player->InqQuest(restriction.c_str()))
{
m_pWeenie->SendText("You try to recall the portal but there is no effect.", LTT_MAGIC);
break;
}
}
}
Position portalDest;
if (portalDefaults->m_Qualities.InqPosition(DESTINATION_POSITION, portalDest) && portalDest.objcell_id != 0)
{
......@@ -1174,7 +1221,6 @@ int CSpellcastingManager::LaunchSpellEffect()
case 5: // secondary portal recall
{
// TODO make sure they meet the portal requirements
DWORD portalDID = 0;
if (m_pWeenie->m_Qualities.InqDataID(LINKED_PORTAL_TWO_DID, portalDID) && portalDID != 0)
{
......@@ -1185,6 +1231,37 @@ int CSpellcastingManager::LaunchSpellEffect()
portalDefaults = g_pWeenieFactory->GetWeenieDefaults(portalDID);
}
int minLevel = 0;
int maxLevel = 0;
portalDefaults->m_Qualities.InqInt(MIN_LEVEL_INT, minLevel);
portalDefaults->m_Qualities.InqInt(MAX_LEVEL_INT, maxLevel);
int currentLevel = m_pWeenie->InqIntQuality(LEVEL_INT, 1);
if (minLevel && currentLevel < minLevel)
{
m_pWeenie->SendText("You are not powerful enough to recall this portal yet.", LTT_MAGIC);
break;
}
else if (maxLevel && currentLevel > maxLevel)
{
m_pWeenie->SendText("You are too powerful to recall this portal.", LTT_MAGIC);
break;
}
std::string restriction;
if (portalDefaults->m_Qualities.InqString(QUEST_RESTRICTION_STRING, restriction))
{
if (CPlayerWeenie *player = m_pWeenie->AsPlayer())
{
if (!player->InqQuest(restriction.c_str()))
{
m_pWeenie->SendText("You try to recall the portal but there is no effect.", LTT_MAGIC);
break;
}
}
}
Position portalDest;
if (portalDefaults->m_Qualities.InqPosition(DESTINATION_POSITION, portalDest) && portalDest.objcell_id != 0)
{
......@@ -1236,6 +1313,12 @@ int CSpellcastingManager::LaunchSpellEffect()
enchant._last_time_degraded = -1.0;
enchant._smod = meta->_smod;
if (enchant._smod.type & Skill_EnchantmentType)
{
enchant._smod.key = (DWORD)SkillTable::OldToNewSkill((STypeSkill)enchant._smod.key);
}
std::list<CWeenieObject *> targets;
if (CWeenieObject *castTarget = GetCastTarget())
......@@ -1403,19 +1486,46 @@ int CSpellcastingManager::LaunchSpellEffect()
}
CWeenieDefaults *portalDefaults = NULL;
CWeenieObject *weenie = NULL;
bool copyStats = true;
if (portalDID)
{
portalDefaults = g_pWeenieFactory->GetWeenieDefaults(portalDID);
int minLevel = 0;
int maxLevel = 0;
portalDefaults->m_Qualities.InqInt(MIN_LEVEL_INT, minLevel);
portalDefaults->m_Qualities.InqInt(MAX_LEVEL_INT, maxLevel);
int currentLevel = m_pWeenie->InqIntQuality(LEVEL_INT, 1);
if (minLevel && currentLevel < minLevel)
{
m_pWeenie->SendText("You are not powerful enough to summon this portal yet.", LTT_MAGIC);
break;
}
else if (maxLevel && currentLevel > maxLevel)
{
m_pWeenie->SendText("You are too powerful to summon this portal.", LTT_MAGIC);
break;
}
if ((portalDefaults->m_Qualities.GetInt(PORTAL_BITMASK_INT, 0) & 0x10) && m_pWeenie->AsPlayer())
{
m_pWeenie->SendText("That portal may not be summoned.", LTT_MAGIC);
break;
}
else if (!m_pWeenie->AsPlayer())
{
weenie = g_pWeenieFactory->CreateWeenieByClassID(portalDID, &spawnPos, false);
copyStats = false;
}
}
CWeenieObject *weenie = g_pWeenieFactory->CreateWeenieByClassID(W_PORTALGATEWAY_CLASS, &spawnPos, false);
if (!weenie)
weenie = g_pWeenieFactory->CreateWeenieByClassID(W_PORTALGATEWAY_CLASS, &spawnPos, false);
if (weenie)
{
......@@ -1425,24 +1535,28 @@ int CSpellcastingManager::LaunchSpellEffect()
bool bHasDestination = false;
if (portalDefaults)
{
weenie->CopyPositionStat(DESTINATION_POSITION, &portalDefaults->m_Qualities);
weenie->CopyIntStat(MIN_LEVEL_INT, &portalDefaults->m_Qualities);
weenie->CopyIntStat(MAX_LEVEL_INT, &portalDefaults->m_Qualities);
weenie->CopyIntStat(PORTAL_BITMASK_INT, &portalDefaults->m_Qualities);
}
else
if (copyStats)
{
switch (meta->_link)
if(portalDefaults)
{
case 1:
weenie->m_Qualities.SetPosition(DESTINATION_POSITION, m_pWeenie->InqPositionQuality(LINKED_PORTAL_ONE_POSITION, Position()));
break;
weenie->CopyPositionStat(DESTINATION_POSITION, &portalDefaults->m_Qualities);
weenie->CopyIntStat(MIN_LEVEL_INT, &portalDefaults->m_Qualities);
weenie->CopyIntStat(MAX_LEVEL_INT, &portalDefaults->m_Qualities);
weenie->CopyIntStat(PORTAL_BITMASK_INT, &portalDefaults->m_Qualities);
weenie->CopyStringStat(QUEST_RESTRICTION_STRING, &portalDefaults->m_Qualities);
}
else
{
switch (meta->_link)
{
case 1:
weenie->m_Qualities.SetPosition(DESTINATION_POSITION, m_pWeenie->InqPositionQuality(LINKED_PORTAL_ONE_POSITION, Position()));
break;
case 2:
weenie->m_Qualities.SetPosition(DESTINATION_POSITION, m_pWeenie->InqPositionQuality(LINKED_PORTAL_TWO_POSITION, Position()));
break;
case 2:
weenie->m_Qualities.SetPosition(DESTINATION_POSITION, m_pWeenie->InqPositionQuality(LINKED_PORTAL_TWO_POSITION, Position()));
break;
}
}
}
......
......@@ -411,7 +411,7 @@ void MsgBox(UINT type, const char *format, ...)
HWND hWnd = g_pGlobals ? g_pGlobals->GetWindowHandle() : NULL;
MessageBox(hWnd, szWriteBuffer, "PhatAC", MB_OK | type);
MessageBox(hWnd, szWriteBuffer, "GDLEnhanced", MB_OK | type);
}
void MsgBox(const char *format, ...)
......@@ -423,7 +423,7 @@ void MsgBox(const char *format, ...)
_vsnprintf(szWriteBuffer, 1024, format, args);
va_end(args);
MessageBox(NULL, szWriteBuffer, "PhatAC", MB_OK);
MessageBox(NULL, szWriteBuffer, "GDLEnhanced", MB_OK);
}
void MsgBoxError(DWORD dwError, const char* event)
......@@ -446,7 +446,7 @@ void MsgBoxError(DWORD dwError, const char* event)
LocalFree(lpMsgBuf);
}
#define REGLOC HKEY_LOCAL_MACHINE, "Software\\PhatAC"
#define REGLOC HKEY_LOCAL_MACHINE, "Software\\GDLEnhanced"
BOOL SaveConfigKey(const char* Key, DWORD value)
{
......
......@@ -111,7 +111,10 @@ int CVendor::TrySellItemsToPlayer(CPlayerWeenie *buyer, const std::list<ItemProf
maxStackSize = 1;
totalSlotsRequired += (desiredItem->amount / maxStackSize);
totalCost += (DWORD)(vendorItem->weenie->GetValue() * profile.sell_price) * desiredItem->amount;
if (vendorItem->weenie->InqIntQuality(ITEM_TYPE_INT, TYPE_UNDEF) == TYPE_PROMISSORY_NOTE)
totalCost += (DWORD)round((vendorItem->weenie->GetValue() * 1.15) * desiredItem->amount);
else
totalCost += (DWORD)round((vendorItem->weenie->GetValue() * profile.sell_price) * desiredItem->amount);
}
if (totalCost >= MAX_COIN_PURCHASE)
......@@ -173,8 +176,8 @@ int CVendor::TryBuyItemsFromPlayer(CPlayerWeenie *seller, const std::list<ItemPr
return WERROR_NO_OBJECT;
if (desiredItem->amount <= 0)
continue;
totalValue += (DWORD)round(sellerItem->InqIntQuality(VALUE_INT, 0) * profile.buy_price);
if (sellerItem->InqIntQuality(ITEM_TYPE_INT, TYPE_UNDEF) == TYPE_PROMISSORY_NOTE)totalValue += (DWORD)round(sellerItem->InqIntQuality(VALUE_INT, 0));
else totalValue += (DWORD)round(sellerItem->InqIntQuality(VALUE_INT, 0) * profile.buy_price);
}
if (totalValue >= MAX_COIN_PURCHASE)
......
......@@ -193,6 +193,63 @@ void CWeenieFactory::ApplyWeenieDefaults(CWeenieObject *weenie, CWeenieDefaults
weenie->m_Qualities.RemoveInt(PARENT_LOCATION_INT);
int weaponSkill;
if (weenie->m_Qualities.InqInt(WEAPON_SKILL_INT, weaponSkill, TRUE, FALSE))
weenie->m_Qualities.SetInt(WEAPON_SKILL_INT, SkillTable::OldToNewSkill((STypeSkill)weaponSkill));
int wieldReq;
wieldReq = weenie->m_Qualities.GetInt(WIELD_REQUIREMENTS_INT, 0);
if (wieldReq == 1 || wieldReq == 2 || wieldReq == 8)
{
if (weenie->m_Qualities.InqInt(WIELD_SKILLTYPE_INT, weaponSkill, TRUE, FALSE))
weenie->m_Qualities.SetInt(WIELD_SKILLTYPE_INT, SkillTable::OldToNewSkill((STypeSkill)weaponSkill));
}
wieldReq = weenie->m_Qualities.GetInt(WIELD_REQUIREMENTS_2_INT, 0);
if (wieldReq == 1 || wieldReq == 2 || wieldReq == 8)
{
if (weenie->m_Qualities.InqInt(WIELD_SKILLTYPE_2_INT, weaponSkill, TRUE, FALSE))
weenie->m_Qualities.SetInt(WIELD_SKILLTYPE_2_INT, SkillTable::OldToNewSkill((STypeSkill)weaponSkill));
}
wieldReq = weenie->m_Qualities.GetInt(WIELD_REQUIREMENTS_3_INT, 0);
if (wieldReq == 1 || wieldReq == 2 || wieldReq == 8)
{
if (weenie->m_Qualities.InqInt(WIELD_SKILLTYPE_3_INT, weaponSkill, TRUE, FALSE))
weenie->m_Qualities.SetInt(WIELD_SKILLTYPE_3_INT, SkillTable::OldToNewSkill((STypeSkill)weaponSkill));
}
wieldReq = weenie->m_Qualities.GetInt(WIELD_REQUIREMENTS_4_INT, 0);
if (wieldReq == 1 || wieldReq == 2 || wieldReq == 8)
{
if (weenie->m_Qualities.InqInt(WIELD_SKILLTYPE_4_INT, weaponSkill, TRUE, FALSE))
weenie->m_Qualities.SetInt(WIELD_SKILLTYPE_4_INT, SkillTable::OldToNewSkill((STypeSkill)weaponSkill));
}
Skill uaSkill;
if (weenie->m_Qualities.InqSkill(UNARMED_COMBAT_SKILL, uaSkill))
{
Skill finSkill;
if (!weenie->m_Qualities.InqSkill(LIGHT_WEAPONS_SKILL, finSkill))
{
weenie->m_Qualities.SetSkill(LIGHT_WEAPONS_SKILL, uaSkill);
}
}
if (weenie->m_Qualities._skillStatsTable)
{