Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   quest fuction (https://postpacific.loc-online.com/showthread.php?t=7367)

moon 16.04.2007 11:08

quest fuction
 
Hallo all can any on explane me this 2 line's, i work on some quests.

Code:

( myself->GetInventoryInfo(talker,1) * 0.800000 )
AND
Code:

talker.flag = ( gg->Rand(2) + 1 );


thanks

ateh 16.04.2007 15:00

First one along with 3 other GetInventoryInfo calls is used to check if player has less than 80% of weight used and less than 80% of max items in inventory allowed - means if he has room for quest items which he might get.

The flag one I'm not sure, probably to decide if he should get quest item this time or not. Show more code.

moon 17.04.2007 10:02

Tanks for helping me ! can you give lil more Detail ? thanks
Code:

                if( ask == 996 )
                {
                        myself->SetCurrentQuestID(996);
                        if( myself->GetInventoryInfo(talker,0) >= ( myself->GetInventoryInfo(talker,1) * 0.800000 ) || myself->GetInventoryInfo(talker,2) >= ( myself->GetInventoryInfo(talker,3) * 0.800000 ) )


Code:

                                                if( talker.flag == 1 )
                                                {
                                                        if( ( myself->GetCurrentTick() - talker.quest_last_reward_time ) > 1 )


ateh 17.04.2007 14:56

Whole this 'if' line is for checking inventory weight and amount as I said, if condition is TRUE then code under it gets executed (usually send message to player that he needs less weight and items) and execution of handler is terminated.
Second part if still not long enough to say what it exactly does. But seems like deciding if he get's quest item.


All times are GMT. The time now is 15:24.