Couple Questions
Just got a couple quick questions having trouble finding info.
1) How can I make a npc give multiple items,a package deal if you will? I know I could just do summonitem multiple times but I was hoping to give them a bag of items,Could I create a spell and then have the npc selfcast the spell summoning a bag of items? What would be best way of doing this for say 2-3 bags of items. 2) How can I make it so players recieve an item in their alt currency or inventory every x amount of hours? I know it would go in my global_player but not sure asto what the code would look like. 3) And Lastly Editing books? Like recipe books. How in the world can I go about editing them can't seem to find any info on it at all. |
1. Take a look at the Phantom Plate spell (summons a bag with items in it) and just have the client cast a custom version of that spell.
2. Use EVENT_CONNECT and EVENT_TIMER with an hourly timer: Code:
sub EVENT_CONNECT { |
I would **HIGHLY** recommend against giving items in bags at this time.
When a 'loaded' bag is placed on the visible cursor, a proper database save is performed and the bag and its contents remain intact. If something occurs and the 'loaded' bag is pushed into a 'limbo' slot, there is no guarantee that the contents of the bag will be recoverable. |
Hmm. Might have to come up with a way of doing this differently. Really wanna be able to have a starting package type thing, just not sure how to go about it.
|
You could do it in starting_items if you want them to start with it.
|
Was hoping to do it via quest. That would be a easy enough work around though, I take it /claim doesn't work?
|
Claim does work.
|
If you ensure that nothing is on the cursor before 'summoning' a filled bag, you can probably get away with it.
It would limit the event to one bag with contents, which must go onto the cursor first, and then any 'loose' items afterwards. You could always put in safety code to check that your bag ID is on the visible cursor, and empty, and then pile in the items that you want in it. If it's not visible, or empty, you could then just push the items to the cursor normally. This is very doable..but, poses a risk of item loss if you're not 100% in-tune with what's going on behind the scenes. EDIT: I reference the cursor explicitly because if room is not found in the 'regular' inventory, the returned available slot is always SlotCursor. |
Would it just be safer to give multiple 'loose' items? And if so what would be considered the safe number? Figure im going to just let players purchase the items from the npc and have the npc just give 1 or 2 items. But am curious for future reference.
would the code for multiple rewards be structured like this: Code:
quest::summonitem(); |
Well you could have multiple calls or do a one-line for loop like this (if your items were 1001, 1003, 1005, etc):
Code:
sub EVENT_SAY { |
Ok cool thank you guys
|
You're welcome.
|
Technically, the Server 'should' allow 1000 items on the cursor.
Testing showed that it will only access up to around 102 items from the database. Even with the lower limit, you should stick to no more than 37 items (1 visible, 36 in limbo) or you will cause serious desync issues. And that doesn't mean adding 37 items to a cursor that already has items on it :P All clients currently supported enforce this 1+36 limit (even RoF+ with it's differing format.) |
Awesome Uleat. I doubt I'll ever add more then 3-5 but that is very good to know,just what I was searching for. Tyvm
|
All times are GMT -4. The time now is 09:35 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.