Jump to content

Recommended Posts

Nope, didn't work. Added the quest name to the list, complied it, reloaded the quest but still only gives the bonus whilst you're riding the mount.

quest mountdmg begin
    state start begin
        when login or enter begin
            if pc.count_item(52001)>=1 then    
                 pc.52001.use

            end
        end
    end
end


Link to comment
Share on other sites

 

Nope, didn't work. Added the quest name to the list, complied it, reloaded the quest but still only gives the bonus whilst you're riding the mount.

quest mountdmg begin
    state start begin
        when login or enter begin
            if pc.count_item(52001)>=1 then    
                 pc.52001.use

            end
        end
    end
end


Yeah I told u sth different

quest mountdmg begin
    state start begin
        when login or enter with pc.count_item(52001)>=1 begin
            add.effect(I dont know the command for adding a effect )   
                 

            end
        end
    end
end

(I'm a lua newbie and never wrote any big quests, not sure if its right but I think here are enough good quest buddies..)

  • Love 1
Link to comment
Share on other sites

yeah, i wrote it that way so i could add multiple if statements for the other mounts rather than creating new quest files for each one ;)

was trying to figure out the add.effect command aswell :D

 

edit - figured it out!

 

here's the code if you wanted it. this gives 5,000 hp to the player.

 

second edit, it bugs and the user keeps the HP even if the item is removed from invent and player relogs. ill update it when i find a fix

 

Edit again - below is a bad way to do it, need to find a way to do it without a timer. will likely need to write a new function for it

 

quest mountdmg begin
	state start begin
		when login or enter begin
			if pc.count_item(52001)>=1 then	
				  affect.add(1, 5000, 5*60)         // only gives for five mins :/ 
					

			end
		end
	end
end
Link to comment
Share on other sites

quest mountdmg begin
    state start begin
        when login or enter begin
            if pc.count_item(52001)>=1 then 
                  affect.add(1, 5000, 5*60)         // only gives for five mins :/
                     
 
            end
        end
    end
end

DO NOT USE THAT EVER !!

 

if you relog the bonus will be doubled and so on !!

 

------------

 

you can use it with

quest mountdmg begin
    state start begin
        when login or enter with pc.getqf("mount_bonus") != 1 begin
            if pc.count_item(52001)>=1 then 
                  affect.add(1, 5000, 60*60*24*365)
                  pc.setqf("mount_bonus", 1)
            end
        end
        when logout or disconnect with pc.getqf("mount_bonus") == 1 begin
                  affect.remove(1, 5000, 60*60*24*365)
                  pc.setqf("mount_bonus", 0)
        end
    end
end

please test it many times before using it.

Link to comment
Share on other sites

quest mountdmg begin
    state start begin
        when login or enter begin
            if pc.count_item(52001)>=1 then 
                  affect.add(1, 5000, 5*60)         // only gives for five mins :/
                     
 
            end
        end
    end
end

DO NOT USE THAT EVER !!

 

if you relog the bonus will be doubled and so on !!

 

------------

 

you can use it with

quest mountdmg begin
    state start begin
        when login or enter with pc.getqf("mount_bonus") != 1 begin
            if pc.count_item(52001)>=1 then 
                  affect.add(1, 5000, 60*60*24*365)
                  pc.setqf("mount_bonus", 1)
            end
        end
        when logout or disconnect with pc.getqf("mount_bonus") == 1 begin
                  affect.remove(1, 5000, 60*60*24*365)
                  pc.setqf("mount_bonus", 0)
        end
    end
end

please test it many times before using it.

 

 

 

I tried something similar earlier to remove the affect after log out but for some reason it won't remove it at all even using your way :/ possibly because it's putting the time left into - and not on 0 causing it to bug?

 

Link to comment
Share on other sites

quest ride begin
	state start begin
		when 52001.use begin
			if pc.is_riding() then
				pc.unmount()
			else
				pc.mount(20110, 60*60*24*365)
				pc.mount_bonus(1, 5000, 60*60*24*365)
			end
		end
	end
end

Hey, thanks for this but it's not what i'm looking for, this is for riding and getting a bonus at that time, I need one to work when it's just in your inventory, although i'm going to use the pc.mount_bonus to see if that'll work instead of apply affect. ^_^

 

 

I'm currently the point that i can add the bonus and remove it, but for some reason when its in the inventory it's giving 10,000 hp and not 5,000. also when you ride the mount and unride it it resets hp to default, but i guess this can be fixed by altering the if statement to check if it's also riding etc

 

quest mountbonus begin
    state start begin
        when login or enter with pc.getqf("mount_bonus") != 1 begin
            if pc.count_item(52001)>=1 then
                  pc.mount_bonus(1, 5000, 60*60*24*365)
                  pc.setqf("mount_bonus", 1)
            end
        end
        when logout or disconnect with pc.getqf("mount_bonus") == 1 begin
                      pc.setqf("mount_bonus", 0)
        end
    end
end
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.