//include'lerin olduğu bölüme ekle;
#ifdef ENABLE_DICE_SYSTEM
#include "party.h"
#endif
//arat;
ALUA(pc_give_or_drop_item)
//fonksiyondan sonra ekle;
#ifdef ENABLE_DICE_SYSTEM
ALUA(pc_give_or_drop_item_with_dice)
{
if (!lua_isstring(L, 1) && !lua_isnumber(L, 1))
{
sys_err("QUEST Make item call error : wrong argument");
lua_pushnumber(L, 0);
return 1;
}
DWORD dwVnum;
if (lua_isnumber(L, 1))
{
dwVnum = (int)lua_tonumber(L, 1);
}
else if (!ITEM_MANAGER::instance().GetVnum(lua_tostring(L, 1), dwVnum))
{
sys_err("QUEST Make item call error : wrong item name : %s", lua_tostring(L, 1));
lua_pushnumber(L, 0);
return 1;
}
int icount = 1;
if (lua_isnumber(L, 2) && lua_tonumber(L, 2) > 0)
{
icount = (int)rint(lua_tonumber(L, 2));
if (icount <= 0)
{
sys_err("QUEST Make item call error : wrong item count : %g", lua_tonumber(L, 2));
lua_pushnumber(L, 0);
return 1;
}
}
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
LPITEM item = ITEM_MANAGER::instance().CreateItem(dwVnum, icount);
if (ch->GetParty())
{
FPartyDropDiceRoll f(item, ch);
f.Process(NULL);
f.GetItemOwner()->AutoGiveItem(item);
}
else
ch->AutoGiveItem(item);
sys_log(0, "QUEST [REWARD] item %s to %s", lua_tostring(L, 1), ch->GetName());
LogManager::instance().QuestRewardLog(CQuestManager::instance().GetCurrentPC()->GetCurrentQuestName().c_str(), ch->GetPlayerID(), ch->GetLevel(), dwVnum, icount);
lua_pushnumber(L, (item) ? item->GetID() : 0);
return 1;
}
#endif
//tekrar arat;
{ "give_item2", pc_give_or_drop_item },
//altına ekle;
#ifdef ENABLE_DICE_SYSTEM
{ "give_item2_with_dice", pc_give_or_drop_item_with_dice },
#endif
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}