Julio 21 Report post Posted October 17, 2017 (edited) I want to open npc in / vip and / tele plus a blank popup can someone help me fix it my chat handle lua print("Loading Chat Handler") ----------------------- -- Function -- ----------------------- --Commands CMD_HANDLER_VIP = {} CMD_HANDLER_NORMAL = {} CMD_HANDLER_GM = {} --Eudaemon pages EUDAEMON_CMDS = 1 EUDAEMON_CMDS2 = 2 EUDAEMON_TELEPORT = 3 EUDAEMON_TELEPORT_FANTASY = 4 EUDAEMON_TELEPORT_ARGENT = 5 EUDAEMON_TELEPORT_SHAITAN = 6 EUDAEMON_TELEPORT_ICICLE = 7 EUDAEMON_HELP = 8 EUDAEMON_NOCOIN = 9 EUDAEMON_HELP1 = 10 EUDAEMON_HELP2 = 11 -- Main chat handling function function HandleChat(role, message) if (string.find(message, "/") == 1) then local command = string.sub(message, 2) if (command == "") then SystemNotice(role, "Unknown command! Type /cmds to see a list of commands.") return 0 end local param = {n = 0} params = string.find(command, " ") if (params == nil) then cmd = string.lower(command) else cmd = string.lower(explode(" ", command)[0]) params = string.sub(command, params + 1) param = explode(",", params) param.n = table.getn(param) end if (CMD_HANDLER_NORMAL[cmd] ~= nil) then CMD_HANDLER_NORMAL[cmd](role, param) return 0 end if (GetGmLv(role) == 99) then if (CMD_HANDLER_GM[cmd] ~= nil) then CMD_HANDLER_GM[cmd](role, param) return 0 end end --------- /vip proibido em prision islnad --[[ local map_name = GetChaMapName ( role ) if map_name == "prisonisland" then SystemNotice ( role , "Prohibited Location for this command!" ) UseItemFailed ( role ) return end]]-- --------- /vip proibido em prision islnad if(IsVip(role) == 0) then SystemNotice(role, "You don't have permission to use this feature and stop spamming or you will be banned.") return 0 end if (CMD_HANDLER_VIP[cmd] ~= nil) then CMD_HANDLER_VIP[cmd](role, param) return 0 end SystemNotice(role, "Unknown command! Type /cmds to see a list of commands.") return 0 end Value = QnA.Chat(role, message) return 1 end function trim(s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end function explode(separator, str) local pos, i, arr = 0, 0, {} for st, sp in function() return string.find(str, separator, pos, true) end do table.insert(arr, i, trim(string.sub(str, pos, st-1))) pos = sp + 1 i = i + 1 end table.insert(arr, i, trim(string.sub(str, pos))) return arr end function ShowWindow(role, page) local ret, npc = GetEudemon() local ret, id = GetScriptID(npc) JumpPage(role, npc, NpcInfoList[id].page, page) end function ShowTrade(role) local ret, npc = GetEudemon() local ret, id = GetScriptID(npc) BuyPage(role, npc, NpcInfoList[id].trade) end function ShowText(role, text) local packet = GetPacket(); WriteCmd(packet, CMD_MC_TALKPAGE); WriteDword(packet, -1) WriteByte(packet, -1) WriteString(packet, text) SendPacket(role, packet); end -- User defined commands CMD_HANDLER_VIP["vip"] = function(role, param) --------- /vip proibido em prision islnad local map_name = GetChaMapName ( role ) if map_name == "prisonisland" or map_name == "garner2" or map_name == "PKmap" or map_name == "coloseum" or map_name == "teampk" then SystemNotice ( role , "Prohibited Location for this command!" ) UseItemFailed ( role ) return end --------- /vip proibido em prision islnad if (param.n == 0) then ShowWindow(role, EUDAEMON_CMDS) end end CMD_HANDLER_NORMAL["help"] = function(role, param) ShowWindow(role, EUDAEMON_HELP) end CMD_HANDLER_NORMAL["time"] = function(role, param) local Hour = os.date("%I") local Minute = os.date("%M") local Second = os.date("%p") local Day = os.date("%d") local Month = os.date("%b") local Year = os.date("%Y") local DD = os.date("%A") SystemNotice(role, "--------- Server Status ---------- ") SystemNotice ( role, "Server Time: "..Hour..":"..Minute..":"..Second.." ") SystemNotice ( role, "Server Date: "..Month..":"..Day..":"..Year.." "..DD.."") SystemNotice (role, "---------------------------------- ") end CMD_HANDLER_NORMAL["bank"] = function(role, param) OpenBank(role, role) end CMD_HANDLER_NORMAL["cmds"] = function(role, param) HelpInfo(role, 0, "Command List:_/time - Server Time_/bank - Open Bank") end CMD_HANDLER_VIP["buff"] = function(role, param) FullBuffs(role) end CMD_HANDLER_VIP["shop"] = function(role, param) ShowTrade(role) end CMD_HANDLER_VIP["tele"] = function(role, param) --------- /vip proibido em prision islnad local map_name = GetChaMapName ( role ) if map_name == "prisonisland" or map_name == "garner2" or map_name == "PKmap" or map_name == "coloseum" or map_name == "teampk" then SystemNotice ( role , "Prohibited Location for this command!" ) UseItemFailed ( role ) return end --------- /vip proibido em prision islnad if (param.n ~= 1) then ShowWindow(role, EUDAEMON_TELEPORT) return end end CMD_HANDLER_VIP["bank"] = function(role, param) OpenBank(role, role) end CMD_HANDLER_VIP["forge"] = function(role, param) OpenForge(role, role) end CMD_HANDLER_VIP["socket"] = function(role, param) OpenMilling(role, role) end CMD_HANDLER_VIP["fusion"] = function(role, param) OpenFusion(role, role) end CMD_HANDLER_VIP["appupgrade"] = function(role, param) OpenUpgrade(role, role) end CMD_HANDLER_VIP["combine"] = function(role, param) OpenUnite(role, role) end CMD_HANDLER_VIP["extract"] = function(role, param) OpenGetStone(role, role) end CMD_HANDLER_VIP["setupgrade"] = function(role, param) OpenItemTiChun(role, role) end -- GM commands CMD_HANDLER_GM["forgep"] = function(role, param) local item = GetChaItem(role, 2, param[0]) local itemParam = GetItemForgeParam(item, 1) print(itemParam) end CMD_HANDLER_GM["forgeps"] = function(role, param) local item = GetChaItem(role, 2, param[0]) SetItemForgeParam(item, 1, param[1]) end CMD_HANDLER_GM["eff"] = function(role, param) PlayEffect(role, param[0]) end CMD_HANDLER_GM["effl"] = function(role, param) print(GetChaStateLv(role, param[0])) end CMD_HANDLER_GM["effad"] = function(role, param) AddState(role, role, param[0], param[1], 3600) end CMD_HANDLER_GM["effre"] = function(role, param) RemoveState(role, param[0]) end CMD_HANDLER_GM["removebuff"] = function(role, param) local statelv = 1 local statetime = 3600 RemoveState(role, GMACC) end CMD_HANDLER_GM["summon"] = function(role, param) local x, y = GetChaPos(role) local monster = CreateChaX(param[0], x, y, 145, 3700, role) SetChaLifeTime(monster, param[1]) SetChaAIType(monster, param[2]) end CMD_HANDLER_GM["itemattr"] = function(role, param) if (param.n == 2) then local item = GetChaItem(role, 2, param[0]) print(item) local attr = GetItemAttr(item, param[1]) print(attr) SystemNotice(role, attr) elseif (param.n == 3) then local item = GetChaItem(role, 2, param[0]) SetItemAttr(item, param[1], param[2]) else SystemNotice(role, "Error") end end CMD_HANDLER_GM["fusion2"] = function(role, param) local apparel = GetChaItem(role, 2, param[0]) local equipment = GetChaItem(role, 2, param[1]) local equipmentID = GetItemID(equipment) SetItemAttr(apparel, ITEMATTR_VAL_FUSIONID, equipmentID) FusionItem(apparel, equipment) end CMD_HANDLER_GM["attr"] = function(role, param) local attr = GetChaAttr(role, param[0]) SystemNotice(role, attr) end CMD_HANDLER_GM["getido"] = function(role, param) local cha = GetChaPlayer(role) local id = GetPlayerID(cha) print(id) end ----------------------- -- Eudemon -- ----------------------- function Eudemon() InitTrade() Weapon( 3342 ) Weapon( 3105 ) Weapon( 850 ) Weapon( 851 ) Weapon( 852 ) Weapon( 1138 ) Weapon( 1146 ) Weapon( 1147 ) Weapon( 1148 ) Weapon( 1149 ) Weapon( 893 ) Weapon( 894 ) Weapon( 895 ) Weapon( 896 ) Weapon( 897 ) Weapon( 1139 ) Weapon( 1140 ) Weapon( 1141 ) Weapon( 1142 ) Weapon( 1143 ) Weapon( 1144 ) Weapon( 1150 ) Weapon( 1151 ) Weapon( 2673 ) Weapon( 2674 ) Weapon( 2675 ) Weapon( 2676 ) Weapon( 2677 ) Weapon( 2678 ) Weapon( 1083 ) Defence( 886 ) Defence( 453 ) Defence( 455 ) Defence( 3074 ) Defence( 3075 ) Defence( 891 ) Defence( 454 ) Defence( 890 ) Defence( 456 ) Defence( 3883 ) Defence( 3884 ) Defence( 1020 ) InitTrigger() TriggerAction(1, OpenBank) Text(EUDAEMON_CMDS, "Command list:", JumpPage, EUDAEMON_CMDS) Text(EUDAEMON_CMDS, "Help", JumpPage, EUDAEMON_HELP) Text(EUDAEMON_CMDS, "Teleport", JumpPage, EUDAEMON_TELEPORT) Text(EUDAEMON_CMDS, "Bank", MultiTrigger, GetMultiTrigger(),1) Text(EUDAEMON_CMDS, "Trade", BuyPage) Text(EUDAEMON_CMDS, "Gem Combine", OpenUnite) Text(EUDAEMON_CMDS, "Forge", OpenForge) Text(EUDAEMON_CMDS, "Next ->", JumpPage, EUDAEMON_CMDS2) Text(EUDAEMON_CMDS2, "Socket", OpenMilling) Text(EUDAEMON_CMDS2, "Apparel Fusion", OpenFusion) Text(EUDAEMON_CMDS2, "Extract Gem", OpenGetStone) Text(EUDAEMON_CMDS2, "Apparel Upgrade", OpenUpgrade) Text(EUDAEMON_CMDS2, "Special Upgrade", OpenItemTiChun) --Text(EUDAEMON_CMDS2, "Buffs", FullBuffs) Text(EUDAEMON_CMDS2, "Back <-", JumpPage, EUDAEMON_CMDS) Talk(EUDAEMON_HELP, "Command List:_/time - Server Time_/bank - Open Bank") --Talk(EUDAEMON_HELP, "Newbie's Handbook") --Text(EUDAEMON_HELP, "How to start as a newbie?", JumpPage, 16) --Text(EUDAEMON_HELP, "Where i can get stuffs?", JumpPage, EUDAEMON_HELP1) --Text(EUDAEMON_HELP, "Other Questions", JumpPage, EUDAEMON_HELP2) Talk(EUDAEMON_HELP1, "Choose category:") Text(EUDAEMON_HELP1, "Sets", JumpPage, 11) Text(EUDAEMON_HELP1, "Weapons", JumpPage, 12) Text(EUDAEMON_HELP1, "Money Ways", JumpPage, 13) Text(EUDAEMON_HELP1, "Pets", JumpPage, 14) Text(EUDAEMON_HELP1, "Rings & Necklace", JumpPage, 15) Text(EUDAEMON_HELP1, "Gems", JumpPage, 17) Text(EUDAEMON_HELP2, "Where i can get Kals?", JumpPage, 18) Text(EUDAEMON_HELP2, "Where i can get Blood Covenants?", JumpPage, 19) Text(EUDAEMON_HELP2, "What i can get by doing Daily Quest?", JumpPage, 20) Text(EUDAEMON_HELP2, "Where i can get Amplifiers?", JumpPage, 21) Text(EUDAEMON_HELP2, "What are the map timings?", JumpPage, 22) -- Unseal 55,65 Talk(11, "Choose what do you want to know:") Text(11, "Unseal 55,65", ShowText, "You can use unseal items as a starting items, it is located on (186,285) at Argent City.") -- FC/DS Upgraded Set -- Text(11, "Upgraded FC/DS Set", ShowText, "On Argent City there are portals that appears every 3 hours and you need to take the quest on that map and finish it to get Upgrade 45/55 card and exchange it to the NPC [278,361].") -- Level 70 Boss Set -- Text(11, "Lv 70 Boss Set", ShowText, "You can claim your FREE Lv70 Boss Set on Newbie Starter NPC") -- Death Set Quest Text(11, "Death Set", ShowText, "You can claim your FREE Death Set on Newbie Starter.") -- Unseal 95 Set Text(11, "Unseal 95 Set", ShowText, "You can get the Unseal 95 parts by killing bosses on Aurora 1-2 also Dark Area 1-2. After you get the pieces it is still sealed, to unseal the items you need to go on Argent City and find the researchers located on (194,275) and get the requirements to unseal the item.") Talk(12, "Choose what do you want to know:") -- Unseal 45,55,65 Text(12, "Unseal 45,55,65", ShowText,"You can use unseal items as a starting items, it is located on (186,285) at Argent City.") -- FC/DS Upgraded Weapon -- Text(12, "Upgraded FC/DS Weapon", ShowText, "On Argent City there are portals that appears every 3 hours and you need to take the quest on that map and finish it to get Upgrade 45/55 card and exchange it to the NPC (278,361).") -- Death Weapons Text(12, "Death Weapons", ShowText, "You can claim your FREE Death Weapons on Newbie Starter.") -- Unseal 85 Weapons Text(12, "Unseal 85 Weapons", ShowText, "You can take the quest for the Unseal 85 weapons in General Store NPC (225,345)") -- Unseal 95 Weapons Text(12, "Unseal 95 Weapons", ShowText, "You must be level 100 to get the quest for Unseal 95 weapons the NPC is located at (179,298) Argent City, Check the NPC for more info.") -- Money Ways Talk(13, "Choose what do you want to know:") -- Newbie Quest Text(13, "Newbie Quest", ShowText, "You can get your Newbie Quest on Newbie Starter NPC on Argent City it will give you some money for a good start.") -- Newbie Hunter Text(13, "Newbie Hunter", ShowText, "Newbie Hunter is located outside Argent City (2157,2779) you can kill noob mobs that drops 1k coins.") -- Farming Text(13, "Farming", ShowText, "You can go to Farm Land by using Argent Teleporter, on Farm Land you need to know fishing,wooding and mining. Fish Meat, Woods and Ores are cost some money if you sell on NPC.") -- Mazes Text(13, "Mazes", ShowText, "Also you can go to mazes like Forsaken City, Dark Swamp and Demonic World. Monsters give some money and drops that you need for your daily use.") Talk(14, "Choose what do you want to know:") -- Normal Pets Text(14, "Normal Pets", ShowText, "You can get normal pets on Pet NPC in Fairy Land") -- Mordo Text(14, "Mordo", ShowText, "You can get Mordo by paying 2m gold on Pet NPC") -- 2nd Gen Pet Text(14, "2nd Generation Pet", ShowText, "Marrying two normal pets will give you one 2nd Gen Pet") -- Angela Text(14, "Angela", ShowText, "You can get Angela Egg by exchanging Kal Runestones in Kal Exchanger.") -- Angela Jr Text(14, "Angela Junior", ShowText, "You can get the quest of Angela Junior once you have Angela pet. Check Fairy Sensai on Fairy Land (165,129) for more infor") Talk(15, "Choose what do you want to know:") -- Normal Rings Text(15, "Normal Rings", ShowText, "You can get a normal rings to Unseal NPC on Argent City (186,285)") -- Unseal 85 Rings Text(15, "Unseal 85 Rings", ShowText, "You can get the quest for Unseal 85 Rings on General Store (225,345)") -- Normal Necklace Text(15, "Normal Necklace", ShowText, "You can get a normal necklace to Unseal NPC on Argent City (186,285)") -- Rank Necklace Text(15, "Titled Necklace", ShowText, "Check out Necklace Trader for more information located at Argent City (176,329)") -- Newbie Start Talk(16, "Newbie Life:") Text(16, "Instant Level", ShowText, "You can instantly level up by going to our Newbie Starter NPC located at Argent City (207,354)") Text(16, "FREE Death Set and Weapons", ShowText, "Server offers FREE Death items to give you a good start to maximize better game-play experience") Text(16, "FREE Life Points", ShowText, "You can get a FREE life points for life skills by claiming it on Life Skill NPC located at Argent City (219,288)") Text(16, "Newbie Quest", ShowText, "Newbie Quest can give you enough money to start a living get the quest on Newbie Starter and Kill the Monsters required for the quest at Newbie Hunter Map outside Argent West Gate") Talk(17, "Choose what do you want to know:") -- Normal Gems Text(17, "Normal Gems", ShowText, "You can buy normal gems on Gem Seller NPC located at (199,276).") -- Rare Gems Text(17, "Rare Gems", ShowText, "Shards of Rare gems are can be found on chests on Forsaken City,Dark Swamp and Demonic World then you need to exchange them on Shards Exchanger located at (220,277) to get the real gem.(The Shards are dropable from chests)") -- Unique Gems Text(17, "Unique Gems", ShowText, "You can get Unique Gems shards by killing monsters on Forsaken City,Dark Swamp and Demonic World then you need to exchange them on Shards Exchanger located at (220,277) to get the real gem. (The Shards are dropable from monsters)") -- BD Gems Text(17, "Black Dragon Gems", ShowText, "You can get Black Dragon Gems (Sealed) on Chaos Argent by killing Black Dragon Monsters also you need Dragon Gem Purger to unseal it on the Cleaner NPC located at (235,344) Argent City and you will obtain the Black Dragon Gem Unsealed.") -- Kal Runestone Talk(18, "You have 2 ways to get Kal Runestone first you can farm 100 pieces of each Woods, Iron Ore and Fish Meat to exchange them for 1 Kal in Kal Exchanger NPC located at (189,358) Argent City and you can also Exchange Kals on some stuffs that Kal Exchanger offers. The second way is by farming them on Mazes the monsters are dropping Kal Runestone by chance.") -- Blood Covenants Talk(19, "You have 2 ways to get Blood Covenants first is by exchanging Kal Runestone for Blood Covenant or by joining Arena Island (PK Map) when you killed someone you may earn 1 Blood Covenant but if you died you lost 1 Blood Covenant.") -- DQ Tickets Talk(20, "You can get Daily Quest tickets on every time you finished a Daily Quest and you can exchange them for some stuffs on DQ Ticket Exchanger NPC located at (198,352) Argent City.") -- Amps Talk(21, "You can get Amplifiers by exchanging your reputations on Reputation Exchanger NPC located at (185,341) Argent City.") Talk(22, "This are the Map Timings on this Server, you may also check the Website for Accurate time if when the server will be open or if there is a Map that is open.") -- CA Text(22, "Chaos Argent", ShowText, "CA will open every 00:00(12AM) and 12:00(12PM) Server Time.") -- FC Text(22, "Forsaken City", ShowText, "FC will open every 02:00(2AM) and 14:00(2PM) Server Time. ") -- CI Text(22, "Chaos Icicle", ShowText, "CI will open every 04:00(4AM) and 16:00(6PM) Server Time.") -- DS Text(22, "Dark Swamp", ShowText, "DS will open every 06:00(6AM) and 18:00(6PM) Server Time.") -- PK Arena Text(22, "Arena Island", ShowText, "Arena Island will open every 08:00(8AM) and 20:00(8PM) Server Time.") -- DW Text(22, "Demonic World", ShowText, "DW will open every 10:00(10AM) and 22:00(10PM) Server Time.") -- ALD Text(22, "Abyss Lords Dungeon", ShowText, "This map is open every 4 hours.") Talk(EUDAEMON_TELEPORT, "Choose where you want to go.") Text(EUDAEMON_TELEPORT, "Fantasy Isle", JumpPage, EUDAEMON_TELEPORT_FANTASY) Text(EUDAEMON_TELEPORT, "Argent City", JumpPage, EUDAEMON_TELEPORT_ARGENT) Text(EUDAEMON_TELEPORT, "Shaitan City", JumpPage, EUDAEMON_TELEPORT_SHAITAN) Text(EUDAEMON_TELEPORT, "Icicle City", JumpPage, EUDAEMON_TELEPORT_ICICLE) InitTrigger() TriggerAction( 1, MoveCity, "Fantasy Town" ) Talk( EUDAEMON_TELEPORT_FANTASY, "Are you sure you want to teleport on Fatasy Town?" ) Text( EUDAEMON_TELEPORT_FANTASY, "Yes im sure.",MultiTrigger, GetMultiTrigger(), 1 ) Text( EUDAEMON_TELEPORT_FANTASY, "Nevermind i'll stay here.", JumpPage , CancelSelectPage ) InitTrigger() TriggerAction( 1, MoveCity, "Argent" ) Talk( EUDAEMON_TELEPORT_ARGENT, "Are you sure you want to teleport on Argent City?" ) Text( EUDAEMON_TELEPORT_ARGENT, "Yes im sure.",MultiTrigger, GetMultiTrigger(), 1 ) Text( EUDAEMON_TELEPORT_ARGENT, "Nevermind i'll stay here.", JumpPage , CancelSelectPage ) InitTrigger() TriggerAction( 1, MoveCity, "Shaitan" ) Talk( EUDAEMON_TELEPORT_SHAITAN, "Are you sure you want to teleport on Shaitan City?" ) Text( EUDAEMON_TELEPORT_SHAITAN, "Yes im sure.",MultiTrigger, GetMultiTrigger(), 1 ) Text( EUDAEMON_TELEPORT_SHAITAN, "Nevermind i'll stay here.", JumpPage , CancelSelectPage ) InitTrigger() TriggerAction( 1, MoveCity, "Icicle" ) Talk( EUDAEMON_TELEPORT_ICICLE, "Are you sure you want to teleport on Icicle City?" ) Text( EUDAEMON_TELEPORT_ICICLE, "Yes im sure.",MultiTrigger, GetMultiTrigger(), 1 ) Text( EUDAEMON_TELEPORT_ICICLE, "Nevermind i'll stay here.", JumpPage , CancelSelectPage ) end @V3ct0r @KONG Edited October 17, 2017 by Julio Quote Share this post Link to post Share on other sites
Brothers 24 Report post Posted March 18, 2019 still working on this? Quote Share this post Link to post Share on other sites
Tassadar 8 Report post Posted February 18, 2020 anyone manage to get this idea to work? Quote Share this post Link to post Share on other sites