Code:
--===================================================================================================
--====== Define the npc id ==========================================================================
--===================================================================================================
local RedeemNpc = 999885
--===================================================================================================
--= Option is what to display on the gossip when you talk to the npc ================================
--= Code is the code you need to type in to get the item ==========================================
--= Item is the item you get when you get the code correct ========================================
--= Amount is the amount of that item to get, so maybe 5 beers for example? =========================
--===================================================================================================
local Option1 = "Test Function"
local Code1 = "Test"
local Item1 = 11846
local Amount1 = 5
local Option2 = "I want a pet frog please."
local Code2 = "Frog"
local Item2 = 11027
local Amount2 = 1
local Option3 = "I GAMEMASTER (noob) GIEF ARTIFACT"
local Code3 = "E39GFA11KC37"
local Item3 = 192
local Amount3 = 1
local Option4 = "May I have a Swift Spectral Tiger?"
local Code4 = "Spectral Ownage"
local Item4 = 33225
local Amount4 = 1
local Option5 = "Food... NOW!"
local Code5 = "Food is Nice"
local Item5 = 12202
local Amount5 = 20
--===================================================================================================
--====== The Script it's self =======================================================================
--===================================================================================================
function Redeem_OnGossipTalk(pUnit, event, player, pMisc)
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("Please leave combat first.")
player:SendBroadcastMessage("Please leave combat first.")
pUnit:GossipComplete(player)
else
pUnit:GossipCreateMenu(44, player, 0)
pUnit:GossipMenuAddItem(30, Option1, 10, 1)
pUnit:GossipMenuAddItem(30, Option2, 9, 1)
pUnit:GossipMenuAddItem(30, Option3, 8, 1)
pUnit:GossipMenuAddItem(30, Option4, 7, 1)
pUnit:GossipMenuAddItem(30, Option5, 6, 1)
pUnit:GossipMenuAddItem(30, "Exit", 11, 0)
pUnit:GossipSendMenu(player)
end
end
function Redeem_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
if (intid == 10) then
if code == Code1 then
player:SendBroadcastMessage("Correct Code.")
player:AddItem(Item1, Amount1)
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
else
player:SendBroadcastMessage("Invalid Code.")
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
end
end
if (intid == 9) then
if code == Code2 then
player:SendBroadcastMessage("Correct Code.")
player:AddItem(Item2, Amount2)
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
else
player:SendBroadcastMessage("Invalid Code.")
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
end
end
if (intid == 8) then
if code == Code3 then
player:SendBroadcastMessage("Correct Code.")
player:AddItem(Item3, Amount3)
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
else
player:SendBroadcastMessage("Invalid Code.")
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
end
end
if (intid == 7) then
if code == Code4 then
player:SendBroadcastMessage("Correct Code.")
player:AddItem(Item4, Amount4)
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
else
player:SendBroadcastMessage("Invalid Code.")
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
end
end
if (intid == 6) then
if code == Code5 then
player:SendBroadcastMessage("Correct Code.")
player:AddItem(Item5, Amount5)
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
else
player:SendBroadcastMessage("Invalid Code.")
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
end
end
if (intid == 11) then
pUnit:GossipComplete(player)
pUnit:FullCastSpellOnTarget(16716, player)
end
end
RegisterUnitGossipEvent(RedeemNpc, 1, "Redeem_OnGossipTalk")
RegisterUnitGossipEvent(RedeemNpc, 2, "Redeem_OnGossipSelect")
--===================================================================================================
--====== A logo to annoy people :) People seem to be using this since I have...======================
--===================================================================================================
print(" - ")
print(" Lua script made by stoneharry ")
print(" Have fun ")
print(" Report bugs to mmowned.com ")
print(" - ")
--===================================================================================================
--====== The end, good luck! ========================================================================
--===================================================================================================
Code:
insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`) values('999885','The Salamanda','Redeemer','','0','0','0','3','0',NULL,'24052','0','0','0','1','1',NULL,NULL);
insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`) values('999885','75','75','35','10000','100000','0','1','1','1000','0','500','1387','0','0','0','0','360000','2575','0','0','0','0','0','0','1','0','0','0','852','0','0','2.5','8','14','0','0','0','0','0','0','0');