Jump to content

Inuarashi

Advanced members
  • Content Count

    39
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Inuarashi


  1. @wizel1you can create a script that checks if the character has the state already or not, for the item that you use.

     

    such as heaven berry have state_xxxxx, then do a check if state == 1, and if it does, prompt a message and return, end, before the consumption of the item.


  2. @FapFap

    what are you trying to do with this script? o.o

     

    anyways, try this, might work.

     

    function ResumeFuel(cha)
    	local Cha_Boat = ChaIsBoat(cha)
    
    		if Cha_Boat ~= 1 then 
    			return
    		end
    
    	local boat = TurnToShip(cha)
    
    		local fuel,mxfuel,fuelrec = GetChaAttr(boat, ATTR_SP),GetChaAttr(boat, ATTR_MXSP),GetChaAttr(boat, ATTR_SREC) 
    		local dura,mxdura,durarec = GetChaAttr(boat, ATTR_HP),GetChaAttr(boat, ATTR_MXHP),GetChaAttr(boat, ATTR_HREC)
    		if(fuel <= 0)then
    			if(dura > 0)then
    				SystemNotice(boat, 'No more fuel! ['..GetChaDefaultName(boat)..'] is slowly getting damaged.')
    				durarec = durarec - 0.025 * mxdura
    				dura = math.min(mxdura, dura + durarec)
    				SetCharaAttr(dura, boat, ATTR_HP)
    			end
    			if(dura <= 0)then
    				return
    			end
    		else
    			fuel = math.max(0, fuel - fuelrec)
    			SetCharaAttr(fuel, boat, ATTR_SP)
    		end
    	end
    end
    
    ResumeHook = Resume
    
    Resume = function(role)
    	ResumeHook(role)
    	ResumeFuel(role)
    end

     


  3. 13 hours ago, FapFap said:

    Im having this errors at log/log/getshipid_err.txt:

    err.png.793d863a3f4ae29e38a6bfaa50b49772.png

    It keeps spamming alot in each sec

    that means that a function is calling this function each second (or a lot of times a second),

     

    try to search ur files for TurnToShip and see what function is triggering this function

    (example would be cha_timer)

     

    the log appears because x_role in this function is nil based on some function that is running it.

     

    it probably happens because you are using TurnToShip (role) function on something that doesnt require the character to be in a ship (so GetCtrlBoat is nil) and returning this message.


  4. 2 hours ago, FapFap said:

    should i replace my whole function to urs?

     

    the problem error is that, sometimes it happens that the value hp(role) is nil , and there is nothing to handle that, so the error comes up

     

    a way to fix it is to add something to handle that situation. such as the code above.

     

    if the value is nil, or the value is less than 0 , do someting, end.

     


  5. 1 hour ago, FapFap said:

    @Stinger Hey, thanks alot, check out the code i posted on top, it works fine but if i add for ex: Tree or Iron Ore, even if i make the % 100% after cutting the tree i dont get the item directly on invertory

    maybe you could check on how resources work, as trees / iron ore seems to drop items everytime its cut, not when it dies like monsters.


  6. On 8/20/2018 at 8:04 PM, daim2604 said:

    Hi.

     

    Firstly, I'm a beginner/newbie in creating pko server. 

    I'm trying to add new apparel, the Ichigo Bankai From archive.

    I've successfully added a new item (BuffTicket) but not apparel and the legendary wings.

     

    I've added the item inside iteminfo.txt as follows : 

    
    //Daim tambah
    9433	Buff Ticket	n0307	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	1	1	99	0	180	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_BuffTicket	0	0,0,0,0,0,0,0,0	0,0,0,0,0,0,0,0	0,0	0,0	0,0	Get Full Buff For 3 Minutes
    9434	Ichigo Bankai-Dress	new	10110002	0000590002	0	0	0	0	0	22	0	0	0	0	1	1	1	1	1	1	1	10000	1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	2,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2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	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	5000,5000	0	0	0	0	0	0	0	0	0	0	0	0	0	4014,24	0	0	Tattered wings of the Legendary Dragon. Place at 1st inventory slot to see effect.	0
    9437	Legendary Wings	n2002	10130005	01020026	0	0	0	0	0	44	0	0	0	0	0	0	0	0	0	1	0	0	1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	5000,5000	0	0	0	0	0	0	0	0	0	0	0	0,0,0,0,0,0,0,0	0,0,0,0,0,0,0,0	4014,24	0,0	0,0	Wings gotten after rebirth, possessing mysterious powers. Place at 1st inventory slot to see effect. (For Lance usage after second rebirth)

     

    And then, I've copied the iteminfo.txt to client side, and compile them with Bin Compiler. I've also added the lgo stuff to model/character at clientside.

     

    But, when I try to add the item with gm command 

    &make 9434,1 

     

    I got an error saying : AddItem : item data type error! ID = 9434

     

    Am I missing something or is there something else I should do?

     

    I'm using PKO 2 Client and game server for pko 2.

     

    Thanks in advance.

     

     

    game server or game.exe might not be modified to accept itemid's over 8000


  7. Or just simply adding an item

    (Mockup: Hundred Dollar Note - Gives 100M)

    function ItemUse_HundredDollar (role,item)
    	local Gold = GetChaAttr (role,ATTR_GD)
    	-- Check if Gold is over the limit 
    		if Gold >= 1900000000 then -- If gold is over 1,900,000,000 (1.9B)
    			SystemNotice (role,"Your gold is too much!")
    			return -- Returns the code so it doesnt go any further
    		end
    	-- Add Gold to Player
    	AddMoney (role,0,100000000) -- Add 100,000,000 (100M) gold to the player
    end

    Add to ItemInfo.txt 
     

    XXXX	Hundred Million Dollar Note	ICON	10130005	0	0	0	0	0	00	41	0	0	0	0	0	1	1	1	1	99	0	100000000	-1	0	-1	0	0	-1	-1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_HundredDollar	0	0	0	0	0	0	Use to obtain 100M	


    Then you can add it to a NPC Stall (Item is priced at 100M for players to buy) or to some NPC Exchanger that talk dialogue to exchange 100M to this item =)
     

    • Like 2
×
×
  • Create New...