Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 03.07.2006, 08:16   #1
zcold
Архивный участник
 
Join Date: Nov 2005
Posts: 146
Default

I think this code need "heavy" optimization
Look, you take 2k adena every time for teleports, if player haven't item @chrono_campana.

And you check every time for that item, if player haven't that item - you delete 2k adena and teleport him.

1. You haven't check, if player have 2k adena. You just delete it.
2. You have check for item @chrono_campana in every teleport.
More optimized will be:
Code:
EventHandler MENU_SELECTED(ask, reply, talker, i0, i1) {
i1 = OwnItemCount(talker, @chrono_campana);

if (ask == 1 && reply > 0)
{

if (OwnItemCount(talker, @adena)<2000 && i1==0)
                       ShowPage(talker, "not_enough_adena.htm");
else 
{
if (i1 == 0)
                       DeleteItem1(talker, @adena, 2000);

select(reply)
{
case 1	: 
{					
InstantTeleport(talker, 46934, 51467, -2977);
break;
}
case 2	:
{					
InstantTeleport(talker, 9745, 15606, -4574);
break;
}
case 3	:
{					
InstantTeleport(talker, -44836, -112524, -235);
break;
}
..........................and so on
}
}

}

}
I hope you got idea
zcold is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 19:37.