Новые нативные функции в 1.29

Добавлен , опубликован
В вышедшем сегодня патче для Warcraft III помимо огромного количества правок баланса и соревновательных карт была включена целая гора новых нативных JASS-функций (без малого почти сотня). Некоторые из них являются более удобными версиями уже бывшего доступным функционала, но большинство несут совершенно новые возможности, до сих пор бывшие недоступными простому смертному картоделу.
В общем, ознакамливайтесь и радуйтесь! Ну или не радуйтесь. Сами уж как-нибудь разберётесь.
type mousebuttontype extends handle

constant native GetBJMaxPlayers             takes nothing returns integer
constant native GetBJPlayerNeutralVictim    takes nothing returns integer
constant native GetBJPlayerNeutralExtra     takes nothing returns integer
constant native GetBJMaxPlayerSlots         takes nothing returns integer
constant native GetPlayerNeutralPassive     takes nothing returns integer
constant native GetPlayerNeutralAggressive  takes nothing returns integer

constant integer            PLAYER_NEUTRAL_PASSIVE              = GetPlayerNeutralPassive()
constant integer            PLAYER_NEUTRAL_AGGRESSIVE           = GetPlayerNeutralAggressive()

constant mousebuttontype    MOUSE_BUTTON_TYPE_LEFT              = ConvertMouseButtonType(1)
constant mousebuttontype    MOUSE_BUTTON_TYPE_MIDDLE            = ConvertMouseButtonType(2)
constant mousebuttontype    MOUSE_BUTTON_TYPE_RIGHT             = ConvertMouseButtonType(3)

constant playerevent        EVENT_PLAYER_MOUSE_DOWN             = ConvertPlayerEvent(269)
constant playerevent        EVENT_PLAYER_MOUSE_UP               = ConvertPlayerEvent(270)
constant playerevent        EVENT_PLAYER_MOUSE_MOVE             = ConvertPlayerEvent(271)

constant playerunitevent    EVENT_PLAYER_UNIT_SELL              = ConvertPlayerUnitEvent(272)
constant playerunitevent    EVENT_PLAYER_UNIT_CHANGE_OWNER      = ConvertPlayerUnitEvent(273)
constant playerunitevent    EVENT_PLAYER_UNIT_SELL_ITEM         = ConvertPlayerUnitEvent(274)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_CHANNEL     = ConvertPlayerUnitEvent(275)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_CAST        = ConvertPlayerUnitEvent(276)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_EFFECT      = ConvertPlayerUnitEvent(277)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_FINISH      = ConvertPlayerUnitEvent(278)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_ENDCAST     = ConvertPlayerUnitEvent(279)
constant playerunitevent    EVENT_PLAYER_UNIT_PAWN_ITEM         = ConvertPlayerUnitEvent(280)

constant unitevent          EVENT_UNIT_SELL                     = ConvertUnitEvent(289)
constant unitevent          EVENT_UNIT_CHANGE_OWNER             = ConvertUnitEvent(290)
constant unitevent          EVENT_UNIT_SELL_ITEM                = ConvertUnitEvent(291)
constant unitevent          EVENT_UNIT_SPELL_CHANNEL            = ConvertUnitEvent(292)
constant unitevent          EVENT_UNIT_SPELL_CAST               = ConvertUnitEvent(293)
constant unitevent          EVENT_UNIT_SPELL_EFFECT             = ConvertUnitEvent(294)
constant unitevent          EVENT_UNIT_SPELL_FINISH             = ConvertUnitEvent(295)
constant unitevent          EVENT_UNIT_SPELL_ENDCAST            = ConvertUnitEvent(296)
constant unitevent          EVENT_UNIT_PAWN_ITEM                = ConvertUnitEvent(297)


//===================
// Player input
//===================

native GetTriggerPlayerMouseX               takes nothing returns real
native GetTriggerPlayerMouseY               takes nothing returns real
native GetTriggerPlayerMousePosition        takes nothing returns location
native GetTriggerPlayerMouseButton          takes nothing returns mousebuttontype


//===================
// Items UI
//===================

native SetItemName                          takes item whichItem, string name returns nothing
native SetItemDescription                   takes item whichItem, string name returns nothing
native SetItemTooltip                       takes item whichItem, string name returns nothing
native SetItemExtendedTooltip               takes item whichItem, string name returns nothing
native SetItemIconPath                      takes item whichItem, string name returns nothing

native GetItemDescription                   takes item whichItem returns string
native GetItemTooltip                       takes item whichItem returns string
native GetItemExtendedTooltip               takes item whichItem returns string
native GetItemIconPath                      takes item whichItem returns string


//===================
// Abils
//===================

    // Stats

native GetAbilityManaCost                   takes integer abilId, integer level returns integer
native GetAbilityCooldown                   takes integer abilId, integer level returns real

    // Text

