The active Spells are in a dictionary.
I start the script with a gump in tempmod function:
Code: Select all
function tempmod(who, dict, duration, spellname, incrementDictValues := 1)
set_critical(1);
var activeSpells:= GetObjProperty (who, CPROP_MAGIC_ACTIVESPELLS);
if (activeSpells == error)
activeSpells:= dictionary;
endif
var process := start_script( ":magic:testgump", who);
var gumpid := process.pid;
if (activeSpells.exists(spellname))
err.errortext:= "already under influence";
set_critical (0);
return err;
endif
...
Code: Select all
se uo;
use os;
var layout:= array(
"nomove",
"noclose",
"GumpPic 4 28 2256"
);
var layout1:= array(
"nomove",
"noclose",
"GumpPic 48 28 2192"
);
var layout2:= array(
"nomove",
"noclose",
"GumpPic 92 28 2255"
);
var layout3:= array(
"nomove",
"noclose",
"GumpPic 136 28 2249"
);
var layout4:= array(
"nomove",
"noclose",
"GumpPic 180 28 2248"
);
var data:= array(
);
program gumpi(who)
var spells := dictionary;
spells := GetObjProperty(who, "magic_activeSpells");
var keys := spells.keys();
foreach spruch in (keys)
if(spruch == "Segen")
SendDialogGump (who, layout, data);
endif
if(spruch == "Massensegen")
SendDialogGump (who, layout1, data);
endif
if(spruch == "Staerke")
SendDialogGump (who, layout2, data);
endif
if(spruch == "Schlaeue")
SendDialogGump (who, layout3, data);
endif
if(spruch == "Behaendigkeit")
SendDialogGump (who, layout4, data);
endif
endforeach
endprogram
It is dependent what i cast first, second...