shadowslayer133
08-11-09, 04:46 AM
Hello everyone,
I had been using the script on my server for dueling "The Argent Crusader"
I scripted him aswell but this is just for Dueling him. Feel Free to create your own Argent crusader but here is the lua:
function ArgentCrusader_OnSpawn(pUnit, Event)
ArgentCrusader = pUnit
end
function ArgentCrusader_On_Gossip(pUnit, event, player)
local player = pUnit:GetClosestPlayer()
pUnit:GossipCreateMenu(117, player, 0)
pUnit:GossipMenuAddItem(9, "I wish to fight against you!", 318, 0)
pUnit:GossipMenuAddItem(0, "I was looking for something else...", 434, 0)
pUnit:GossipSendMenu(player)
end
function ArgentCrusader_Gossip_Submenus(pUnit, event, player, id, intid, code)
if(intid == 318) then
pUnit:SetNPCFlags(2)
pUnit:RegisterEvent("Argent_crusader_Start", 1, 1)
local name = player:GetName()
pUnit:SendChatMessage(12, 0, "Prepare to lose "..name..". You will never win!")
player:GossipComplete()
end
if(intid == 434) then
player:GossipComplete()
end
end
function Argent_crusader_Start(pUnit, Event)
pUnit:RegisterEvent("ArgentCrusader_Countdown1", 1000, 1)
pUnit:RegisterEvent("ArgentCrusader_Countdown2", 2000, 1)
pUnit:RegisterEvent("ArgentCrusader_Countdown3", 3000, 1)
pUnit:RegisterEvent("ArgentCrusader_Flags", 4000, 1)
end
function ArgentCrusader_Countdown1(pUnit, Event, player)
local player = pUnit:GetClosestPlayer()
player:SendBroadcastMessage("Duel starts in 3...")
end
function ArgentCrusader_Countdown2(pUnit, Event, player)
local player = pUnit:GetClosestPlayer()
player:SendBroadcastMessage("Duel starts in 2...")
end
function ArgentCrusader_Countdown3(pUnit, Event, player)
local player = pUnit:GetClosestPlayer()
player:SendBroadcastMessage("Duel starts in 1...")
end
function ArgentCrusader_Flags(pUnit, Event)
pUnit:SetNPCFlags(2)
pUnit:SetFaction(14)
end
function ArgentCrusader_OnCombat(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("ArgentCrusader_Spell1", 1000, 1)
pUnit:RegisterEvent("ArgentCrusader_Spell2", 15600, 0)
pUnit:RegisterEvent("ArgentCrusader_End", 100, 0)
pUnit:RegisterEvent("ArgentCrusader_Check", 100, 0)
end
function ArgentCrusader_Spell1(pUnit, Event)
pUnit:CastSpell(41924)
end
function ArgentCrusader_Spell2(pUnit, Event)
pUnit:FullCastSpellOnTarget(853, pUnit:GetClosestPlayer())
end
function ArgentCrusader_OnLeave(pUnit, Event)
pUnit:RemoveEvents()
pUnit:SetCombatCapable(0)
pUnit:SetFaction(35)
pUnit:SetNPCFlags(1)
pUnit:SetHealthPct(100)
pUnit:RemoveAllAuras()
pUnit:ReturnToSpawnPoint()
end
--[[ If Player has under 20% life ]]--
function ArgentCrusader_Check(pUnit, Event)
local player = pUnit:GetClosestPlayer()
if player:GetHealthPct() < 20 then
pUnit:RemoveEvents()
pUnit:SetFaction(35)
pUnit:SetCombatCapable(1)
pUnit:SetNPCFlags(1)
pUnit:RegisterEvent("ArgentCrusader_OnWin", 500, 1)
end
end
function ArgentCrusader_OnWin(pUnit, Event)
pUnit:CastSpell(8203)
pUnit:RegisterEvent("ArgentCrusader_InvisibleRemoveWin", 500, 1)
end
function ArgentCrusader_InvisibleRemoveWin(pUnit, Event)
pUnit:RemoveAura(8203)
pUnit:RegisterEvent("ArgentCrusader_TalkWin", 500, 1)
end
function ArgentCrusader_TalkWin(pUnit, Event, player)
pUnit:SendChatMessage(12, 0, "You puny weakling, you shall never match the might of the argent crusader!")
pUnit:Emote(1, 2000)
pUnit:RegisterEvent("ArgentCrusader_Return", 1500, 1)
end
--[[ If Argent crusader has under 20% life ]]--
function ArgentCrusader_End(pUnit, Event)
local player = pUnit:GetClosestPlayer()
if pUnit:GetHealthPct() < 20 then
if player:HasQuest(897579) == true then
player:MarkQuestObjectiveAsComplete(897579, 0)
pUnit:RemoveEvents()
pUnit:SetFaction(35)
pUnit:SetNPCFlags(2)
pUnit:SetCombatCapable(1)
pUnit:RegisterEvent("ArgentCrusader_Invisible", 100, 1)
else
if player:HasQuest(897575) == true then
player:AddItem(87542, 1)
pUnit:RemoveEvents()
pUnit:SetFaction(35)
pUnit:SetNPCFlags(2)
pUnit:SetCombatCapable(1)
pUnit:RegisterEvent("ArgentCrusader_Invisible", 100, 1)
else
pUnit:RemoveEvents()
pUnit:SetFaction(35)
pUnit:SetNPCFlags(2)
pUnit:SetCombatCapable(1)
pUnit:RegisterEvent("ArgentCrusader_Invisible", 100, 1)
end
end
end
end
function ArgentCrusader_Invisible(pUnit, Event)
pUnit:CastSpell(8203)
pUnit:RegisterEvent("ArgentCrusader_InvisibleRemove", 500, 1)
end
function ArgentCrusader_InvisibleRemove(pUnit, Event)
pUnit:RemoveAura(8203)
pUnit:RegisterEvent("ArgentCrusader_Talk", 500, 1)
end
function ArgentCrusader_Talk(pUnit, Event, player)
pUnit:SendChatMessage(12, 0, "I lost! The Argent Champion! This is immpossible.")
pUnit:Emote(398, 3000)
pUnit:RegisterEvent("ArgentCrusader_Return", 4000, 1)
end
function ArgentCrusader_Return(pUnit, Event)
pUnit:SetCombatCapable(0)
pUnit:SetNPCFlags(1)
pUnit:WipeTargetList()
pUnit:RemoveAllAuras()
pUnit:ReturnToSpawnPoint()
pUnit:Despawn(3000, 5000)
end
RegisterUnitEvent(780215, 1, "ArgentCrusader_OnCombat")
RegisterUnitEvent(780215, 2, "ArgentCrusader_OnLeave")
RegisterUnitEvent(780215, 18, "ArgentCrusader_OnSpawn")
RegisterUnitGossipEvent(780215, 1, "ArgentCrusader_On_Gossip")
RegisterUnitGossipEvent(780215, 2, "ArgentCrusader_Gossip_Submenus")
INSERT INTO `creature_names` VALUES ('780215', 'Argent Crusader', 'The Crusader', '', '0', '7', '0', '0', '0', null, '28587', '0', '0', '0', '1', '1', '1', '0', '0', '0', '0', '0', '0', '0');
INSERT INTO `creature_proto` VALUES ('780215', '80', '80', '35', '200000', '300000', '547862', '1', '3', '2200', '0', '2300', '3100', '0', '0', '0', '0', '36000', '100', '70', '70', '70', '70', '70', '70', '1', '0', '0', '0', '0', '0', '0', '2.5', '8', '14', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');
Pics:
http://i284.photobucket.com/albums/ll17/shadowslayer133/WoWScrnShot_110809_044046.jpg
http://i284.photobucket.com/albums/ll17/shadowslayer133/WoWScrnShot_110809_044051.jpg
http://i284.photobucket.com/albums/ll17/shadowslayer133/WoWScrnShot_110809_044209.jpg
I had been using the script on my server for dueling "The Argent Crusader"
I scripted him aswell but this is just for Dueling him. Feel Free to create your own Argent crusader but here is the lua:
function ArgentCrusader_OnSpawn(pUnit, Event)
ArgentCrusader = pUnit
end
function ArgentCrusader_On_Gossip(pUnit, event, player)
local player = pUnit:GetClosestPlayer()
pUnit:GossipCreateMenu(117, player, 0)
pUnit:GossipMenuAddItem(9, "I wish to fight against you!", 318, 0)
pUnit:GossipMenuAddItem(0, "I was looking for something else...", 434, 0)
pUnit:GossipSendMenu(player)
end
function ArgentCrusader_Gossip_Submenus(pUnit, event, player, id, intid, code)
if(intid == 318) then
pUnit:SetNPCFlags(2)
pUnit:RegisterEvent("Argent_crusader_Start", 1, 1)
local name = player:GetName()
pUnit:SendChatMessage(12, 0, "Prepare to lose "..name..". You will never win!")
player:GossipComplete()
end
if(intid == 434) then
player:GossipComplete()
end
end
function Argent_crusader_Start(pUnit, Event)
pUnit:RegisterEvent("ArgentCrusader_Countdown1", 1000, 1)
pUnit:RegisterEvent("ArgentCrusader_Countdown2", 2000, 1)
pUnit:RegisterEvent("ArgentCrusader_Countdown3", 3000, 1)
pUnit:RegisterEvent("ArgentCrusader_Flags", 4000, 1)
end
function ArgentCrusader_Countdown1(pUnit, Event, player)
local player = pUnit:GetClosestPlayer()
player:SendBroadcastMessage("Duel starts in 3...")
end
function ArgentCrusader_Countdown2(pUnit, Event, player)
local player = pUnit:GetClosestPlayer()
player:SendBroadcastMessage("Duel starts in 2...")
end
function ArgentCrusader_Countdown3(pUnit, Event, player)
local player = pUnit:GetClosestPlayer()
player:SendBroadcastMessage("Duel starts in 1...")
end
function ArgentCrusader_Flags(pUnit, Event)
pUnit:SetNPCFlags(2)
pUnit:SetFaction(14)
end
function ArgentCrusader_OnCombat(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("ArgentCrusader_Spell1", 1000, 1)
pUnit:RegisterEvent("ArgentCrusader_Spell2", 15600, 0)
pUnit:RegisterEvent("ArgentCrusader_End", 100, 0)
pUnit:RegisterEvent("ArgentCrusader_Check", 100, 0)
end
function ArgentCrusader_Spell1(pUnit, Event)
pUnit:CastSpell(41924)
end
function ArgentCrusader_Spell2(pUnit, Event)
pUnit:FullCastSpellOnTarget(853, pUnit:GetClosestPlayer())
end
function ArgentCrusader_OnLeave(pUnit, Event)
pUnit:RemoveEvents()
pUnit:SetCombatCapable(0)
pUnit:SetFaction(35)
pUnit:SetNPCFlags(1)
pUnit:SetHealthPct(100)
pUnit:RemoveAllAuras()
pUnit:ReturnToSpawnPoint()
end
--[[ If Player has under 20% life ]]--
function ArgentCrusader_Check(pUnit, Event)
local player = pUnit:GetClosestPlayer()
if player:GetHealthPct() < 20 then
pUnit:RemoveEvents()
pUnit:SetFaction(35)
pUnit:SetCombatCapable(1)
pUnit:SetNPCFlags(1)
pUnit:RegisterEvent("ArgentCrusader_OnWin", 500, 1)
end
end
function ArgentCrusader_OnWin(pUnit, Event)
pUnit:CastSpell(8203)
pUnit:RegisterEvent("ArgentCrusader_InvisibleRemoveWin", 500, 1)
end
function ArgentCrusader_InvisibleRemoveWin(pUnit, Event)
pUnit:RemoveAura(8203)
pUnit:RegisterEvent("ArgentCrusader_TalkWin", 500, 1)
end
function ArgentCrusader_TalkWin(pUnit, Event, player)
pUnit:SendChatMessage(12, 0, "You puny weakling, you shall never match the might of the argent crusader!")
pUnit:Emote(1, 2000)
pUnit:RegisterEvent("ArgentCrusader_Return", 1500, 1)
end
--[[ If Argent crusader has under 20% life ]]--
function ArgentCrusader_End(pUnit, Event)
local player = pUnit:GetClosestPlayer()
if pUnit:GetHealthPct() < 20 then
if player:HasQuest(897579) == true then
player:MarkQuestObjectiveAsComplete(897579, 0)
pUnit:RemoveEvents()
pUnit:SetFaction(35)
pUnit:SetNPCFlags(2)
pUnit:SetCombatCapable(1)
pUnit:RegisterEvent("ArgentCrusader_Invisible", 100, 1)
else
if player:HasQuest(897575) == true then
player:AddItem(87542, 1)
pUnit:RemoveEvents()
pUnit:SetFaction(35)
pUnit:SetNPCFlags(2)
pUnit:SetCombatCapable(1)
pUnit:RegisterEvent("ArgentCrusader_Invisible", 100, 1)
else
pUnit:RemoveEvents()
pUnit:SetFaction(35)
pUnit:SetNPCFlags(2)
pUnit:SetCombatCapable(1)
pUnit:RegisterEvent("ArgentCrusader_Invisible", 100, 1)
end
end
end
end
function ArgentCrusader_Invisible(pUnit, Event)
pUnit:CastSpell(8203)
pUnit:RegisterEvent("ArgentCrusader_InvisibleRemove", 500, 1)
end
function ArgentCrusader_InvisibleRemove(pUnit, Event)
pUnit:RemoveAura(8203)
pUnit:RegisterEvent("ArgentCrusader_Talk", 500, 1)
end
function ArgentCrusader_Talk(pUnit, Event, player)
pUnit:SendChatMessage(12, 0, "I lost! The Argent Champion! This is immpossible.")
pUnit:Emote(398, 3000)
pUnit:RegisterEvent("ArgentCrusader_Return", 4000, 1)
end
function ArgentCrusader_Return(pUnit, Event)
pUnit:SetCombatCapable(0)
pUnit:SetNPCFlags(1)
pUnit:WipeTargetList()
pUnit:RemoveAllAuras()
pUnit:ReturnToSpawnPoint()
pUnit:Despawn(3000, 5000)
end
RegisterUnitEvent(780215, 1, "ArgentCrusader_OnCombat")
RegisterUnitEvent(780215, 2, "ArgentCrusader_OnLeave")
RegisterUnitEvent(780215, 18, "ArgentCrusader_OnSpawn")
RegisterUnitGossipEvent(780215, 1, "ArgentCrusader_On_Gossip")
RegisterUnitGossipEvent(780215, 2, "ArgentCrusader_Gossip_Submenus")
INSERT INTO `creature_names` VALUES ('780215', 'Argent Crusader', 'The Crusader', '', '0', '7', '0', '0', '0', null, '28587', '0', '0', '0', '1', '1', '1', '0', '0', '0', '0', '0', '0', '0');
INSERT INTO `creature_proto` VALUES ('780215', '80', '80', '35', '200000', '300000', '547862', '1', '3', '2200', '0', '2300', '3100', '0', '0', '0', '0', '36000', '100', '70', '70', '70', '70', '70', '70', '1', '0', '0', '0', '0', '0', '0', '2.5', '8', '14', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');
Pics:
http://i284.photobucket.com/albums/ll17/shadowslayer133/WoWScrnShot_110809_044046.jpg
http://i284.photobucket.com/albums/ll17/shadowslayer133/WoWScrnShot_110809_044051.jpg
http://i284.photobucket.com/albums/ll17/shadowslayer133/WoWScrnShot_110809_044209.jpg