EAkar 8 Posted March 15, 2022 Share Posted March 15, 2022 When I click on the blood victim object, I want affect to appear. and when i hover the mouse over this affect I want the spirits to write %d/20. I tried to do it myself, but affect does not come out. Type : ITEM_USE SubType: USE_SPECIAL My sample codes: char_item: case 70311: if (FindAffect(AFFECT_QUEST_SOUL)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You have used this before.")); return false; } if (GetQuestSoulPoint() >= 20) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot use it now. Use spirits first.")); return false; } if (quest::CQuestManager::instance().GetEventFlag("enable_roulette_event") != 1) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Ups! The event is currently inactive!")); return false; } AddAffect(AFFECT_QUEST_SOUL, POINT_NONE, 0, AFF_NONE, 2*60*60, 0, true); item->SetCount(item->GetCount() - 1); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can collect souls.")); ChatPacket(CHAT_TYPE_COMMAND, "AffectBloodCommand %d", GetQuestSoulPoint()); break; affect.h AFFECT_QUEST_SOUL = 741, clientsource instancebase "yes" game.py serverCommandList["AffectBloodCommand"] = self.AffectBloodCommand def AffectBloodCommand(self, point): if self.affectShower: self.affectShower.AffectShowerBlood(point) uiaffectshower.py class MainBloodShower(ui.ExpandedImageBox): def __init__(self): ui.ExpandedImageBox.__init__(self) self.point = 0 self.toolTip = uiToolTip.ToolTip(100) self.toolTip.HideToolTip() def SetState(self, point): self.toolTip.ClearToolTip() fileName ="d:/ymir work/ui/skill/common/affect/bloodpoint.sub" self.LoadImage(fileName) self.__AppendText(localeInfo.TOOLTIP_AFFECT_LATE_SUMMER_EVENT_BUFF % (self.point)) self.SetScale(0.7, 0.7) def __AppendText(self, text): self.toolTip.AppendTextLine(text) self.toolTip.ResizeToolTip() def OnMouseOverIn(self): self.toolTip.ShowToolTip() def OnMouseOverOut(self): self.toolTip.HideToolTip() class AffectShower(ui.Window): for def __init__(self): self.mainbloodshower=None def ClearAllAffects(self): self.mainbloodshower=None def AffectShowerBlood(self, point): image = MainBloodShower() image.SetParent(self) image.SetState(point) image.Show() self.mainbloodshower=image self.__ArrangeImageList() def __ArrangeImageList(self): if self.mainbloodshower: self.mainbloodshower.SetPosition(xPos, 0) xPos += self.IMAGE_STEP AffectCount += 1 but the effect does not come when I click on the item. char_battle.cpp int randomnumberlimit = 800; int prob = 100; int DeleteSoulPoint = GetQuestSoulPoint(); int levelrange = 10; if (quest::CQuestManager::instance().GetEventFlag("enable_roulette_event") == 1) { if (FindAffect(AFFECT_QUEST_SOUL) { if (!IsPC() && (pkKiller && pkKiller->IsPC())) { if (pkKiller->GetLevel() >= (pkKiller->GetLevel() - levelrange)) { if (GetMobRank() >= MOB_RANK_PAWN) { if (number(1, randomnumberlimit) <= prob) { pkKiller->PointChange(POINT_QSOUL, 1, true); pkKiller->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Huha! Winner SoulPoint. ")); } } if (GetQuestSoulPoint() >= 20) pkKiller->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You have gathered the necessary souls. Now take it to the Ritual.")); RemoveAffect(AFFECT_QUEST_SOUL); } } } } Link to comment Share on other sites More sharing options...
EAkar 8 Posted March 16, 2022 Author Share Posted March 16, 2022 ++ Link to comment Share on other sites More sharing options...
EAkar 8 Posted March 17, 2022 Author Share Posted March 17, 2022 ++ Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now