There is some problem with the original ZH inscription & POL Core 099
Like in that topic
http://forums.polserver.com/viewtopic.php?f=7&t=5260
Problem is still, and & I've tried a lot of variations to fix it - nothing happens.
There is the function code, which calls menu (with my marks)
Code: Select all
function MakeAndProcessMenu( who , spellbook )
var has_spells := spellbook.HasSpells();
var all_spells_size := spellbook.Spells().size();
var all_spells := spellbook.Spells(),
circles := {},
names := {},
spells_cfg := ReadConfigFile(":spells:spells");
if (all_spells.size()<1)
SendSysMessage( who, "Spellbook is empty.", 3, 32 );
return 0;
else
//print("All Spells:" + all_spells ); // DEBUG
//SendSysMessage( who, "All Spells:" + all_spells ); // DEBUG
//SendSysMessage( who, "Spellbook has spells: " + has_spells ); // DEBUG
//SendSysMessage( who, "Spellbook spells size: " + all_spells_size ); // DEBUG
//print("Names{} 1 :" + names ); // DEBUG - NOTHING
endif
foreach spell in all_spells
var circle := spells_cfg[spell].Circle;
if ( !(circle in circles) )
circles.append(circle);
endif
names.append(spells_cfg[spell].Name);
//print("Spells Names:" + spells_cfg[spell].Name ); // DEBUG
//print("Names{} 2 :" + names ); // DEBUG - SPELLS FLOOD
endforeach
var tmenu := CreateMenu( "Select a circle to inscribe");
var i;
for (i := 1; i <= 8; i := i + 1)
var addm := AddMenuItem( tmenu, 0x20bf + i, "Circle "+ cstr(i) +" spells");
if(!addm)
SendSysMessage( who, "Error in making circles menu: "+addm.errortext, 3, 32 );
return 0;
endif
SleepMS(5);
endfor
/*
var tmenu := CreateMenu( "Select a circle to inscribe");
foreach circle in circles
var addm := AddMenuItem( tmenu, 0x20bf + circle, "Circle "+circle+" spells");
if(!addm)
SendSysMessage( who, "Error in making circles menu: "+addm.errortext, 3, 32 );
return 0;
endif
SleepMS(5);
endforeach
*/
var circle_choice := SelectMenuItem2( who, tmenu ); // what this menu shows?
if( circle_choice == 0 )
SendSysMessage( who, "Cancelled.", 3, 32 );
return 0;
elseif ( circle_choice == error )
SendSysMessage( who, "Error picking a circle: "+circle_choice.errortext, 3, 32 );
return 0;
endif
var tmenu2 := CreateMenu("Select a spell to inscribe"),
spell_names := {},
scroll_types := {};
foreach scroll in GetConfigIntKeys(config_file);
var spellname := config_file[scroll].name;
if ( spellname in names && config_file[scroll].Circle == circles[circle_choice.index])
spell_names.append( spellname );
scroll_types.append( scroll );
AddMenuItem(tmenu2, config_file[scroll].graphic, spellname);
print(" spellname: " + spellname ); // DEBUG
print(" scroll: " + scroll ); // DEBUG
endif
endforeach
var scroll_choice := SelectMenuItem2(who, tmenu2 ); // what this menu shows?
if( scroll_choice == 0 )
SendSysMessage( who, "Cancelled.", 3, 32 );
return 0;
elseif ( scroll_choice == error )
SendSysMessage( who, "Error picking a spellscroll: "+scroll_choice.errortext, 3, 32 );
return 0;
else
SendSysMessage( who, "You will make a "+spell_names[scroll_choice.index]+" scroll.", 3, 67 );
return scroll_types[scroll_choice.index];
endif
endfunction
P.S. Problem is:
I click Inscription button, after choose Spell Book with 64 spells.
Appear menu with circles (all 8 circles). If I click at 4 circle there will be only 6 spells. If 5 circle and higher, there won't be full spells (only 5). But at 1-2 & 3 circles, there are all spells.
I choose 5 circle There are 5 spells, which fit in the window Else spells not displayed With best regards!