Auto-translated
How can I make it so that a certain number of resources are deducted from a player on a specific day? Thanks in advance.
New here? I'm Roha — want a quick tour?
How can I make it so that a certain number of resources are deducted from a player on a specific day? Thanks in advance.
I remember about the experience, but not about the resources.
I need all the resources; it takes too long to write out their names completely.
I also wanted to create a StartCombat script in my map, but it's not popular – it's not used in custom maps or in Nival's maps...
StartCombat (hero, nil, 2,CREATURE_THANE, 20,CREATURE_WARLORD, 20, nil);
SetObjectEnabled("cr1", nil);\nSetObjectEnabled("cr2", nil);\n\nTrigger(OBJECT_TOUCH_TRIGGER, "cr1", "fn");\nTrigger(OBJECT_TOUCH_TRIGGER, "cr2", "fn);\n\nfunction fn(heroName, objectName)\n\tif (objectName == "cr1") then\n\tdo\n\t\tlocal sulfur = GetPlayerResource(PLAYER_1, 4);\n\t\tMessageBox(path.."text1.txt);\n\t\tSetPlayerResource(PLAYER_1, 4, sulfur + 10);\n\tend else\n\tdo\n\t\tlocal gem = GetPlayerResource(PLAYER_1, 5);\n\t\tMessageBox(path.."text1.txt);\n\t\tSetPlayerResource(PLAYER_1, 5, gem + 10);\n\tend;\n\tend;\nend;\nAnd yes, I would be very grateful to anyone who explains to me what parameters are actually passed to the function associated with the touch trigger:smile20:
path = GetMapDataPath()`. You can also remove two unnecessary do-end pairs, but this is purely for aesthetics.
And yes, I would be very grateful to anyone who could explain to me which parameters are actually passed to the function related to the touch trigger.
The 'path' variable is not defined.
The script should work if you add the following to the beginning:You can also remove two extra do-end pairs, but that's just for aesthetics.path = GetMapDataPath()
It displays the name of the hero who touched the object and the name of the object itself.
Can anyone help me?
SetObjectiveState ( "obj3",OBJECTIVE_COMPLETED);
PlayVisualEffect('/Effects/_(Effect)/HolyWord.xdb#xpointer(/Effect)', 'necr1', '', X, Y, Z, 0, 0);
sleep (5);
Instead of X, Y, Z, you need to choose an offset to your liking; you can set Z to 5-6 right away. And you will probably need to increase the sleep time several times, as the animation is quite long.