Skip to content

Commit 7e01e56

Browse files
committed
Fixed a weird double assignment on line 47.
Added Wraith Form to timedScripts.cfg. Changed NoCure setting to NoEnd setting for In Cognito and Polymorph in timedScripts.cfg. Improvements to incognito spell script in :magery:spells/circle5. Improvements to polymorph in :magery:spells/circle7. Improvements to wform in :necromancy: Still a work in progress - slow progress :D
1 parent 36cf1fe commit 7e01e56

File tree

5 files changed

+64
-36
lines changed

5 files changed

+64
-36
lines changed

pkg/skills/magery/spellStarter.src

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ include ":containers:containers";
1313
include ":itemUtils:itemdesc";
1414
include "include/client";
1515
include "include/sounds";
16+
include ":timedScripts:timedScripts";
1617

1718
program SpellStarter(params)
1819
var mobile := params[1]; // Caster
@@ -44,7 +45,7 @@ program SpellStarter(params)
4445
endif
4546

4647
// Check for conflicting spells.
47-
var conflict := conflict := ConflictsCheck( mobile, spell_id );
48+
var conflict := ConflictsCheck( mobile, spell_id );
4849
if( conflict )
4950
SendSysMessage( mobile, "You cannot cast this spell while under the influence of " + conflict + ".", color := 33 );
5051
return 0;
@@ -356,24 +357,24 @@ function ConflictsCheck( byref mobile, byref spell_id )
356357
var conlicting_spells := current_spell_elem.Conflicts;
357358
var conflicts := SplitWords( conlicting_spells );
358359
var conlicting_spells_names := {};
359-
var temp := CStr(spell_id) in conflicts;
360+
var con_spel_elem;
361+
var con_spell_name := "";
362+
// Print("current_spell == "+current_spell);
363+
360364
// Added the following on 2024-02-06
361-
// var running_timers := TS_GetTimerNames(mobile);
362-
// foreach spell in conflicts
365+
var running_timers := TS_GetTimerNames(mobile);
366+
foreach con_spell_id in conflicts
363367
// Get spell_name of conflicting spell.
368+
con_spel_elem := MS_GetSpellsCfgElem(con_spell_id);
369+
con_spell_name := con_spel_elem.Name;
364370
// Check against running timers.
365-
// If spell_name in running_timers.
366-
// return spell_name.
367-
// endforeach
368-
// return "";
371+
If (con_spell_name in running_timers)
372+
return con_spell_name;
373+
endif
374+
endforeach
375+
376+
return "";
369377

370378

371-
if( current_spell == "Incognito" && GetObjProperty( mobile, "Polymorphed" ) )
372-
return "Polymorph";
373-
elseif( current_spell == "Polymorph" && GetObjProperty( mobile, "Incognito" ) )
374-
return "Incognito";
375-
else
376-
return "";
377-
endif
378379
// NecroHBeast
379380
endfunction

pkg/skills/magery/spells/circle5/incognito.src

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ include ":virtue:virtue";
1111
program cast_incognito(parms)
1212
var caster := parms[1];
1313
var info := parms[2];
14+
var duration := 0;
1415

1516

1617
MS_PlaySpellSFX(info.spell_id, caster);
1718
MS_PlaySpellGFX(info.spell_id, caster, caster);
1819

19-
// Duration: ((Eval / 5) + 1) * 6
20-
var duration := AP_GetSkill(caster, MAGERY) * 1.2;
21-
TS_StartTimer(caster, "Incognito", duration, 0, caster);
22-
VS_AdjustVirtue(caster, "Honesty", -1, 100);
20+
21+
if( !GetObjProperty( caster, "Incognito" ) )
22+
// On OSI Duration is calculated ((Eval / 5) + 1) * 6
23+
duration := AP_GetSkill(caster, MAGERY) * 1.2;
24+
25+
// TS_StartTimer(caster, "Incognito", duration, 0, caster);
26+
TS_StartTimer(caster, "Incognito", 1);
27+
VS_AdjustVirtue(caster, "Honesty", -1, 100);
28+
else
29+
TS_LowerDuration( caster, "Incognito", -1 );
30+
endif
2331

2432
return 1;
2533
endprogram

pkg/skills/magery/spells/circle7/polymorph.src

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ program cast_polymorph( parms )
7373
endif
7474

7575