native SetAbilityTooltip                    takes integer abilCode, string tooltip, integer level returns nothing
native SetAbilityOnTooltip                  takes integer abilCode, string tooltip, integer level returns nothing
native SetAbilityExtendedTooltip            takes integer abilCode, string ExtendedTooltip, integer level returns nothing
native SetAbilityOnExtendedTooltip          takes integer abilCode, string ExtendedTooltip, integer level returns nothing
native SetAbilityResearchTooltip            takes integer abilCode, string researchTooltip, integer level returns nothing
native SetAbilityResearchExtendedTooltip    takes integer abilCode, string researchExtendedTooltip, integer level returns nothing

native GetAbilityTooltip                    takes integer abilCode, integer level returns string
native GetAbilityOnTooltip                  takes integer abilCode, integer level returns string
native GetAbilityExtendedTooltip            takes integer abilCode, integer level returns string
native GetAbilityOnExtendedTooltip          takes integer abilCode, integer level returns string
native GetAbilityResearchTooltip            takes integer abilCode, integer level returns string
native GetAbilityResearchExtendedTooltip    takes integer abilCode, integer level returns string

    // Button

native SetAbilityIcon                       takes integer abilCode, string iconPath, integer level returns nothing
native SetAbilityOnIcon                     takes integer abilCode, string iconPath returns nothing
native SetAbilityPosX                       takes integer abilCode, integer x returns nothing
native SetAbilityPosY                       takes integer abilCode, integer y returns nothing
native SetAbilityOnPosX                     takes integer abilCode, integer x returns nothing
native SetAbilityOnPosY                     takes integer abilCode, integer y returns nothing

native GetAbilityIcon                       takes integer abilCode, integer level returns string
native GetAbilityOnIcon                     takes integer abilCode returns string
native GetAbilityPosX                       takes integer abilCode returns integer
native GetAbilityPosY                       takes integer abilCode returns integer
native GetAbilityOnPosX                     takes integer abilCode returns integer
native GetAbilityOnPosY                     takes integer abilCode returns integer


//===================
// Unit
//===================

    // Stats

native SetUnitArmor                         takes unit whichUnit, real armorAmount returns nothing
native SetUnitMaxHP                         takes unit whichUnit, integer hp returns nothing
native SetUnitMaxMana                       takes unit whichUnit, integer mana returns nothing
native SetUnitBaseDamage                    takes unit whichUnit, integer baseDamage, integer weaponIndex returns nothing
native SetUnitDiceNumber                    takes unit whichUnit, integer diceNumber, integer weaponIndex returns nothing
native SetUnitDiceSides                     takes unit whichUnit, integer diceSides, integer weaponIndex returns nothing
native SetUnitAttackCooldown                takes unit whichUnit, real cooldown, integer weaponIndex returns nothing

native GetUnitArmor                         takes unit whichUnit returns real
native GetUnitMaxHP                         takes unit whichUnit returns integer
native GetUnitMaxMana                       takes unit whichUnit returns integer
native GetUnitBaseDamage                    takes unit whichUnit, integer weaponIndex returns integer
native GetUnitDiceNumber                    takes unit whichUnit, integer weaponIndex returns integer
native GetUnitDiceSides                     takes unit whichUnit, integer weaponIndex returns integer
native GetUnitAttackCooldown                takes unit whichUnit, integer weaponIndex returns real

native GetUnitCollisionSize                 takes unit whichUnit returns real
native GetLocalUnitZ                        takes unit whichUnit returns real

native SetUnitName                          takes unit whichUnit, string name returns nothing
native SetUnitNameAll                       takes unit whichUnit, string name returns nothing
native SetHeroProperName                    takes unit whichUnit, string name returns nothing

    // Abils

native SetUnitAbilityCooldown               takes unit whichUnit, integer abilId, integer level, real cooldown returns nothing
native GetUnitAbilityCooldown               takes unit whichUnit, integer abilId, integer level returns real
native GetUnitAbilityCooldownRemaining      takes unit whichUnit, integer abilId returns real
native EndUnitAbilityCooldown               takes unit whichUnit, integer abilCode returns nothing

native GetUnitAbilityManaCost               takes unit whichUnit, integer abilId, integer level returns integer

native UnitHideAbility                      takes unit whichUnit, integer abilId, boolean flag returns nothing
native UnitDisableAbility                   takes unit whichUnit, integer abilId, boolean flag, boolean hideUI returns nothing
native DeleteHeroAbility                    takes unit whichUnit, integer abilCode returns nothing

    // Misc.

native UnitInterruptAttack                  takes unit whichUnit returns nothing
native UnitCancelTimedLife                  takes unit whichUnit returns nothing

native IsUnitSelectable                     takes unit whichUnit returns boolean
native IsUnitInvulnerable                   takes unit whichUnit returns boolean


//===================
// Special effect
//===================

    // Appearance

native SetSpecialEffectColorByPlayer        takes effect whichEffect, player whichPlayer returns nothing
native SetSpecialEffectColor                takes effect whichEffect, integer r, integer g, integer b returns nothing
native SetSpecialEffectAlpha                takes effect whichEffect, integer alpha returns nothing
native SetSpecialEffectScale                takes effect whichEffect, real scale returns nothing
native SetSpecialEffectHeight               takes effect whichEffect, real height returns nothing
native SetSpecialEffectTimeScale            takes effect whichEffect, real timeScale returns nothing
native SetSpecialEffectTime                 takes effect whichEffect, real time returns nothing

    // Position

