NPCs/Resistances

* evalue and display school immune mask
This commit is contained in:
Sarjuuk 2025-12-02 18:05:23 +01:00
parent 957f3bcf20
commit ca563f081e
10 changed files with 40 additions and 5 deletions

View file

@ -972,10 +972,18 @@ class NpcBaseResponse extends TemplateResponse implements ICache
// Resistances
$resNames = [null, 'hol', 'fir', 'nat', 'fro', 'sha', 'arc'];
$tmpRes = [];
$res = $this->subject->getBaseStats('resistance'); // $sc => $amt
$stats['resistance'] = '';
foreach ($this->subject->getBaseStats('resistance') as $sc => $amt)
if ($amt)
$tmpRes[] = '[span class="moneyschool'.$resNames[$sc].'"]'.$amt.'[/span]';
foreach ($resNames as $idx => $sc)
{
if (!$sc)
continue;
if ((1 << $idx) & $this->subject->getField('schoolImmuneMask'))
$tmpRes[] = '[tooltip=tooltip_immune][span class="tip moneyschool'.$sc.'"]∞[/span][/tooltip]';
else if ($res[$idx])
$tmpRes[] = '[span class="moneyschool'.$sc.'"]'.$res[$idx].'[/span]';
}
if ($tmpRes)
{
@ -1026,8 +1034,17 @@ class NpcBaseResponse extends TemplateResponse implements ICache
$stats['resistance'] = Lang::npc('resistances').'…';
$tmpRes = '';
foreach ($this->altNPCs->getBaseStats('resistance') as $sc => $amt)
$tmpRes .= '[td][span style="margin: 0px 5px"]'.$amt.'[/span][/td]';
$res = $this->altNPCs->getBaseStats('resistance');
foreach ($resNames as $idx => $sc)
{
if (!$sc)
continue;
if ((1 << $idx) & $this->altNPCs->getField('schoolImmuneMask'))
$tmpRes .= '[td][span style="margin: 0px 5px"]∞[/span][/td]';
else if ($res[$idx])
$tmpRes .= '[td][span style="margin: 0px 5px"]'.$res[$idx].'[/span][/td]';
}
$modes['resistance'][] = '[td]'.$m.'&nbsp;&nbsp;&nbsp;&nbsp;[/td]'.$tmpRes;
}

View file

@ -565,6 +565,7 @@ CREATE TABLE `aowow_creature` (
`resistance6` smallint(6) NOT NULL DEFAULT 0,
`racialLeader` tinyint(3) unsigned NOT NULL DEFAULT 0,
`mechanicImmuneMask` int(10) unsigned NOT NULL DEFAULT 0,
`schoolImmuneMask` int(10) unsigned NOT NULL DEFAULT 0,
`flagsExtra` int(10) unsigned NOT NULL DEFAULT 0,
`scriptName` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),

View file

@ -0,0 +1,4 @@
ALTER TABLE aowow_creature
ADD COLUMN `schoolImmuneMask` int(10) unsigned NOT NULL DEFAULT 0 AFTER `mechanicImmuneMask`;
UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' creature');

View file

@ -71,6 +71,7 @@ CLISetup::registerSetup("sql", new class extends SetupScript
IFNULL(ctr1.Resistance, 0), IFNULL(ctr2.Resistance, 0), IFNULL(ctr3.Resistance, 0), IFNULL(ctr4.Resistance, 0), IFNULL(ctr5.Resistance, 0), IFNULL(ctr6.Resistance, 0),
RacialLeader,
mechanic_immune_mask,
spell_school_immune_mask,
flags_extra,
ScriptName
FROM creature_template ct

View file

@ -3097,6 +3097,8 @@ var LANG = {
tooltip_uprate: "Hilfreich/lustig",
tooltip_zonelink: "Ein Klick auf diesen Link<br />bringt Euch zur Gebietsseite.",
tooltip_immune: "Immun", // aowow - custom
reputationhistory: "Rufgeschichte",
reputationaction: "Aktion",

View file

@ -3146,6 +3146,8 @@ var LANG = {
tooltip_uprate: "Insightful/funny",
tooltip_zonelink: "Clicking on this link will<br />take you to the zone page.",
tooltip_immune: "Immune", // aowow - custom
reputationhistory: "Reputation History",
reputationaction: "Reputation Action",

View file

@ -3097,6 +3097,8 @@ var LANG = {
tooltip_uprate: "Útil/gracioso",
tooltip_zonelink: "Hacer click en este enlace, te<br />llevará a la página de la zona.",
tooltip_immune: "Inmune", // aowow - custom
reputationhistory: "Historial de reputación",
reputationaction: "Acción de reputación",

View file

@ -3098,6 +3098,8 @@ var LANG = {
tooltip_uprate: "Intéressant/drôle",
tooltip_zonelink: "Cliquer sur ce lien vous amènera<br />à la page de la zone correspondante.",
tooltip_immune: "Immunisé", // aowow - custom
reputationhistory: "Historique de réputation",
reputationaction: "Action de réputation",

View file

@ -3098,6 +3098,8 @@ var LANG = {
tooltip_uprate: "Высокий",
tooltip_zonelink: "Щелкнув по этой ссылке вы<br />попадете на страницу местности.",
tooltip_immune: "Иммунный", // aowow - custom
reputationhistory: "История репутации",
reputationaction: "Действие Репутации",

View file

@ -3145,6 +3145,8 @@ var LANG = {
tooltip_uprate: "犀利/有趣",
tooltip_zonelink: "点击此链接就能够<br />跳转到地区页。",
tooltip_immune: "免疫", // aowow - custom
reputationhistory: "声望历史",
reputationaction: "声望行动",