三、神圣干涉和保护祝福 a、神圣干涉 /施放 神圣干涉 /script TargetUnit("player") /script if ( UnitName("target") ~=nil and UnitInParty("player","target") ) then SendChatMessage("<圣光与我同在……神圣干涉 %T >", "PARTY"); end 在神圣干涉时说话!“圣光与我同在……神圣干涉”可以设置成任何你想说的话 b、保护祝福 说明:有时候要让法师去暴怪,为了保护法师所以给法师加上10秒的物理无敌并提醒他。 /施放 保护祝福 /script TargetUnit("player") /script if ( UnitName("target") ~=nil and UnitInParty("player","target") ) then SendChatMessage("<你被圣光保护中,10秒内物理攻击免疫! %T >", "PARTY"); end 注:可以把文中的"PARTY"换为: 1、"EMOTE",则以自定义表情的方式发出信息。则别人在聊天窗口中看到:"某某将在X秒内……神圣干涉某某" 2、“say”是周围的玩家说话。 3、“yell”喊话
四、智能加血 a、宏说明:如小于200则不使用治疗,并在聊天窗口中提示:"目标正常",如消耗两大于200小于400,使用3级的圣光术治疗,如大于400,则使用5级的圣光术进行治疗。(治疗等级可以自己改) /script x="player";d=UnitHealthMax(x)-UnitHealth(x);if (d>200) then if (d<400)then CastSpellByName("圣光术(等级 3)") else CastSpellByName("圣光术(等级 5)") end;SpellTargetUnit(x);else DEFAULT_CHAT_FRAME:AddMessage("目标正常"); end; b、根据自己当前MANA来消耗量进行判断(引用 作者:aprillight )MACRO 11 "圣光" Spell_Holy_HolyBolt.blp /script p="player";m=UnitMana(p);if m>580 then r=8;else if m>465 then r=7;else if m>365 then r=6;else if m>275 then r=5;end;end;end;end;CastSpellByName("圣光术(等级 "..r..")");if ( not UnitIsFriend(p,"target") ) then TargetUnit(p);end; END
七、按目标的职业分别使用不同魔法 下面是圣骑士的一例。如果目标职业为盗贼或战士则使用力量祝福,否则使用智慧祝福。 /script class = UnitClass("target"); if ( ( class == "盗贼" ) or ( class == "战士" ) ) then CastSpellByName("力量祝福(等级 1)"); else CastSpellByName("智慧祝福(等级 1)"); end