76-
77-
if(!GetObjProperty(caster, "Polymorphed"))
76+
if(!("Polymorph" in TS_GetTimerNames(caster)))
77+
// if(!GetObjProperty(caster, "Polymorph"))
7878
// Preserve caster's graphic and colour in a CProp on the character.
79-
my_form.+graphic := caster.graphic;
79+
// my_form.+graphic := caster.graphic;
8080
my_form.colour := caster.color;
81-
SetObjProperty(caster, "MyOrigForm", my_form);
82-
SetObjProperty(caster, "Polymorphed", 1);
81+
// SetObjProperty(caster, "MyOrigForm", my_form);
82+
SetObjProperty(caster, "Polymorph", caster.color);
8383
// Get the appropriate group of creatures based on magery skill.
8484
critter_group := GetGroup(critgroup);
8585
// Pick a random creature from the group.
@@ -103,14 +103,16 @@ program cast_polymorph( parms )
103103
caster.addbuff(buff_icon, 0, cliloc_name, cliloc_desc, article + "\t" + crit_name); // You are transformed into ~1_ARTICLE~ ~2_FORM~.
104104
// Honesty takes a hit for polymorphing.
105105
VS_AdjustVirtue(caster, "Honesty", -1, 50);
106+
TS_StartTimer(caster, "Polymorph", 10);
106107
else
107108
// Restore caster's graphic and colour.
108-
my_form := GetObjProperty(caster, "MyOrigForm");
109-
caster.graphic := my_form.graphic;
110-
caster.color := my_form.colour;
109+
// my_form := GetObjProperty(caster, "MyOrigForm");
110+
// caster.graphic := my_form.graphic;
111+
// caster.color := my_form.colour;
111112
// Clear the CProps and delete the buff icon.
112-
EraseObjProperty(caster, "MyOrigForm");
113-
EraseObjProperty(caster, "Polymorphed");
113+
// EraseObjProperty(caster, "MyOrigForm");
114+
// EraseObjProperty(caster, "Polymorphed");
115+
TS_LowerDuration(caster, "Polymorph", -1);
114116
caster.delbuff(buff_icon);
115117
endif
116118

pkg/skills/necromancy/wform.src

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ program wraith_form( params )
1111
//var spellID := params[3];
1212
//var cast_on := params[4]; // Target of spell if required.
1313

14-
if(Getobjproperty(caster, "wraith"))
14+
if(Getobjproperty(caster, "WraithForm"))
1515
PlayObjectCenteredEffectEx( caster, 0x374A, 1, 15, 9902, 4, 3, 1108 );
1616
caster.graphic := caster.trueobjtype;
1717
caster.color := caster.truecolor;
@@ -35,7 +35,7 @@ program wraith_form( params )
3535

3636
return 0;
3737
endif
38-
38+
3939
if (Getobjproperty(caster, "poly") == 1)
4040
SendSysMessage(caster,"You are already under the influence of the spell!");
4141
return 0;
@@ -62,7 +62,7 @@ program wraith_form( params )
6262
eraseobjproperty(caster,"NewRegenRateForStamina");
6363
RecalcVitals(caster);
6464
endif
65-
65+
6666
PlaySoundEffect(caster, 0x17F);
6767
PlayObjectCenteredEffectEx( caster, 0x374A, 1, 15, 9902, 4, 3, 1108 );
6868
Sleep(1);
@@ -72,7 +72,7 @@ program wraith_form( params )
7272
else
7373
caster.graphic := 0x2EB;
7474
endif
75-
75+
7676
caster.color :=0;
7777
caster.title_prefix := "";
7878
caster.title_suffix := "";
@@ -83,5 +83,5 @@ program wraith_form( params )
8383
ModifyResistance(caster, "Energy", -5);
8484
ModifyResistance(caster, "Physical", 15);
8585
SetobjProperty(caster, "poly", 2);
86-
SetObjProperty(caster, "wraith", 1);
86+
SetObjProperty(caster, "Wraith Form", 1);
8787
endprogram

pkg/utils/timedScripts/config/timedScripts.cfg

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ TimerElem Incognito
283283
Name Incognito
284284
Script subScripts/magery/incognito
285285
EndScript subScripts/magery/endIncognito
286-
NoCure 1
286+
NoEnd 1
287287
ContinueOnDeath 0
288288
BuffIcon 1032
289289
cliloc_name 1075819
@@ -374,7 +374,7 @@ TimerElem Polymorph
374374
EndScript subScripts/magery/endPolymorph
375375
LogOffScript subScripts/magery/endPolymorph
376376

377-
NoCure 1
377+
NoEnd 1
378378
ContinueOnDeath 0 // On OSI, it ends when Resed.
379379
BuffIcon 1035
380380
cliloc_name 1075822
@@ -465,6 +465,23 @@ TimerElem Weaken
465465
cliloc_desc 1075838
466466
}
467467

468+
#--=[ Necromancy ]=--------------------
469+
470+
TimerElem WraithForm
471+
{
472+
Name Wraith Form
473+
Script subScripts/magery/wraithForm
474+
EndScript subScripts/magery/endWraithForm
475+
LogOffScript subScripts/magery/endWraithForm
476+
477+
NoEnd 1
478+
ContinueOnDeath 0 // On OSI, it ends when Resed.
479+
BuffIcon 1124
480+
cliloc_name 1060524
481+
cliloc_desc 1153829
482+
}
483+
484+
468485
#--=[ Fish Pies ]=--------------------
469486

470487
TimerElem FishMedBoost

0 commit comments

Comments
 (0)