native SetSpecialEffectX                    takes effect whichEffect, real x returns nothing
native SetSpecialEffectY                    takes effect whichEffect, real y returns nothing
native SetSpecialEffectZ                    takes effect whichEffect, real z returns nothing
native SetSpecialEffectPosition             takes effect whichEffect, real x, real y, real z returns nothing
native SetSpecialEffectPositionLoc          takes effect whichEffect, location loc returns nothing

native GetLocalSpecialEffectX               takes effect whichEffect returns real
native GetLocalSpecialEffectY               takes effect whichEffect returns real
native GetLocalSpecialEffectZ               takes effect whichEffect returns real

native SetSpecialEffectOrientation          takes effect whichEffect, real yaw, real pitch, real roll returns nothing
native SetSpecialEffectYaw                  takes effect whichEffect, real yaw returns nothing
native SetSpecialEffectPitch                takes effect whichEffect, real pitch returns nothing
native SetSpecialEffectRoll                 takes effect whichEffect, real roll returns nothing

    // Playback

native PlaySpecialEffect                    takes effect whichEffect, integer anim returns nothing
native PlaySpecialEffectWithTimeScale       takes effect whichEffect, integer anim, real timeScale returns nothing


//===================
// Misc.
//===================

native SetEventDamage                       takes real damage returns nothing

native AutomationTestStart                  takes string testName returns nothing
native AutomationTestEnd                    takes string testName returns nothing

constant native IncPlayerTechResearched     takes player whichPlayer, integer techid, integer levels returns nothing
constant native DecPlayerTechResearched     takes player whichPlayer, integer techid, integer levels returns nothing


//===================
// Not yet impl.
//===================

// native GetUnitMovementType               takes unit whichUnit returns integer
// native SetUnitMovementType               takes unit whichUnit, integer movementType returns nothing
// native GetUnitArmorType                  takes unit whichUnit returns integer
// native SetHeroStatEx                     takes unit whichHero, integer whichStat, integer statValue, boolean permanent returns nothing
// native GetHeroPrimaryStat                takes unit whichHero returns integer
// native GetHeroPrimaryStatById            takes unit whichHero returns integer
// native GetHeroStat                       takes unit whichHero, integer whichStat, boolean includeBonuses returns integer
`
ОЖИДАНИЕ РЕКЛАМЫ...

Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
0
16
6 лет назад
0
pro100master, вот это поворот
4
23
6 лет назад
Отредактирован pro100master
4
Не плохо терь нет нужды создавать декорации и жрать его текстуры для замены юнита текстур (Хотя отрабатывает как декорация)
function SetWidgetTexure takes widget whichWidget, string texturePath, integer replaceableId returns boolean
    /*Models can have textures with a Replaceable ID instead of a texture path.
    The most common use of this is for team color and hero glow (Replaceable ID 1 & 2).
    While there are natives to set a units team color, that's about all that is natively supported.
    The Mountain Giant's War Club ability will change any texture on the caster that uses "Replaceable ID 32" to the texture of the targeted destructable.
     While this allows us to modify ID 32, it's not enough and has some overhead.

    If we can allow the user to change any ID, then we can switch the texture of any part of the model dynamically.
    Of course this requires models to use Replaceable ID's instead of texture paths, so many vanilla models won't have uses other than custom team colors.
    Perhaps a complete API to modify model data would be better, however this would be the easiest to implement.
    There is already an internal function capable of doing this. However it requires a destructable as one of the paramaters, but I think it should be fairly easy to find a way to not require one.
    The way I do it is by using a dummy destructable object (not handle) and switching it's texture, but there is probably a better way.*/
0
27
6 лет назад
Отредактирован MpW
0
pro100master, это то что выйдет (вышло) в патче 1.29?
0
16
6 лет назад
0
Это то, что хотят модмейкеры
И десятой части от этого не будет в этом году, релакс
0
23
6 лет назад
0
Steal nerves, нет там есть комментарии помечено что вышло в 1.29 а остальные в ожидании когда нам не ванговать!!!
0
11
6 лет назад
0
Так возможность создавать иконку баффа (CreateCustonBuff) или никто о таком даже не просит? (В принципе, по мне. ввели бы это - и я был бы счастлифф)
0
8
6 лет назад
0
orc01, баф можно повесить способностью, а вот скрыть иконку бафа было бы очень неплохо
0
11
6 лет назад
0
leroydraigo,
В том-то и суть, что для добавления простейшего баффа нужен танец с конями, дамми юнит и дамми-абилка. При этом убрать тот или иной бафф можно(не спрятать)
0
29
6 лет назад
0
Ну так проси, предлагай, пиши
2 комментария удалено
Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
Чтобы оставить комментарий, пожалуйста, войдите на сайт.