Facebook
From Colossal Capybara, 3 Years ago, written in C++.
This paste is a reply to Re: Untitled from Perl Bee - view diff
Embed
Download Paste or View Raw
Hits: 135
  1. //include'lerin olduğu bölüme ekle;
  2.  
  3. #ifdef ENABLE_DICE_SYSTEM
  4. #include "party.h"
  5. #endif
  6.  
  7. //arat;
  8.  
  9.     ALUA(game_drop_item_with_ownership)
  10.  
  11. //fonksiyondan sonra ekle;
  12.  
  13. #ifdef ENABLE_DICE_SYSTEM
  14.     ALUA(game_drop_item_with_ownership_and_dice)
  15.     {
  16.         LPITEM item = NULL;
  17.         switch (lua_gettop(L))
  18.         {
  19.         case 1:
  20.             item = ITEM_MANAGER::instance().CreateItem((DWORD)lua_tonumber(L, 1));
  21.             break;
  22.         case 2:
  23.         case 3:
  24.             item = ITEM_MANAGER::instance().CreateItem((DWORD)lua_tonumber(L, 1), (int)lua_tonumber(L, 2));
  25.             break;
  26.         default:
  27.             return 0;
  28.         }
  29.  
  30.         if (item == NULL)
  31.         {
  32.             return 0;
  33.         }
  34.  
  35.         LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
  36.         if (ch->GetParty())
  37.         {
  38.             FPartyDropDiceRoll f(item, ch);
  39.             f.Process(NULL);
  40.         }
  41.  
  42.         if (lua_isnumber(L, 3))
  43.         {
  44.             int sec = (int)lua_tonumber(L, 3);
  45.             if (sec <= 0)
  46.             {
  47.                 item->SetOwnership(ch);
  48.             }
  49.             else
  50.             {
  51.                 item->SetOwnership(ch, sec);
  52.             }
  53.         }
  54.         else
  55.             item->SetOwnership(ch);
  56.  
  57.         PIXEL_POSITION pos;
  58.         pos.x = ch->GetX() + number(-200, 200);
  59.         pos.y = ch->GetY() + number(-200, 200);
  60.  
  61.         item->AddToGround(ch->GetMapIndex(), pos);
  62.         item->StartDestroyEvent();
  63.  
  64.         return 0;
  65.     }
  66. #endif
  67.  
  68. //tekrar arat;
  69.  
  70.             { "drop_item_with_ownership",    game_drop_item_with_ownership    },
  71.  
  72. //altına ekle;
  73.  
  74. #ifdef ENABLE_DICE_SYSTEM
  75.             { "drop_item_with_ownership_and_dice",    game_drop_item_with_ownership_and_dice    },
  76. #endif

Replies to Re: Re: Untitled rss

Title Name Language When
Re: Re: Re: Untitled Edgy Iguana cpp 3 Years ago.