Jass skill model definition (-)

Source: Internet
Author: User
Tags dota

Jass skill model definition (-)
What is Jass? First, let's explain what jass is. Baidu: JASS (correctly speaking, JASS 2) is the programming language of Warcraft 3. It is used to control games and maps. It is also the basis of NLP games and maps. Unit, Region, Trigger )...... Will eventually be translated into the JASS language and stored in the map file for use during the game. JASS is similar to Basic in terms of syntax structure, and many C languages are also referenced. Syntax structure: copy the code // jass syntax structure function Trig_functions_Conditions takes nothing returns boolean if (not (GetUnitTypeId (GetTrainedUnit () = 'n000 ')) then return false endif return trueendfunction function calls takes nothing returns nothing call CreateItemLoc ('modt ', GetUnitLoc (GetTriggerUnit () call UnitAddItemSwapped (GetLastCreatedItem (), GetTrainedUnit ()) endfunction // C structure/* Where Ge TTrainedUnit () returns the Unit (type: Unit) created in the trigger event. GetUnitTypeId (Unit) returns two IDs (String) corresponding to a certain Unit from the game function library, the first function roughly means that if the Id of the unit created in the trigger event is equal to 'n000', true is returned; otherwise, false */public bool Trig_functions_Conditions () is returned () {return GetUnitTypeId (GetTrainedUnit () = 'n000'}/* GetTriggerUnit () returns the Unit (Unit) in the trigger event. Type: Unit) GetUnitLoc (Unit) return the location where a certain unit is located. 'modt 'is the IdCreateItemLoc (ItemId, Position) of the blood-sucking mask. To create an item at a certain Position, all explanations are as follows: the Position of the trigger unit, Create a blood-sucking mask. (Khan... (Not yet) All the above explanations in the GetLastCreatedItem () map editor are as follows: move A created item in the map editor to the item bar of the previous Creation Unit and combine it: Create A blood-sucking mask in the position of trigger unit A, and then move the blood-sucking mask to the item bar of. Note: Q: why not create a blood-sucking mask directly in the hero bar? This function is not available in the function library. This function can only be implemented indirectly. I don't think I can use this function unless I can rewrite the function library used by this game.-| */public void Trig_functions_Actions () {CreateItemLoc ('modt ', getUnitLoc (GetTriggerUnit (); UnitAddItemSwapped (GetLastCreatedItem (), GetTrainedUnit ();} copying code is so long that I suddenly talked about Jass today. Let's explain the reason. In fact, I haven't used this ancient language for a long time. For a few days, I want to play military games, but I have no such experience. I used to like the frozen throne game in my college, and I learned Jass as I played it. Jass is my first language, familiar with WorldEditor. In this way, I want to add the WorldEditor element to my own game, such as the map editing mode, which can be divided into the earth surface, unit, and destructible (Forest, tree, bucket, and box), cannot be damaged (stone, statue, effect), path blocking. I am also divided into several layers in my map. This is an advantage. I want to create a map editor (not I am crazy, but I have, if the map is completed by code, the amount of development is a little large.) in this way, you can perform functions such as the surface, unit, path blocking, destructibility, and non-destructibility, deploy these layers to the hexagonal array at the most basic level. When I need to develop a function, I can move other layers away, leaving only the functional layers to be developed. In addition, the Unit model in WorldEditor is also a good reference. It is really amazing. It is hard to imagine it out of thin air. (If you have a good back-to-ground, paste it on your own ), even in the Trigger mode in WorldEditor, I guess I will do it as well. The Trigger mode is very good if a new event, a bullet, or a painting appear randomly in the game. Those who have really played war3 or dota have more or less used WorldEditor, but they have different levels of proficiency. Today, let's take a test. Let's work with you to develop a passive skill of dota's half-horse chief. Very simple, just use the functions in the editor, and do not need to write additional jass scripts. 1. First, open the map editor and create a new hero skill in the skill class. 2. Open the Trigger editor and create a Trigger event: When a unit is attacked, the condition is: attacked unit counterattack Halo Level greater than 0 action: if the counterattack halo level is equal to 1, the attacked unit will give the attack unit 10 points of basic damage + the attacker's strength x 0.2 of hero damage. If the counterattack halo level is equal to 2, the attacked unit will give the attack unit 20 points of basic damage + attacker strength * 0.3 of hero damage if the counterattack halo level is equal to 3, then the attacked unit will be given 30 points of basic damage to the attacked unit + how will it be hurt by the attacker's power * 0.4 of heroes, let's simply move your hand to fight back the halo. (The sharp thorn of the cave demon and the thorn halo of the Prophet cannot achieve the effect of fighting back the halo. For details, you can see why this skill has to be done with triggers)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.