teroare
Enthusiast
Hi guys and thanks in advance for looking into this!
I was browsing through Support section and I have found two interesting scripts posted by Tommy for someone inside this section.
First script, and the one I want to get some help in editing is the playtime reward script.
What I want it to do is add some values inside a column in auth database, account table ( vote point section called VP ) instead of awarding an item.
script looks like this :
The second one is a boss kill announcer, which announces the killer's name on chat when the certain creature is killed.
What I want to know is...where do I change the ID of the creature for which, if someone kills it, it will do the announcement ( also, can it disply the whole party mermber's name if boss is killed by a whole party ? ) ?
Also, can the killer or party receive an exp boost for , lets say, 1 hour after killing that boss ? ( this one is rather not important tho, the line above is )
Code looks like :
Best regards,
Cristi
I was browsing through Support section and I have found two interesting scripts posted by Tommy for someone inside this section.
First script, and the one I want to get some help in editing is the playtime reward script.
What I want it to do is add some values inside a column in auth database, account table ( vote point section called VP ) instead of awarding an item.
script looks like this :
Code:
class most_played : public PlayerScript
{
public:
most_played() : PlayerScript("most_played") { }
void OnLogin(Player* player)
{
time_t now = time(0);
tm* localDateTime = localtime(&now);
if (localDateTime->tm_wday == 5)
{
QueryResult result = CharacterDatabase.Query("SELECT guid, MAX(totaltime) FROM characters");
if (result)
{
Field* fields = result->Fetch();
uint64 guid = fields[0].GetUInt64();
if (player->GetGUID() == guid)
player->AddItem(3000, 1); // CHANGE 3000 (ITEMID) and 1 (ITEMCOUNT) to what you want!
}while(result->NextRow());
}
}
};
void AddSC_reward_most_played()
{
new most_played;
}
The second one is a boss kill announcer, which announces the killer's name on chat when the certain creature is killed.
What I want to know is...where do I change the ID of the creature for which, if someone kills it, it will do the announcement ( also, can it disply the whole party mermber's name if boss is killed by a whole party ? ) ?
Also, can the killer or party receive an exp boost for , lets say, 1 hour after killing that boss ? ( this one is rather not important tho, the line above is )
Code looks like :
Code:
class npc_boss_died : public CreatureScript
{
public:
npc_boss_died() : CreatureScript("npc_boss_died") { }
struct npc_boss_diedAI : public ScriptedAI
{
npc_boss_diedAI(Creature* creature) : ScriptedAI(creature) { }
void JustDied(Unit* killer)
{
std::ostringstream ss;
if (killer->GetTypeId() == TYPEID_PLAYER)
{
ss << killer->ToPlayer()->GetName()
<< " has killed "
<< me->GetName()
<< " a Rare Boss!";
sWorld->SendGlobalText(ss.str().c_str(), NULL);
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_boss_diedAI(creature);
}
};
void AddSC_rare_boss()
{
new npc_boss_died;
}
Best regards,
Cristi