Jump to content

Saud bin abdullah

Inactive Member
  • Posts

    27
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Saud bin abdullah

  1. when xx.chat."auto events" begin

    s=select("A",D",E")

    if s==1 then

    server_loop_timer("auto_events_start", 1)

    server_loop_timer("auto_events_end", 1)

    syschat("A")

    elseif s == 2 then

    clear_server_timer("auto_events_start")

    clear_server_timer("auto_events_end")

    syschat("D")

    end

    when auto_events_start.server_timer begin

     

    events_time_begin = os.date("%H")

    if events_time == 19 then

    game.set_event_flag("xx", x )

    end

     

    when auto_events_end begin

     

    events_time_end = os.date("%H")

    if events_time == 22 then

    game.set_event_flag("xx", x )

    notice_all("")

    end

    or table for all events will be better

    events = {

    [1] = {x, x,................}

    [2] = {x, x,................ } put what you need

    [3] = {x, x,................}

    }

    as well make sure you make flag check so as don't repeat activation

    that's all

    I hope this is what you ask for

    ^

    all of this is example only

  2. quest awards_day begin
    	state start begin
    		when xx.chat."award" with game.get_event_flag("awards_day") == 1 begin	--	you can use `when xx.use` also, you have to edit item type to ITEM_QUEST from txt or 18 from table
    			local items = {1, 2, 3, 4, 5, 6, 7}	--	put vnum items 
    			local award = number(1,table.getn(items))
    			if pc.getqf("award_time") < get_time() then
    				say("")
    				pc.give_item2(award, 1)
    				pc.setqf("award_time", get_time()+60*60*24)	-- 24h
    			else
    				say("")
    			end	--	if
    		end	-- when
    	end	--	state
    end	--	quest

    i think it's same idea but in short way

    • Love 1
  3.  

    ------------------------------------------------------------------
    -- Quest: Perfect Item                                            --
    -- By: Prof-Stof                                                  --
    -- Skype: XProfStof                                                --
    -- This quest is created by Prof-Stof on his server Fechkel MT2 --
    -- Thank you not to delete this comment                            --
    ------------------------------------------------------------------
    quest itembonus2 begin
    	state start begin
    		when 9010.take with pc.get_name() == "[SA]Admin" begin
    			if item.get_type() == ITEM_WEAPON or item.get_type() == ITEM_ARMOR or item.get_sub_type() == ARMOR_EAR then
    				local b1,vb1,b2,vb2,b3,vb3,b4,vb4,b5,vb5
    				say("1: Enter the Bonus ID:")
    				b1 = tonumber(input())
    				say("1: Enter the Bonus value:")
    				vb1 = tonumber(input())
    				say("2: Enter the Bonus ID:")
    				b2 = tonumber(input())
    				say("2: Enter the Bonus value:")
    				vb2 = tonumber(input())
    				say("3: Enter the Bonus ID:")
    				b3 = tonumber(input())
    				say("3: Enter the Bonus value:")
    				vb3 = tonumber(input())
    				say("4: Enter the Bonus ID:")
    				b4 = tonumber(input())
    				say("4:Enter the Bonus value")
    				vb4 = tonumber(input())
    				say("5:Enter the Bonus ID:")
    				b5 = tonumber(input())
    				say("5:Enter the Bonus value")
    				vb5 = tonumber(input())
    				say("Bonus have been Switched successfully")
    				item.set_value(0, b1, vb1)
    				item.set_value(1, b2, vb2)
    				item.set_value(2, b3, vb3)
    				item.set_value(3, b4, vb4)
    				item.set_value(4, b5, vb5)
    			else
    				syschat("You Cannot Switch Bonus this ITEM")
    			end
    		end
    	end
    end

    I think this better

     

     

    Yours is not working :)

    When npc 9010 take the Item, that error comes..

     

    The first version is working, thank you :)

     

     

     

    really?

    I did not try it, I'll try it now :D

    # Edit

     

    it works

    you have to change name or write with pc.is_gm() if you want

     

     

     

    You don't need to wait to create or edit an item, just put it in the safebox. Also there is a command /full_set on 40k that gives you a full set of items.

     

    In any case, I find this code not particularly well written as others said above, but thanks for sharing nevertheless.

     

    Yes, normaly when i want edit equip for test i do on safebox too, and the 34k have the full_set command too, and give the same default itens than the 40k.

     

     

     

  4. ------------------------------------------------------------------
    -- Quest: Perfect Item                                            --
    -- By: Prof-Stof                                                  --
    -- Skype: XProfStof                                                --
    -- This quest is created by Prof-Stof on his server Fechkel MT2 --
    -- Thank you not to delete this comment                            --
    ------------------------------------------------------------------
    quest itembonus2 begin
    	state start begin
    		when 9010.take with pc.get_name() == "[SA]Admin" begin
    			if item.get_type() == ITEM_WEAPON or item.get_type() == ITEM_ARMOR or item.get_sub_type() == ARMOR_EAR then
    				local b1,vb1,b2,vb2,b3,vb3,b4,vb4,b5,vb5
    				say("1: Enter the Bonus ID:")
    				b1 = tonumber(input())
    				say("1: Enter the Bonus value:")
    				vb1 = tonumber(input())
    				say("2: Enter the Bonus ID:")
    				b2 = tonumber(input())
    				say("2: Enter the Bonus value:")
    				vb2 = tonumber(input())
    				say("3: Enter the Bonus ID:")
    				b3 = tonumber(input())
    				say("3: Enter the Bonus value:")
    				vb3 = tonumber(input())
    				say("4: Enter the Bonus ID:")
    				b4 = tonumber(input())
    				say("4:Enter the Bonus value")
    				vb4 = tonumber(input())
    				say("5:Enter the Bonus ID:")
    				b5 = tonumber(input())
    				say("5:Enter the Bonus value")
    				vb5 = tonumber(input())
    				say("Bonus have been Switched successfully")
    				item.set_value(0, b1, vb1)
    				item.set_value(1, b2, vb2)
    				item.set_value(2, b3, vb3)
    				item.set_value(3, b4, vb4)
    				item.set_value(4, b5, vb5)
    			else
    				syschat("You Cannot Switch Bonus this ITEM")
    			end
    		end
    	end
    end

    I think this better

×
×
  • 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.