- Joined
- Jul 24, 2008
- Messages
- 19
I hope this is the right forum to post but I was curious as to how accurate this is, given it was generated by AI
I gave ChatGPT the prompt: "Can you write me a code in warcraft 3 jass for an ability that allows the caster to throw a grenade then teleport to where it lands, dealing damage in an area of effect?"
And this is what it gave me
As someone who has only used GUI, can anyone confirm if this is useable? Of course, given that needed variables need to be created. If so, this is really impressive
I gave ChatGPT the prompt: "Can you write me a code in warcraft 3 jass for an ability that allows the caster to throw a grenade then teleport to where it lands, dealing damage in an area of effect?"
And this is what it gave me
JASS:
function AbilityExample takes nothing returns nothing
local unit caster = GetCaster()
local real x = GetX(caster)
local real y = GetY(caster)
local real z = GetZ(caster)
local unit grenade = CreateUnit(caster, 'n001', x, y, z)
local real speed = 10
local real angle = 45
local real distance = 100
local real dx = distance * Cos(angle)
local real dy = distance * Sin(angle)
local real dz = 0
local location target = Location(x + dx, y + dy, z + dz)
local location impact = AddLocation(target, Location(0, 0, speed * TimerDt()))
SetUnitX(grenade, GetX(impact))
SetUnitY(grenade, GetY(impact))
SetUnitZ(grenade, GetZ(impact))
local group enemies = GetUnitsInRangeOfLocAll(200, impact)
local unit u
for u in enemies do
UnitDamageTarget(caster, u, 50, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
end
SetUnitX(caster, GetX(impact))
SetUnitY(caster, GetY(impact))
SetUnitZ(caster, GetZ(impact))
endfunction
As someone who has only used GUI, can anyone confirm if this is useable? Of course, given that needed variables need to be created. If so, this is really impressive
Last edited: