Auto-translated
With posters, it has the most beautiful implementation and is best perceived. Unfortunately, no one responded to my request for help on heroesleague, although many people play RTA :( I'll have to do it myself.
New here? I'm Roha — want a quick tour?
function VisitDeviltavern (heroname)
if heroname == 'Biara' then
if visiter_deviltavern == 0 then
BlockGame ();
GiveHeroSkill ('Biara', 98);
visiter_deviltavern = 1;
SetObjectiveState ('saobj', OBJECTIVE_COMPLETED, 1);
GiveExp ('Biara', 12000);
sleep (30);
UnblockGame ();
else MessageBox (map_path..'deviltavern-visited.txt');
end;
else MessageBox (map_path..'deviltavern-visiternobiara.txt');
end;
end;Everything works perfectly, but the skill isn't being granted. Why?
for i=1,15 do
Trigger(OBJECT_TOUCH_TRIGGER,"dw"..i,"dwellingF")
end;
cr_count={10,30,20.....20}
cr_type={92,94,96.....105}
cr_cost={20,40,80.....1000}
function dwellingF(hero, obj_name)
n=<how do I get the object number here?>
AddHeroCreatures(hero,cr_type[n],cr_count[n])
SetPlayerResource(1,GOLD,GetPlayerResource(1,GOLD)-cr_count[n]*cr_cost[n]);
end;
Please advise. I have many identical objects on the map, and a hero can buy creatures from them using a script. The object names are "dw1", "dw2", "dw3", etc. Can I assign the same trigger to them so that the function receives the object number as a parameter, represented as a number, when the hero enters. Then, I can define the type, quantity, and cost of creatures for each object using an array.for i=1,15 do
Trigger(OBJECT_TOUCH_TRIGGER,"dw"..i,"dwellingF")
end;
cr_count={10,30,20.....20}
cr_type={92,94,96.....105}
cr_cost={20,40,80.....1000}
function dwellingF(hero, obj_name)
n=<how do I get the object number here?>
AddHeroCreatures(hero,cr_type[n],cr_count[n])
SetPlayerResource(1,GOLD,GetPlayerResource(1,GOLD)-cr_count[n]*cr_cost[n]);
end;
for i=1,15 do
if obj_name=="dw"..i then
n=i
end
end
That is, should all the skills necessary for it be present? And is there any way to do it without that?
I need to pass functions with parameter to the MessageBox and QuestionBox commands. How can I do this?
MessageBox(textPath.."vopros.txt", "function_ok('"..parametr1.."')");
I can't disable the circles under the monsters.
Here's what I tried:
SetObjectEnabled("archer1",0)
SetMonsterSelectionType("archer1",0)
The console says:
ScriptError: "archer1" is not disabled
Is there a script that sets the maximum number of movement points? It must be above the nominal value.
For example, a standard 2500 would become 5000, but it wouldn't immediately fill the green bar, meaning it would move only halfway, even though it doesn't actually have more movement points.
function movenext()
while GetHeroStat("Ossir",STAT_MOVE_POINTS)>1000 do
sleep(7)
end
print( 'movepoints<1000')
ChangeHeroStat("Ossir",STAT_MOVE_POINTS,1500)
end
function add_move_points()
startThread(movenext)
end
Trigger(NEW_DAY_TRIGGER,"add_move_points");
Adds 1500 points each day.
Try this:It adds 1500 movement points each day.
function movenext()
while GetHeroStat("Ossir",STAT_MOVE_POINTS)>1000 do
sleep(7)
end
print( 'movepoints<1000')
ChangeHeroStat("Ossir",STAT_MOVE_POINTS,1500)
end
function add_move_points()
startThread(movenext)
end
Trigger(NEW_DAY_TRIGGER,"add_move_points");
Is there a command that clears a single line in the console?
In what sense does it "clear"? Does it delete the previous one?