|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
03-24-2015, 01:50 PM
|
Hill Giant
|
|
Join Date: May 2014
Posts: 209
|
|
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.
|
03-24-2015, 02:21 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,595
|
|
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 {
quest::settimer("Reward", 3600);
}
sub EVENT_TIMER {
if ($timer eq "Reward") {
quest::stoptimer("Reward");
$client->AddAlternateCurrencyValue(CURRENCY ID, AMOUNT);
$client->Message(315, "You have received AMOUNT CURRENCY for staying online for an hour!");
quest::settimer("Reward", 3600);
}
}
3. Books table in the database, then set the book information in the items table.
|
03-24-2015, 08:36 PM
|
|
Developer
|
|
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
|
|
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.
__________________
Uleat of Bertoxxulous
Compilin' Dirty
|
03-24-2015, 10:20 PM
|
Hill Giant
|
|
Join Date: May 2014
Posts: 209
|
|
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.
|
03-24-2015, 10:42 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,595
|
|
You could do it in starting_items if you want them to start with it.
|
03-24-2015, 10:57 PM
|
Hill Giant
|
|
Join Date: May 2014
Posts: 209
|
|
Was hoping to do it via quest. That would be a easy enough work around though, I take it /claim doesn't work?
|
03-24-2015, 11:21 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,595
|
|
Claim does work.
|
03-24-2015, 11:21 PM
|
|
Developer
|
|
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
|
|
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.
__________________
Uleat of Bertoxxulous
Compilin' Dirty
|
03-26-2015, 09:39 AM
|
Hill Giant
|
|
Join Date: May 2014
Posts: 209
|
|
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();
quest::summonitem();
|
03-26-2015, 02:17 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,595
|
|
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 {
if ($text=~/Hail/) {
quest::summonitem($_) for (1001, 1003, 1005);
}
}
|
03-26-2015, 04:33 PM
|
Hill Giant
|
|
Join Date: May 2014
Posts: 209
|
|
Ok cool thank you guys
|
03-26-2015, 04:47 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,595
|
|
You're welcome.
|
03-26-2015, 09:07 PM
|
|
Developer
|
|
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
|
|
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.)
__________________
Uleat of Bertoxxulous
Compilin' Dirty
|
03-27-2015, 09:38 AM
|
Hill Giant
|
|
Join Date: May 2014
Posts: 209
|
|
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
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 02:33 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|