• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Lua help

Status
Not open for further replies.

mibu

Enthusiast
Need help with smth similar..for mangos...my emu has issues with Priest race quest spell rewards and i wanna make smth like this just for priest..

smth like

function LevelUp 5 (event, player)
if player:GetClass() == 5 then -- priest
if player:getrace() == 5 then -- undead
if (player:GetLevel() == 5) then
player:LearnSpell(2652)
player:LearnSpell(2944)

and continue with each different race...with it's racial spells...but i got it all rong...can someone fix it for mangos?
 

Hyperion

Founder
~Moved post to thread


In the future, make your own thread instead of hijacking another to ask a question.
You will get helped a lot quicker that way ;P
 

mibu

Enthusiast
Well =)) help :)) is for a good cause pls :p i have a bunch of ppl wining for their priest spells :)) .if u can pls show me a model for this Priest..all get to work :) and wen m done all post it here..i wanna include all the quest spells for all clases...(stances,etc) but seems everybody is doing Trinity ..:( so no model for me to learn from /m all mangos tbc"
 

Salja

Respected Member
im not understand what you mean, you say on your mangos source you have a issues with a quest right ? "quest id" ? what script you need with lua on quest end or first login learn spell ?
 

mibu

Enthusiast
Well since m bombarding u with mangos bugs..there u go...
All Priest racial spells that u get from Priest specific Quests (ex:Touch of Weakness) r imposable by players to obtain becouse..60%-70% of those quests dont work..and the one's that do work..in the meaning of u r able to complete them (ex:Draenei,bloodelf,undead/Quests for priest racial spells) dont reward the spells...
So i investigated..started .lookup spell ...and found out i onlly have Ranks of the spells but not the initial "Teach Rank 1 Touch of Weakness" somehow the Teach spell off all these spells r missing...so my idea of creating custom consumable item with restriction on use (EX: Priest & undead/bloodelf usable only consumable) so i can put this in a custom vendor and fix all these priest issues...Failed..since i dont have a teach spell to apply to the item..
So i saw this...and m thinking if i make smth like (i worked a bit on it..still dont know if it works cose m noob..and no mangos support for .lua)


function LevelUp1 (event, player)
if player:GetClass() == 5 then -- Priest
if (player:GetRace() == 5) then -- undead
if (player:GetLevel() == 2) then
do player:LearnSpell(2652)
do player:LearnSpell(2944)
end

RegisterServerHook(13, LevelUp1) <_____NOw i dont know wut is this :)) i added it cose i saw at someone but m 100% m doing it rong :))




So my idea is for continuinf this whit those 2 racial spells for each class..but not onlly i dont know how to make first..i have no idea how to separe

if (player:GetRace() == 5) then -- undead

For other races...i saw model for spells on level..but i onlly need it on lvl 10 for diferent Race ...(i added 2 so i can test it atm...PS:M failing)


On quest id would be Great if all those Quest's would work...rather just hand it out free wen they reach lvl 10 so i wount be reading 10 tickets same issue every day :))
 
Last edited:

Salja

Respected Member
All Priest Quests and other Quests for Classes where you can learn a Spell is working on mangos you sure you compiled SD2 Scripts ?

Here the Lua Script what you ask

Code:
-- Learn Spell 2652 and 2944 wehn priest undead is level 2
function LevelUp1 (event, player, oldLevel)
    if (player:GetLevel() == 2) then -- Check Level
        if player:GetClass() == 5 then -- Check is Priest
            if (player:GetRace() == 5) then -- Check is Undead
                player:LearnSpell(2652)
                player:LearnSpell(2944)
            end
        end
    end
end

RegisterPlayerEvent(13, LevelUp1)


im sure the checks can make better done but works for the moment =)
 

mibu

Enthusiast
Any way i can continue the script with "elseif" player:GetRace() so i can add all those priests here? ...and so many "end" is normal? i know every "if" must be closed with "end" but even if is continued with "then"?

And wut is Register server hook? way i need that..and were did that number 13 came from?
 

mibu

Enthusiast
That's all i needed thx!.. i did compile Scriptdev2 ...but the npc's u need to heal have issues...u target the npc..try to heal and instead all heals or buffs u try to cast on it..they cast on u..weird..didint tried to look into the db to see if correct faction
 

Salja

Respected Member
yes right is faction issues look for right faction in wotlk udb or is pvp stat issues can fix over creature_addon / creature_addon_template or you give me the npc id and i look =)
 
Status
Not open for further replies.
Top