LUA 스크립트를 배우는 중(둘)

2181 단어

Player:GossipMenuAddItem( icon, msg, sender, intid )

Player:GossipMenuAddItem( icon, msg, sender, intid, code )

Player:GossipMenuAddItem( icon, msg, sender, intid, code, popup )

Player:GossipMenuAddItem( icon, msg, sender, intid, code, popup, money )

local buff = 2

local function OnHello(event, player, creature)
    player:GossipMenuAddItem(0, "Armor + 10%", buff, 23767)
    player:GossipMenuAddItem(0, "Damage + 1 - 10%", buff, 23768)
    player:GossipMenuAddItem(0, "Resistances + 25", buff, 23769)
    player:GossipMenuAddItem(0, "Agility + 10%", buff, 23736)
    player:GossipMenuAddItem(0, "Intelligence + 10%", buff, 23766)
    player:GossipMenuAddItem(0, "Spirit + 10%", buff, 23738)
    player:GossipMenuAddItem(0, "Strength + 10%", buff, 23735)
    player:GossipMenuAddItem(0, "Stamina + 10%", buff, 23737)
    player:GossipMenuAddItem(0, "Heal Me", buff, 25840)
    player:GossipSendMenu(100, creature)
end

local function OnSelect(event, player, creature, id, intid, code)
    if (id == buff) then
        player:CastSpell(player, intid, true)
    end
    OnHello(event, player, creature)
end

RegisterCreatureGossipEvent(555000, 1, OnHello)
RegisterCreatureGossipEvent(555000, 2, OnSelect)

좋은 웹페이지 즐겨찾기