Ir para conteúdo

Featured Replies

Postado

Olá Galera. 
Estou com um problema no meu servidor global 8.6 tfs 0.4

Quando termino a task , eu reporto , ganho a xp e grana, mas não consigo acessar o boss.
Já tentei setar a storage da LIB manualmente in-game  , e mesmo assim eu não consigo passar no tp.

Já revisei a UID no mapa e está ok. Já testei mudar tb.
Já tentei mudar a storage e continua o mesmo erro.

 


 

bugot.png

  • Respostas 5
  • Visualizações 584
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado
  • Autor

Segue os scripts :

Data/LIBS/104-KillingInTheNameOf.lua

 

  Citar

RANK_NONE = 0
RANK_JOIN = 1
RANK_HUNTSMAN = 2
RANK_RANGER = 3
RANK_BIGGAMEHUNTER = 4
RANK_TROPHYHUNTER = 5
RANK_ELITEHUNTER = 6
 
REWARD_MONEY = 1
REWARD_EXP = 2
REWARD_ACHIEVEMENT = 3
REWARD_STORAGE = 4
REWARD_POINT = 5
REWARD_ITEM = 6
 
QUESTSTORAGE_BASE = 1500
JOIN_STOR = 100157
KILLSSTORAGE_BASE = 65000
REPEATSTORAGE_BASE = 48950
POINTSSTORAGE = 2500
tasks =
{
    --Tasks for level 6 to 49.
    [1] = {killsRequired = 1, raceName = "Trolls", level = {6, 19}, premium = true, creatures = {"troll", "troll champion", "island troll", "swamp troll"}, rewards = {
                                                                                                                                        {type = "exp", value = {6000}},

{type = "points", value = {1}},
                                                                                                                                        {type = "money", value = {1000}}
                                                                                                                                    }},
    [2] = {killsRequired = 1, raceName = "Rotworms", level = {6, 49}, premium = true, creatures = {"rotworm", "carrion worm"}, rewards = {
                                                                                                                                        {type = "exp", value = {10000}},

{type = "points", value = {1}},

{type = "money", value = {2500}}
                                                                                                                                    }},
    [3] = {killsRequired = 1, raceName = "Crocodiles", level = {6, 49}, premium = true, creatures = {"crocodile"}, rewards = {
                                                                                                                                        {type = "exp", value = {11000}},
                                                                                                                                        {type = "achievement", value = {"Blood-Red Snapper"}},
                                                                                                                                        {type = "storage", value = {16691, 1}},
                                                                                                                                        {type = "points", value = {1}}
                                                                                                                                    }},
    [4] = {killsRequired = 1, raceName = "Cyclops", level = {6, 49}, premium = true, creatures = {"cyclops", "cyclops drone", "cyclops smyth"}, rewards = {
                                                                                                                                        {type = "exp", value = {20000}},
                                                                                                                                        {type = "points", value = {1}}
                                                                                                                                    }},
    [5] = {killsRequired = 1, raceName = "Tarantulas", level = {6, 49}, premium = true, creatures = {"tarantula"}, rewards = {
                                                                                                                                        {type = "exp", value = {22000}},
                                                                                                                                        {type = "achievement", value = {"No More Hiding"}},
                                                                                                                                        {type = "storage", value = {35001, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [6] = {killsRequired = 1, raceName = "Carniphilas", level = {6, 49}, premium = true, creatures = {"carniphila"}, rewards = {
                                                                                                                                        {type = "exp", value = {25000}},
                                                                                                                                        {type = "achievement", value = {"Rootless Behaviour"}},
                                                                                                                                        {type = "storage", value = {35002, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},
    [7] = {killsRequired = 200, raceName = "Stone Golems", level = {6, 49}, premium = true, creatures = {"stone golem"}, rewards = {
                                                                                                                                        {type = "exp", value = {2000}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},
    [8] = {killsRequired = 300, raceName = "Mammoths", level = {6, 49}, premium = true, creatures = {"mammoth"}, rewards = {
                                                                                                                                        {type = "exp", value = {4000}},
                                                                                                                                        {type = "achievement", value = {"Meat Skewer"}},
                                                                                                                                        {type = "storage", value = {35003, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},
    [9] = {killsRequired = 300, raceName = "Gnarlhounds", level = {6, 49}, premium = true, creatures = {"gnarlhound"}, rewards = {
                                                                                                                                        {type = "exp", value = {1000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [10] = {killsRequired = 300, raceName = "Terramites", level = {6, 49}, premium = true, creatures = {"terramite"}, rewards = {
                                                                                                                                        {type = "exp", value = {1000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [11] = {killsRequired = 300, raceName = "Apes", level = {6, 49}, premium = true, creatures = {"kongra", "sibang", "merklin"}, rewards = {
                                                                                                                                        {type = "exp", value = {1000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [12] = {killsRequired = 300, raceName = "Thornback Tortoises", level = {6, 49}, premium = true, creatures = {"thornback tortoise"}, rewards = {
                                                                                                                                        {type = "exp", value = {1500}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [13] = {killsRequired = 300, raceName = "Gargoyles", level = {6, 49}, premium = true, creatures = {"gargoyle"}, rewards = {
                                                                                                                                        {type = "exp", value = {1500}}
                                                                                                                                    }},
 
    --Tasks for level 50 to 79.
 
    [14] = {killsRequired = 300, raceName = "Ice Golems", level = {50, 79}, premium = true, creatures = {"ice golem"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "achievement", value = {"Breaking The Ice"}},
                                                                                                                                        {type = "storage", value = {35004, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [15] = {killsRequired = 400, raceName = "Quara Scouts", level = {50, 79}, premium = true, creatures = {"quara pincher scout", "quara predator scout", "quara hydromancer scout", "quara constrictor scout", "quara mantassin scout"}, rewards = {
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [16] = {killsRequired = 400, raceName = "Mutated Rats", level = {50, 79}, premium = true, creatures = {"mutated rat"}, rewards = {
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "achievement", value = {"Twisted Mutation"}},
                                                                                                                                        {type = "storage", value = {35005, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},                                                                                                
    [17] = {killsRequired = 250, raceName = "Ancient Scarabs", level = {50, 79}, premium = true, creatures = {"ancient scarab"}, rewards = {
                                                                                                                                        {type = "exp", value = {15000}},
                                                                                                                                        {type = "achievement", value = {"Crawling Death"}},
                                                                                                                                        {type = "storage", value = {35006, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},    
    [18] = {killsRequired = 300, raceName = "Wyverns", level = {50, 79}, premium = true, creatures = {"wyvern"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},                                                                                                        
    [19] = {killsRequired = 300, raceName = "Lancer Beetles", level = {50, 79}, premium = true, creatures = {"lancer beetle"}, rewards = {
                                                                                                                                        {type = "exp", value = {8000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},                                                                                                        
    [20] = {killsRequired = 400, raceName = "Wailing Widows", level = {50, 79}, premium = true, creatures = {"wailing widow"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},                                                                                                        
    [21] = {killsRequired = 250, raceName = "Killer Caimans", level = {50, 79}, premium = true, creatures = {"killer caiman"}, rewards = {
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},                                                                                                        
    [22] = {killsRequired = 300, raceName = "Bonebeasts", level = {50, 79}, premium = true, creatures = {"bonebeast"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "achievement", value = {"Spareribs for Dinner"}},
                                                                                                                                        {type = "storage", value = {35007, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},    
    [23] = {killsRequired = 300, raceName = "Crystal Spiders", level = {50, 79}, creatures = {"crystal spider"}, premium = true, rewards = {
                                                                                                                                        {type = "exp", value = {15000}},
                                                                                                                                        {type = "achievement", value = {"Arachnoise"}},
                                                                                                                                        {type = "storage", value = {35008, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
    [24] = {killsRequired = 300, raceName = "Mutated Tigers", level = {50, 79}, premium = true, creatures = {"mutated tiger"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},    
 
    --Taks for level 80 to 129.
 
    [25] = {killsRequired = 600, raceName = "Underwater Quara", level = {80, 129}, premium = true, creatures = {"quara hydromancer", "quara predator", "quara constrictor", "quara mantassin", "quara pincher"}, rewards = {
                                                                                                                                        {type = "exp", value = {15000}},
                                                                                                                                        {type = "achievement", value = {"Back into the Abyss"}},
                                                                                                                                        {type = "storage", value = {35009, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [26] = {killsRequired = 500, raceName = "Giant Spiders", level = {80, 129}, premium = true, creatures = {"giant spider"}, rewards = {
                                                                                                                                        {type = "exp", value = {20000}},
                                                                                                                                        {type = "achievement", value = {"Choking on Her Venom"}},
                                                                                                                                        {type = "storage", value = {35010, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [27] = {killsRequired = 300, raceName = "Werewolves", level = {80, 129}, premium = true, creatures = {"werewolf"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Howly Silence"}},
                                                                                                                                        {type = "storage", value = {35011, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},
 
    [28] = {killsRequired = 400, raceName = "Nightmares", level = {80, 129}, premium = true, creatures = {"nightmare", "nightmare scion"}, rewards = {
                                                                                                                                        {type = "exp", value = {25000}},
                                                                                                                                        {type = "achievement", value = {"Dream is Over"}},
                                                                                                                                        {type = "storage", value = {35012, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},        
 
    [29] = {killsRequired = 600, raceName = "Hellspawns", level = {80, 129}, premium = true, creatures = {"hellspawn"}, rewards = {
                                                                                                                                        {type = "exp", value = {25000}},
                                                                                                                                        {type = "achievement", value = {"Scorched Flames"}},
                                                                                                                                        {type = "storage", value = {35013, 1}}
                                                                                                                                    }},
 
    [30] = {killsRequired = 800, raceName = "High Class Lizards", level = {80, 129}, premium = true, creatures = {"lizard chosen", "lizard dragon priest", "lizard high guard", "lizard legionnaire"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Zzztill Zzztanding!"}},
                                                                                                                                        {type = "storage", value = {35014, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},
 
    [31] = {killsRequired = 600, raceName = "Stampors", level = {80, 129}, premium = true, creatures = {"stampor"}, rewards = {
                                                                                                                                        {type = "exp", value = {20000}},
                                                                                                                                        {type = "achievement", value = {"Stepped on a Big Toe"}},
                                                                                                                                        {type = "storage", value = {35015, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},        
 
    [32] = {killsRequired = 500, raceName = "Brimstone Bugs", level = {80, 129}, premium = true, creatures = {"brimstone bug"}, rewards = {
                                                                                                                                        {type = "exp", value = {15000}},
                                                                                                                                        {type = "achievement", value = {"Something Smells"}},
                                                                                                                                        {type = "storage", value = {35016, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [33] = {killsRequired = 400, raceName = "Mutated Bats", level = {80, 129}, premium = true, creatures = {"mutated bat"}, rewards = {
                                                                                                                                        {type = "exp", value = {20000}},
                                                                                                                                        {type = "achievement", value = {"Kapow!"}},
                                                                                                                                        {type = "storage", value = {35017, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},        
 
    --Tasks for level 130+                                                                                                    
    [34] = {killsRequired = 650, raceName = "Hydras", level = {130, 9999}, premium = true, creatures = {"hydra"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"One Less"}},
                                                                                                                                        {type = "storage", value = {35018, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [35] = {killsRequired = 800, raceName = "Serpent Spawns", level = {130, 9999}, premium = true, creatures = {"serpent spawn"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Hissing Downfall"}},
                                                                                                                                        {type = "storage", value = {35019, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},        
 
    [36] = {killsRequired = 500, raceName = "Medusas", level = {130, 9999}, premium = true, creatures = {"medusa"}, rewards = {
                                                                                                                                        {type = "exp", value = {40000}},
                                                                                                                                        {type = "achievement", value = {"The Serpent's Bride"}},
                                                                                                                                        {type = "storage", value = {35020, 1}},
                                                                                                                                        {type = "points", value = {5}}
                                                                                                                                    }},    
 
    [37] = {killsRequired = 700, raceName = "Behemoths", level = {130, 9999}, premium = true, creatures = {"behemoth"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Just Cracked Me Up!"}},
                                                                                                                                        {type = "storage", value = {35021, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},    
 
    [38] = {killsRequired = 900, raceName = "Sea Serpents and Young Sea Serpents", level = {130, 9999}, premium = true, creatures = {"sea serpent", "young sea serpent"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"The Drowned Sea God"}},
                                                                                                                                        {type = "storage", value = {35022, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},        
 
    [39] = {killsRequired = 250, raceName = "Hellhounds", level = {130, 9999}, premium = true, creatures = {"hellhound"}, rewards = {
                                                                                                                                        {type = "exp", value = {40000}},
                                                                                                                                        {type = "achievement", value = {"The Gates of Hell"}},
                                                                                                                                        {type = "storage", value = {35023, 1}},
                                                                                                                                        {type = "points", value = {5}}
                                                                                                                                    }},        
 
    [40] = {killsRequired = 500, raceName = "Ghastly Dragons", level = {130, 9999}, premium = true, creatures = {"ghastly dragon"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Beautiful Agony"}},
                                                                                                                                        {type = "storage", value = {35024, 1}},
                                                                                                                                        {type = "points", value = {5}}
                                                                                                                                    }},        
 
    [41] = {killsRequired = 900, raceName = "Drakens", level = {130, 9999}, premium = true, creatures = {"draken spellweaver", "draken warmaster", "draken abomination", "draken elite"} , rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Enter zze Draken!"}},
                                                                                                                                        {type = "storage", value = {35025, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [42] = {killsRequired = 650, raceName = "Destroyers", level = {130, 9999}, premium = true, creatures = {"destroyer"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Best there was!"}},
                                                                                                                                        {type = "storage", value = {35026, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},            
 
    [43] = {killsRequired = 400, raceName = "Undead Dragons", level = {130, 9999}, premium = true, creatures = {"undead dragon"}, rewards = {
                                                                                                                                        {type = "exp", value = {50000}},
                                                                                                                                        {type = "achievement", value = {"Back from the Dead"}},
                                                                                                                                        {type = "storage", value = {35027, 1}},
                                                                                                                                        {type = "points", value = {6}}
                                                                                                                                    }},    
 
    --Special tasks.
 
    [44] = {killsRequired = 6666, raceName = "Demons", level = {130, 9999}, rank = RANK_ELITEHUNTER, premium = true, creatures = {"demon"}, rewards = {
                                                                                                                                        {type = "storage", value = {41300, 1}} --Storage that let's you to start Demon Oak
                                                                                                                                    }},
 
    [45] = {killsRequired = 500, raceName = "Green Djinns or Efreets", level = {1, 9999}, rank = RANK_JOIN, premium = true, creatures = {"green djinn", "efreet"}, rewards = { --Requires an storage (Gained on The Djinn War - Marid Faction)
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "money", value = {5000}},
                                                                                                                                        {type = "storage", value = {35028, 1}}
                                                                                                                                    }},
 
    [46] = {killsRequired = 500, raceName = "Blue Djinns or Marids", level = {1, 9999}, rank = RANK_JOIN, premium = true, creatures = {"blue djinn", "marid"}, rewards = { --Requires an storage (Gained on The Djinn War - Efreet Faction)
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "money", value = {5000}},
                                                                                                                                        {type = "storage", value = {35029, 1}}
                                                                                                                                    }},        
 
    [47] = {killsRequired = 3000, raceName = "Pirates", level = {1, 9999}, rank = RANK_JOIN, premium = true, creatures = {"pirate ghost", "pirate marauder", "pirate cutthroad", "pirate buccaneer", "pirate corsair", "pirate skeleton"}, rewards = { --Requires an storage (Gained on The Shattered Isles Quest)
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "money", value = {5000}},
                                                                                                                                        {type = "storage", value = {35030, 1}}
                                                                                                                                    }},    
 
    [48] = {killsRequired = 3000, raceName = "Pirates second task", level = {1, 9999}, storage = {REPEATSTORAGE_BASE + 47, 3}, norepeatable = true, premium = true, creatures = {"pirate ghost", "pirate marauder", "pirate cutthroad", "pirate buccaneer", "pirate corsair", "pirate skeleton"}, rewards = { --Requires an storage (Gained completing Raymond Striker's first task three times.) NOTE: The required storage to start this task is: base + first pirate task id (47)
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "money", value = {5000}},
                                                                                                                                        {type = "storage", value = {35031, 1}}
                                                                                                                                    }},    
                                                                                                                                    
    [51] = {killsRequired = 1, raceName = "Minotaurs", level = {1, 9999}, rank = RANK_JOIN, premium = true, creatures = {"minotaur", "minotaur mage", "minotaur archer"}, rewards = {
                                                                                                                                        {type = "storage", value = {16696, 1}}
                                                                                                                                    }},                                                                                                                                
 
    [50] = {killsRequired = 1, raceName = "Necromancers and Priestess", level = {60, 9999}, norepeatable = true, premium = true, creatures = {"necromancer", "priestess"}, rewards = { --Requires an storage (Gained on To Outfox a Fox Quest)
                                                                                                                                        {type = "storage", value = {16720, -1}},
                                                                                                                                        {type = "storage", value = {12800, 1}} --storage to stark the second Necromancers and Priestess task.
                                                                                                                                    }},    
 
    [49] = {killsRequired = 1000, name = "Necromancers and Priestess second task", raceName = "Necromancers and Priestess", level = {60, 9999}, storage = {12800, 1}, norepeatable = true, premium = true, creatures = {"necromancer", "priestess"}, rewards = { --Requires an storage (Gained on To Outfox a Fox Quest)
                                                                                                                                        {type = "exp", value = {40000}},
                                                                                                                                        {type = "storage", value = {35033, 1}}
                                                                                                                                    }},                                                                                                                                        
}
 
tasksByPlayer = 3
repeatTimes = 3
 
function getPlayerRank(cid)
    return (getPlayerStorageValue(cid, POINTSSTORAGE) >= 100 and RANK_ELITEHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 70 and RANK_TROPHYHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 40 and RANK_BIGGAMEHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 20 and RANK_RANGER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 10 and RANK_HUNTSMAN or getPlayerStorageValue(cid, JOIN_STOR) == 1 and RANK_JOIN or RANK_NONE)
end
 
function getTaskByName(name, table)
    local t = (table and table or tasks)
    for k, v in pairs(t) do
        if v.name then
            if v.name:lower() == name:lower() then
                return k
            end
        else
            if v.raceName:lower() == name:lower() then
                return k
            end
        end
    end
    return false
end
 
function getTasksByPlayer(cid)
    local canmake = {}
    local able = {}
    for k, v in pairs(tasks) do
        if getCreatureStorage(cid, QUESTSTORAGE_BASE + k) < 1 and getCreatureStorage(cid, REPEATSTORAGE_BASE + k) < repeatTimes then
            able[k] = true
            if getPlayerLevel(cid) < v.level[1] or getPlayerLevel(cid) > v.level[2] then
                able[k] = false
            end
            if v.storage and getCreatureStorage(cid, v.storage[1]) < v.storage[2] then
                able[k] = false
            end
 
            if v.rank then
                if getPlayerRank(cid) < v.rank then
                    able[k] = false
                end
            end
 
            if v.premium then
                if not isPremium(cid) then
                    able[k] = false
                end
            end
 
            if able[k] then
                table.insert(canmake, k)
            end
        end
    end
    return canmake
end
 
 
function canStartTask(cid, name, table)
    local v = ""
    local id = 0
    local t = (table and table or tasks)
    for k, i in pairs(t) do
        if i.name then
            if i.name:lower() == name:lower() then
                v = i
                id = k
                break
            end
        else
            if i.raceName:lower() == name:lower() then
                v = i
                id = k
                break
            end
        end
    end
    if v == "" then
        return false
    end
    if getCreatureStorage(cid, QUESTSTORAGE_BASE + id) > 0 then
        return false
    end
    if (getCreatureStorage(cid, REPEATSTORAGE_BASE +  id) >= repeatTimes) or (v.norepeatable and getCreatureStorage(cid, REPEATSTORAGE_BASE +  id) > 0) then
        return false
    end
    if getPlayerLevel(cid) >= v.level[1] and getPlayerLevel(cid) <= v.level[2] then
        if v.premium then
            if isPremium(cid) then
                if v.rank then
                    if getPlayerRank(cid) >= v.rank then
                        if v.storage then 
                            if getCreatureStorage(cid, v.storage[1]) >= v.storage[2] then
                                return true
                            end
                        else
                            return true
                        end
                    end
                else
                    return true
                end
            end
        else
            return true
        end
    end
    return false
end
 
function getPlayerStartedTasks(cid)
 
    local tmp = {}
    for k, v in pairs(tasks) do
        if getCreatureStorage(cid, QUESTSTORAGE_BASE + k) > 0 and getCreatureStorage(cid, QUESTSTORAGE_BASE + k) < 2 then
            table.insert(tmp, k) 
        end
    end
    return tmp
end
 
function isSummon(cid)
    return getCreatureMaster(cid) ~= nil or false
end

Data/CreatureScripts/killinginthenameof.lua

 

  Citar

function onKill(cid, target, lastHit)


local started = getPlayerStartedTasks(cid)

if isPlayer(target) or isSummon(target) then return true end

if started and #started > 0 then

for _, id in ipairs(started) do

if isInArray(tasks[id].creatures, getCreatureName(target):lower()) then

if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) < 0 then

doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, 0)

end

if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) < tasks[id].killsRequired then

doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, getCreatureStorage(cid, KILLSSTORAGE_BASE + id) + 1)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getCreatureStorage(cid, KILLSSTORAGE_BASE + id) .. "/" .. tasks[id].killsRequired .. " " .. tasks[id].raceName .. " already killed.")

end

end

end

end

return true

end

Data/Movements/Tasks.lua 

 

  Citar

local teleports = {
    -- Tile UID = {storage of task, amount of monsters, monsters to spawn}
    [14001] = {monsters = {"Leviathan"}, telePos = {x = 31914, y = 31071, z = 10}, spawnPos = {x = 31905, y = 31071, z = 10}, from = {x = 31900, y = 31064, z = 10}, to = {x = 31918, y = 31081, z = 10}},
    [14002] = {monsters = {"The Noxious Spawn"}, telePos = {x = 32842, y = 32668, z = 11}, spawnPos = {x = 32842, y = 32673, z = 11}, from = {x = 32836, y = 32665, z = 11}, to = {x = 32849, y = 32677, z = 11}},
    [14003] = {monsters = {"Necropharus"}, telePos = {x = 33028, y = 32427, z = 12}, spawnPos = {x = 33028, y = 32421, z = 12}, from = {x = 33020, y = 32415, z = 12}, to = {x = 33035, y = 32430, z = 12}},
    [14004] = {monsters = {"The Horned Fox"}, telePos = {x = 32458, y = 31993, z = 9}, spawnPos = {x = 32458, y = 32004, z = 9}, from = {x = 32453, y = 31992, z = 9}, to = {x = 32464, y = 32008, z = 9}},
    [14005] = {monsters = {"Lethal Lissy", "Ron The Ripper", "Deadeye Devious", "Brutus Bloodbeard"}, telePos = {x = 31975, y = 32896, z = 0}, spawnPos = {x = 31982, y = 32896, z = 0}, from = {x = 31972, y = 32890, z = 0}, to = {x = 31988, y = 32904, z = 0}},
    [14007] = {monsters = {"The Snapper"}, telePos = {x = 32610, y = 32724, z = 8}, spawnPos = {x = 32611, y = 32727, z = 8}, from = {x = 32606, y = 32720, z = 8}, to = {x = 32620, y = 32733, z = 8}},
    [14008] = {monsters = {"Hide"}, telePos = {x = 32815, y = 32704, z = 8}, spawnPos = {x = 32816, y = 32708, z = 8}, from = {x = 32810, y = 32701, z = 8}, to = {x = 32824, y = 32713, z = 8}},
    [14012] = {monsters = {"Shardhead"}, telePos = {x = 32102, y = 31125, z = 2}, spawnPos = {x = 32101, y = 31130, z = 2}, from = {x = 32095, y = 31122, z = 2}, to = {x = 32108, y = 31136, z = 2}},
    [14019] = {monsters = {"Esmeralda"}, telePos = {x = 32759, y = 31253, z = 9}, spawnPos = {x = 32759, y = 31256, z = 9}, from = {x = 32755, y = 31250, z = 9}, to = {x = 32764, y = 31259, z = 9}},
    [14020] = {monsters = {"The Old Widow"}, telePos = {x = 32804, y = 32280, z = 8}, spawnPos = {x = 32800, y = 32280, z = 8}, from = {x = 32794, y = 32273, z = 8}, to = {x = 32807, y = 32288, z = 8}},
    [14021] = {monsters = {"The Many"}, telePos = {x = 32920, y = 32883, z = 8}, spawnPos = {x = 32921, y = 32899, z = 8}, from = {x = 32915, y = 32891, z = 8}, to = {x = 32927, y = 32904, z = 8}},
    [14506] = {monsters = {"Demodras"}, telePos = {x = 32748, y = 32287, z = 10}, spawnPos = {x = 32745, y = 32292, z = 10}, from = {x = 32738, y = 32283, z = 10}, to = {x = 32757, y = 32300, z = 10}},
    [14505] = {monsters = {"Tiquandas Revenge"}, telePos = {x = 32888, y = 32580, z = 4}, spawnPos = {x = 32883, y = 32580, z = 4}, from = {x = 32881, y = 32578, z = 4}, to = {x = 32892, y = 32588, z = 4}},
    [14022] = {monsters = {"Stonecracker"}, telePos = {x = 33259, y = 31695, z = 15}, spawnPos = {x = 33257, y = 31702, z = 15}, from = {x = 33252, y = 31691, z = 15}, to = {x = 33266, y = 31708, z = 15}},
}

local function getCreaturesInArea(fromPos, toPos, creatureType)
    local creatures = {}
    for x = fromPos.x, toPos.x do
        for y = fromPos.y, toPos.y do
            for z = fromPos.z, toPos.z do
                local creature = getTopCreature({x = x, y = y, z = z}).uid
                local cType  creatureType:lower()
                if (cType == "players" and isPlayer(creature)) then
                    table.insert(creatures, creature)
                elseif (cType == "monsters" and isMonster(creature)) then
                    table.insert(creatures, creature)
                elseif (cType == "npcs" and isNpc(creature)) then
                    table.insert(creatures, creature)
                elseif (cType == "all") then
                    table.insert(creatures, creature)
                end
            end
        end
    end
    return creatures
end

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local now = teleports[item.uid]
    if (#getCreaturesInArea(now.from, now.to, "players") > 0) then
        doTeleportThing(cid, fromPosition, true)
        doPlayerSendCancel(cid, "Someone else is in the room.")
    end

    if getPlayerStorageValue(cid, item.uid + (item.uid < 14500 and 100 or 0)) == 1 then
        for _, monster in ipairs(getCreaturesInArea(now.from, now.to, "monsters")) do
            doRemoveCreature(monster)
        end

        setPlayerStorageValue(cid, item.uid + (item.uid < 14500 and 100 or 0), 2)
        doTeleportThing(cid, now.telePos)
        doSendMagicEffect(now.telePos, CONST_ME_TELEPORT)
        doSummonCreature(now.monsters[math.random(#now.monsters)], now.spawnPos)
        doSendMagicEffect(now.spawnPos, CONST_ME_TELEPORT)
        return true
    end

    doTeleportThing(cid, fromPosition, true)
    return true
end

em data/movements/movements.xml
 

  Citar

<!-- task quest -->
    <movevent type="StepIn" uniqueid="14001-14005" event="script" value="tasks.lua"/>
    <movevent type="StepIn" uniqueid="14505-14506" event="script" value="tasks.lua"/>
    <movevent type="StepIn" uniqueid="14007-14008" event="script" value="tasks.lua"/>
    <movevent type="StepIn" uniqueid="14012" event="script" value="tasks.lua"/>
    <movevent type="StepIn" uniqueid="14019-14022" event="script" value="tasks.lua"/>

data/npc/scripts/Grizzly Adams.lua

 

  Citar

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}


function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end


local choose = {}

local cancel = {}

local available = {}

function creatureSayCallback(cid, type, msg)


if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid


if isInArray({"tasks", "task", "mission"}, msg:lower()) then

local can = getTasksByPlayer(cid)

if #can > 0 then

local text = ""

local sep = ", "

table.sort(can, (function(a, b) return (a < b) end))

local t = 0

for _, id in ipairs(can) do

t = t + 1

if t == #can - 1 then

sep = " and "

elseif t == #can then

sep = "."

end

text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep

end

selfSay("The current task" .. (#can > 1 and "s" or "") .. " that you can choose " .. (#can > 1 and "are" or "is") .. " " .. text, cid)

talkState[talkUser] = 0

else

selfSay("I don't have any task for you right now.", cid)

end

elseif msg ~= "" and canStartTask(cid, msg) then

if #getPlayerStartedTasks(cid) >= tasksByPlayer then

selfSay("Sorry, but you already started " .. tasksByPlayer .. " tasks.", cid)

return true

end

local task = getTaskByName(msg)

if task and getCreatureStorage(cid, QUESTSTORAGE_BASE + task) > 0 then

return false

end

selfSay("In this task you must defeat " .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Are you sure that you want to start this task?", cid)

choose[cid] = task

talkState[talkUser] = 1

elseif msg:lower() == "yes" and talkState[talkUser] == 1 then

doCreatureSetStorage(cid, QUESTSTORAGE_BASE + choose[cid], 1)

selfSay("Excellent! You can check the status of your task saying report to me.", cid)

choose[cid] = nil

talkState[talkUser] = 0

elseif msg:lower() == "report" then

local started = getPlayerStartedTasks(cid)

local finishedAtLeastOne = false

local finished = 0

if started and #started > 0 then

for _, id in ipairs(started) do

if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) >= tasks[id].killsRequired then

for _, reward in ipairs(tasks[id].rewards) do

print("Rewards loaded")

local deny = false

if reward.storage then

if getCreatureStorage(cid, reward.storage[1]) >= reward.storage[2] then

deny = true

end

end

if isInArray({REWARD_MONEY, "money"}, reward.type:lower()) and not deny then

doPlayerAddMoney(cid, reward.value[1])

elseif isInArray({REWARD_EXP, "exp", "experience"}, reward.type:lower()) and not deny then

doPlayerAddExperience(cid, reward.value[1])

doPlayerSendDefaultCancel(cid, "You gained " .. reward.value[1] .. " experience points.")

elseif isInArray({REWARD_ACHIEVEMENT, "achievement", "ach"}, reward.type:lower()) and not deny then

if doPlayerAddAchievement then

doPlayerAddAchievement(cid, reward.value[1], true)

end

elseif isInArray({REWARD_STORAGE, "storage", "stor"}, reward.type:lower()) and not deny then

doCreatureSetStorage(cid, reward.value[1], reward.value[2])

elseif isInArray({REWARD_POINT, "points", "point"}, reward.type:lower()) and not deny then

doCreatureSetStorage(cid, POINTSSTORAGE, getCreatureStorage(cid, POINTSSTORAGE) + reward.value[1])

elseif isInArray({REWARD_ITEM, "item", "items", "object"}, reward.type:lower()) and not deny then

doPlayerAddItem(cid, reward.value[1], reward.value[2])

end


if reward.storage then

doCreatureSetStorage(cid, reward.storage[1], reward.storage[2])

end

end


if tasks[id].norepeatable then

doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 2)

else

doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 0)

end

doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, 0)

if getCreatureStorage(cid, REPEATSTORAGE_BASE + id) < 1 then

doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, 0)

end

doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, getCreatureStorage(cid, REPEATSTORAGE_BASE + id) + 1)

finishedAtLeastOne = true

finished = finished + 1

end

end


if not finishedAtLeastOne then

selfSay("You haven't finished any task yet.", cid)

else

selfSay("Awesome! you finished " .. (finished > 1 and "various" or "a") .. " task" .. (finished > 1 and "s" or "") .. ". Talk to me again if you want to start a task.", cid)

end

else

selfSay("You haven't started any task yet.", cid)

end

elseif msg:lower() == "started" then

local started = getPlayerStartedTasks(cid)

if started and #started > 0 then

local text = ""

local sep = ", "

table.sort(started, (function(a, b) return (a < b) end))

local t = 0

for _, id in ipairs(started) do

t = t + 1

if t == #started - 1 then

sep = " and "

elseif t == #started then

sep = "."

end

text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep

end


selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)

else

selfSay("You haven't started any task yet.", cid)

end

elseif msg:lower() == "cancel" then

local started = getPlayerStartedTasks(cid)

if started and #started > 0 then

selfSay("Cancelling a task will make the count restart. Wich task you want to cancel?", cid)

talkState[talkUser] = 2

else

selfSay("You haven't started any task yet.", cid)

end

elseif getTaskByName(msg) and talkState[talkUser] == 2 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then

local task = getTaskByName(msg)

if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then

selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Cancelling this task will restart the count. Are you sure you want to cancel this task?", cid)

else

selfSay("Are you sure you want to cancel this task?", cid)

end

talkState[talkUser] = 3

cancel[cid] = task

elseif msg:lower() == "yes" and talkState[talkUser] == 3 then

doCreatureSetStorage(cid, QUESTSTORAGE_BASE + cancel[cid], -1)

doCreatureSetStorage(cid, KILLSSTORAGE_BASE + cancel[cid], -1)

selfSay("You have cancelled the task " .. (tasks[cancel[cid]].name or tasks[cancel[cid]].raceName) .. ".", cid)

talkState[talkUser] = 0

elseif isInArray({"points", "rank"}, msg:lower()) then

selfSay("At this time, you have " .. getCreatureStorage(cid, POINTSSTORAGE) .. " Paw & Fur points. You " .. (getPlayerRank(cid) == 5 and "are an Elite Hunter" or getPlayerRank(cid) == 4 and "are a Trophy Hunter" or getPlayerRank(cid) == 3 and "are a Big Game Hunter" or getPlayerRank(cid) == 2 and "are a Ranger" or getPlayerRank(cid) == 1 and "are a Huntsman" or "haven't been ranked yet") .. ".", cid)

talkState[talkUser] = 0

end

end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

Postado

@nanomeyer, ao que parece você pegou um script qualquer de teleporte para os bosses sem que ele tivesse relação com o sistema de task que você tá utilizando. Por isso não funciona.

 

Substitua o que tem no arquivo data/movements/scripts/tasks.lua, por esse:

 

Mostrar conteúdo oculto

 

Exemplifiquei para o The Snapper, perceba na linha:

[16691] = {monsters = {"The Snapper"}, telePos = {x = 32610, y = 32724, z = 8}, spawnPos = {x = 32611, y = 32727, z = 8}, from = {x = 32606, y = 32720, z = 8}, to = {x = 32620, y = 32733, z = 8}},

Entre [ ] é o uniqueid que você colocará no teleporte. Esse uniqueid deve ser igual ao storage configurado no arquivo data/lib/104-KillingInTheNameOf.lua:

 

Veja para a task dos crocodilos:

[3] = {killsRequired = 1, raceName = "Crocodiles", level = {6, 49}, premium = true, creatures = {"crocodile"}, rewards = {
                                                                                                                    {type = "exp", value = {11000}},
                                                                                                                    {type = "achievement", value = {"Blood-Red Snapper"}},
                                                                                                                    {type = "storage", value = {16691, 1}},
                                                                                                                    {type = "points", value = {1}}
                                                                                                                }},

Em: 

 {type = "storage", value = {16691, 1}},

Em "value", sempre deixe o segundo valor igual a 1.

 

Agora é com você pra colocar os storages em uma sequência e deixar os uniqueids mais organizados. Ou então deixa tudo bagunçado mesmo. ?‍♂️

Contato:

  • Email: dwarfer@sapo.pt
  • Discord: Dwarfer#2715

 

Postado
  • Autor

não resolveu. ja tinha testado 2 scripts de movements , tanto o 14007 que tem um lua com todas as tasks , e o 16691 é um script p cada boss, sendo esse ultimo , dá certo mas ele não deixa repetir a task, e se sair da sala do boss , ele nao some. Se puder talvez fazer o sistema , se for fácil p vc , posso lhe pagar...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo