local npcId = 80007local UNIT_STAND_STATE_SLEEP = 3local UNIT_STAND_STATE_KNEEL = 8local function OnMoveInLOS(event, creature, unit) math.randomseed(os.time()) local val = math.random(1, 7) local player = unit if(val == 1) then -- Crusader Camp along the Southern Road player:Teleport(0, 1096.68, -1295.55, 61.3, 2.8) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 2) then -- Anchors Hilt Camp player:Teleport(0, 1148.8, -2048.57, 65, 3.6) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 3) then -- Hearthglen Gates player:Teleport(0, 2700.74, -1645.38, 132.98, 2.126) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 4) then -- Halsingar Chapel player:Teleport(0, 1865.85, -1312.4, 62.95, 0.838) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 5) then -- Farm player:Teleport(0, 2558.0, -1811.38, 34.32, 2.12) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 6) then -- Pramus P0int player:Teleport(0, 1811.87, -2467.54, 73.15, 5.23) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 7) -- Emberstone Chapel player:Teleport(0, 1258.574951, -2398.602295, 61.590820, 6.095099) player:SetStandState(UNIT_STAND_STATE_KNEEL) endendRegisterCreatureEvent(npcId, 27, OnMoveInLOS)
I personally, wish you will get SharpNoggit to work, cause no one else is interested in fixing Noggit3...
Just a question. Why are you not using SmartAI for such matters? Core scripts are better, cleaner, easier?
Invisible npc's is really not the most efficient means. Instead use an area trigger. If you don't have access to this because you are not using client edits, check what zone the player is in, if the zone is your zone you do not want them in, teleport them out.
local triggerIDs = {1, 2, 3, 4, 5} -- Example Area Trigger IDs from AreaTrigger.dbcfunction OnAreaTrigger(event, player, triggerId) -- Iterate through triggerIDs to see if trigger matches an accepted trigger. for i = 0, #triggerIDs do if(triggerIDs[i] == triggerId) then if(player:IsGM() == false) then math.randomseed(os.time()) local val = math.random(1, 7) if(val == 1) then -- Crusader Camp along the Southern Road player:Teleport(0, 1096.68, -1295.55, 61.3, 2.8) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 2) then -- Anchors Hilt Camp player:Teleport(0, 1148.8, -2048.57, 65, 3.6) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 3) then -- Hearthglen Gates player:Teleport(0, 2700.74, -1645.38, 132.98, 2.126) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 4) then -- Halsingar Chapel player:Teleport(0, 1865.85, -1312.4, 62.95, 0.838) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 5) then -- Farm player:Teleport(0, 2558.0, -1811.38, 34.32, 2.12) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 6) then -- Pramus P0int player:Teleport(0, 1811.87, -2467.54, 73.15, 5.23) player:SetStandState(UNIT_STAND_STATE_SLEEP) elseif(val == 7) -- Emberstone Chapel player:Teleport(0, 1258.574951, -2398.602295, 61.590820, 6.095099) player:SetStandState(UNIT_STAND_STATE_KNEEL) end end end endendRegisterServerEvent(24, OnAreaTrigger)
Randomness? Well, I would try to create teleport actions triggered by time. In 1st second it teleports to zone X, in 2nd second to zone Y... yep, its not perfect, but it would probably work. But if you want to just practice, its your decision. I just know a few guys who tend to do everything, even spell stats, via core and then they are really "surprised" that their core is one huge mess, suddenly erroring on some little glitch.
Messing around with the new blood elf textures on the old models.Edit:Female is kinda eh.Just the face UV's are so plain it's annoying.
local npcId = 80139local function OnGossipHello(event, player, creature) if(player:GetGender() == 0) then -- Male = 0, Female = 1 creature:SendUnitSay("Welcome to the Andorhal Guild Registry office. What can I help you with today, Sir?", 7) elseif(player:GetGender() == 1) then creature:SendUnitSay("Welcome to the Andorhal Guild Registry office. What can I help you with today, Miss?", 7) end if(player:IsInGuild() == true) then -- If the player is already in a guild, then show this menu. creature:SendUnitEmote("After asking your name, Eliza quickly flips through a large tome on the counter.") player:GossipMenuAddItem(0, "I have a few questions about guild registration.", 80038, 3) player:GossipMenuAddItem(0, "Alright, thank you.", 80038, 6) player:GossipSendMenu(80038, creature, MenuId) else -- If the player isn't already in a guild, then show this menu. local hasApplication = WorldDBQuery("SELECT COUNT(DISTINCT playerAccountId) FROM characters.guild_registration_application WHERE playerAccountID = " .. player:GetAccountId() .. ";"):GetString(0) player:GossipClearMenu() if(tonumber(hasApplication) == 0) then -- Default Menu, if player has no pending application. player:GossipMenuAddItem(0, "I'd like to register a guild.", 80028, 2) player:GossipMenuAddItem(0, "I have a few questions about guild registration.", 80028, 3) player:GossipSendMenu(80028, creature, MenuId) elseif(tonumber(hasApplication) == 1) then -- Status Menu, if player has a pending application. local applicationStatus = WorldDBQuery("SELECT registrationAcceptanceState FROM characters.guild_registration_application WHERE playerAccountID = " .. player:GetAccountId() .. ";"):GetString(0) if(tonumber(applicationStatus) == 1) then -- If accepted local guildName = WorldDBQuery("SELECT guildName FROM characters.guild_registration_application WHERE playerAccountID = " .. player:GetAccountId() .. " AND guildName NOT LIKE 'blank';"):GetString(0) creature:SendUnitSay("Your application has been accepted. Expect "" .. guildName .."" to be formed within the next day.", 7) player:GossipMenuAddItem(0, "Alright, thank you.", 80033, 6) player:GossipSendMenu(80033, creature, MenuId) elseif(tonumber(applicationStatus) == 0) then -- If not yet accepted creature:SendUnitSay("Your application hasn't been reviewed yet. The council only has time to review the applications for a short time each day. If you come back tomorrow it may have been reviewed.", 7) player:GossipMenuAddItem(0, "Alright, thank you.", 80034, 6) player:GossipSendMenu(80034, creature, MenuId) elseif(tonumber(applicationStatus) == 2) then -- If rejected local rejectionComment = WorldDBQuery("SELECT rejectionReason FROM characters.guild_registration_rejection_reasons WHERE id = (SELECT rejectionReason FROM characters.guild_registration_application WHERE playerAccountID = " .. player:GetAccountId() .. ");"):GetString(0) creature:SendUnitSay(rejectionComment, 7) player:GossipMenuAddItem(0, "Alright, thank you.", 80035, 6) player:GossipSendMenu(80035, creature, MenuId) end end endendlocal function OnGossipSelect(event, player, creature, sender, intid, code) if(intid == 1) then if(player:IsInGuild() == true) then creature:SendUnitEmote("After asking your name, Eliza quickly flips through a large tome on the counter.") player:GossipMenuAddItem(0, "I have a few questions about guild registration.", 80038, 3) player:GossipMenuAddItem(0, "Alright, thank you.", 80038, 6) player:GossipSendMenu(80038, creature, MenuId) else local hasApplication = WorldDBQuery("SELECT COUNT(DISTINCT playerAccountId) FROM characters.guild_registration_application WHERE playerAccountID = " .. player:GetAccountId() .. ";"):GetString(0) player:GossipClearMenu() if(tonumber(hasApplication) == 0) then -- Default Menu, if player has no pending application. player:GossipMenuAddItem(0, "I'd like to register a guild.", 80028, 2) player:GossipMenuAddItem(0, "I have a few questions about guild registration.", 80028, 3) player:GossipSendMenu(80028, creature, MenuId) elseif(tonumber(hasApplication) == 1) then -- Status Menu, if player has a pending application. local applicationStatus = WorldDBQuery("SELECT registrationAcceptanceState FROM characters.guild_registration_application WHERE playerAccountID = " .. player:GetAccountId() .. ";"):GetString(0) if(tonumber(applicationStatus) == 1) then -- If accepted local guildName = WorldDBQuery("SELECT guildName FROM characters.guild_registration_application WHERE playerAccountID = " .. player:GetAccountId() .. " AND guildName NOT LIKE 'blank';"):GetString(0) creature:SendUnitSay("Your application has been accepted. Expect "" .. guildName .."" to be formed within the next day.", 7) player:GossipMenuAddItem(0, "Alright, thank you.", 80033, 6) player:GossipSendMenu(80033, creature, MenuId) elseif(tonumber(applicationStatus) == 0) then -- If not yet accepted creature:SendUnitSay("Your application hasn't been reviewed yet. The council only has time to review the applications for a short time each day. If you come back tomorrow it may have been reviewed.", 7) player:GossipMenuAddItem(0, "Alright, thank you.", 80034, 6) player:GossipSendMenu(80034, creature, MenuId) elseif(tonumber(applicationStatus) == 2) then -- If rejected local rejectionComment = WorldDBQuery("SELECT rejectionReason FROM characters.guild_registration_rejection_reasons WHERE id = (SELECT rejectionReason FROM characters.guild_registration_application WHERE playerAccountID = " .. player:GetAccountId() .. ");"):GetString(0) creature:SendUnitSay(rejectionComment, 7) player:GossipMenuAddItem(0, "Alright, thank you.", 80035, 6) player:GossipSendMenu(80035, creature, MenuId) end end end elseif(intid == 2) then -- Registration -- Local variable declarations local playerAccountID = player:GetAccountId(); -- Find out whether or not the current user has previously entered a guild name and/or description. local guildName = WorldDBQuery("SELECT COUNT(guildName) FROM characters.guild_registration_application WHERE playerAccountID = " .. playerAccountID .. " AND guildName NOT LIKE 'blank';"):GetString(0) local guildDescription = WorldDBQuery("SELECT COUNT(guildDescription) FROM characters.guild_registration_application WHERE playerAccountID = " .. playerAccountID .. " AND guildDescription NOT LIKE 'blank';"):GetString(0) player:GossipClearMenu() if(tonumber(guildName) ~= 0) then guildName = WorldDBQuery("SELECT guildName FROM characters.guild_registration_application WHERE playerAccountID = " .. playerAccountID .. ";"):GetString(0) player:GossipMenuAddItem(0, "Your guild name has been filled out as " .. guildName .. ", you may change it if you wish.", 80030, 7, true, "Please enter your guild name. (Max 24 characters)", 0) else player:GossipMenuAddItem(0, "Your guild name has not been filled out. Would you like to enter it?", 80030, 7, true, "Please enter your guild name. (Max 24 characters)", 0) end if(tonumber(guildDescription) ~= 0) then player:GossipMenuAddItem(0, "Your guild description has been filled out. You may change it if you wish.", 80030, 8, true, "Please enter your guild description. (Max 2048 characters)", 0) else player:GossipMenuAddItem(0, "Your guild description has not been filled out. Would you like to enter it?", 80030, 8, true, "Please enter your guild description. (Max 2048 characters)", 0) end player:GossipMenuAddItem(0, "I'm finished the application, I'd like to submit it now.", 80030, 9, false, "Do you accept the charge for registration?", 1000000) player:GossipSendMenu(80030, creature, MenuId) elseif(intid == 3) then -- Help Menu player:GossipClearMenu() player:GossipMenuAddItem(0, "How does the registration process work?", 80029, 4) player:GossipMenuAddItem(0, "What are the benefits of a guild?", 80029, 5) player:GossipMenuAddItem(0, "Nevermind.", 80029, 6) player:GossipSendMenu(80029, creature, MenuId) elseif(intid == 4) then -- Help Menu, Option #1 player:GossipClearMenu() player:GossipMenuAddItem(0, "I'd like to ask another question.", 80031, 3) if(player:IsInGuild() == false) then player:GossipMenuAddItem(0, "I'd like to register a guild now.", 80031, 2) end player:GossipMenuAddItem(0, "Nevermind.", 80031, 6) player:GossipSendMenu(80031, creature, MenuId) elseif(intid == 5) then -- Help Menu, Option #2 player:GossipClearMenu() player:GossipMenuAddItem(0, "I'd like to ask another question.", 80032, 3) if(player:IsInGuild() == false) then player:GossipMenuAddItem(0, "I'd like to register a guild now.", 80032, 2) end player:GossipMenuAddItem(0, "Nevermind.", 80032, 6) player:GossipSendMenu(80032, creature, MenuId) elseif(intid == 6) then player:GossipComplete() elseif(intid == 7) then -- Guild Name Updated WorldDBQuery("INSERT INTO characters.guild_registration_application(playerAccountID, guildName) VALUES(" .. player:GetAccountId() .. ","" .. code .. "") ON DUPLICATE KEY UPDATE guildName=VALUES(guildName);") player:GossipClearMenu() player:SendUnitSay("Guild Name Written Menu Missing", 7) player:GossipMenuAddItem(0, "Return", 80036, 2) player:GossipSendMenu(80036, creature, MenuId) elseif(intid == 8) then -- Guild Name Updated WorldDBQuery("INSERT INTO characters.guild_registration_application(playerAccountID, guildDescription) VALUES(" .. player:GetAccountId() .. ","" .. code .. "") ON DUPLICATE KEY UPDATE guildDescription=VALUES(guildDescription);") player:GossipClearMenu() player:SendUnitSay("Guild Description Written Menu Missing", 7) player:GossipMenuAddItem(0, "Return", 80037, 2) player:GossipSendMenu(80037, creature, MenuId) elseif(intid == 9) then -- Application Submit WorldDBQuery("INSERT INTO characters.guild_registration_application(playerAccountID, isUnfinishedApplication) VALUES(" .. player:GetAccountId() .. ", 0) ON DUPLICATE KEY UPDATE isUnfinishedApplication=VALUES(isUnfinishedApplication);") player:ModifyMoney(-1000000) player:GossipComplete() creature:SendUnitSay("Your application has been accepted. Please check back later today or tomorrow for word on the applications status.", 7) elseif(intid == 10) then -- Application Rejected player:ModifyMoney(750000) player:GossipComplete() WorldDBQuery("DELETE FROM characters.guild_registration_application WHERE playerAccountID = " .. playerAccountID .. ";") endendRegisterCreatureGossipEvent(npcId, 1, OnGossipHello)RegisterCreatureGossipEvent(npcId, 2, OnGossipSelect)
Good news: Cromon started to develope a new map editor and i'm helping him.